diff --git a/README.md b/README.md index d47f76ce..84228a4b 100644 --- a/README.md +++ b/README.md @@ -1,117 +1,1052 @@ # Third Party Hardware Drivers # -[![Version Badge](https://img.shields.io/badge/-v3.0.0-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases) -[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.4.3-green)](https://github.com/SiliconLabs/gecko_sdk/releases) -[![WSDK Badge](https://img.shields.io/badge/WSDK-v3.2.0-green)](https://github.com/SiliconLabs/wiseconnect/releases) +[![Version Badge](https://img.shields.io/badge/v4.0.0-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases) +[![GSDK Badge](https://img.shields.io/badge/SiSDK-v2024.6.2-green)](https://github.com/SiliconLabs/gecko_sdk/releases) +[![WSDK Badge](https://img.shields.io/badge/WSDK-v3.3.4-green)](https://github.com/SiliconLabs/wiseconnect/releases) ![License badge](https://img.shields.io/badge/License-Zlib-green) This repo contains example drivers developed by Silicon Labs engineers and are provided as [an SDK extension](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-getting-started/install-sdk-extensions). These drivers interface with different types of external hardware and are tested against a specific device listed in the driver name. These drivers are intended to be fully compatible with Silicon Labs' wireless stacks. All drivers provide a minimal Simplicity Studio project for testing and to show an example usage of the driver. The driver source is provided for modification and extension as needed. All drivers in this repository are considered to be EVALUATION QUALITY which implies that the code provided in the repos is subjected to limited testing and is provided provided as-is. It is not suitable for production environments. -A full list of all drivers in this repository is defined below: - -| Driver name | Link to driver | Link to example | Link to documentation | -|:----------|:------------------:|:----------:|:------------------:| -| captouch2_cap1166 | [Click Here](./driver/public/mikroe/captouch2_cap1166) | [Click Here](./app/example/mikroe_captouch2_cap1166) | [Click Here](./app/documentation/example/mikroe_captouch2_cap1166) | -| heartrate2_maxm86161 | [Click Here](./driver/public/mikroe/heartrate2_maxm86161) | [Click Here](./app/example/mikroe_heartrate2_maxm86161) | [Click Here](./app/documentation/example/mikroe_heartrate2_maxm86161) | -| temphum9_shtc3 | [Click Here](./driver/public/mikroe/temphum9_shtc3) | [Click Here](./app/example/mikroe_temphum9_shtc3) | [Click Here](./app/documentation/example/mikroe_temphum9_shtc3) | -| oledw_ssd1306 | [Click Here](./driver/public/mikroe/oledw_ssd1306) | [Click Here](./app/example/mikroe_oledw_ssd1306) | [Click Here](./app/documentation/example/mikroe_oledw_ssd1306) | -| mikroe_oledw_ssd1306_glib | [Click Here](./driver/public/silabs/services_tphd_glib) | [Click Here](./app/example/mikroe_oledw_ssd1306_glib) | [Click Here](./app/documentation/example/mikroe_oledw_ssd1306_glib) | -| buzz2_cmt_8540s_smt | [Click Here](./driver/public/mikroe/buzz2_cmt_8540s_smt) | [Click Here](./app/example/mikroe_buzz2_cmt_8540s_smt) | [Click Here](./app/documentation/example/mikroe_buzz2_cmt_8540s_smt) | -| brushless16_lb11685av | [Click Here](./driver/public/mikroe/brushless16_lb11685av) | [Click Here](./app/example/mikroe_brushless16_lb11685av) | [Click Here](./app/documentation/example/mikroe_brushless16_lb11685av) | -| accel5_bma400 | [Click Here](./driver/public/silabs/accel5_bma400) | [Click Here](./app/example/mikroe_accel5_bma400) | [Click Here](./app/documentation/example/mikroe_accel5_bma400) | -| dosimeter_type5 | [Click Here](./driver/public/silabs/dosimeter_type5) | [Click Here](./app/example/sparkfun_dosimeter_type5) | [Click Here](./app/documentation/example/sparkfun_dosimeter_type5) | -| micro_oled_ssd1306 | [Click Here](./driver/public/silabs/micro_oled_ssd1306) | [Click Here](./app/example/sparkfun_micro_oled_ssd1306) | [Click Here](./app/documentation/example/sparkfun_micro_oled_ssd1306) | -| rfid_id12la | [Click Here](./driver/public/silabs/rfid_id12la) | [Click Here](./app/example/sparkfun_rfid_id12la) | [Click Here](./app/documentation/example/sparkfun_rfid_id12la) | -| distance_vl53l1x | [Click Here](./driver/public/silabs/distance_vl53l1x) | [Click Here](./app/example/sparkfun_distance_vl53l1x) | [Click Here](./app/documentation/example/sparkfun_distance_vl53l1x) | -| co_mq7 | [Click Here](./driver/public/mikroe/co_mq7) | [Click Here](./app/example/mikroe_co_mq7) | [Click Here](./app/documentation/example/mikroe_co_mq7) | -| relay2_lca717 | [Click Here](./driver/public/mikroe/relay2_lca717) | [Click Here](./app/example/mikroe_relay2_lca717) | [Click Here](./app/documentation/example/mikroe_relay2_lca717) | -| accelerometer_mma8452q | [Click Here](./driver/public/silabs/accelerometer_mma8452q) | [Click Here](./app/example/sparkfun_accelerometer_mma8452q) | [Click Here](./app/documentation/example/sparkfun_accelerometer_mma8452q) | -| spectroscopy_as7265x | [Click Here](./driver/public/silabs/spectroscopy_as7265x) | [Click Here](./app/example/sparkfun_spectroscopy_as7265x) | [Click Here](./app/documentation/example/sparkfun_spectroscopy_as7265x) | -| qwiic_joystick | [Click Here](./driver/public/silabs/qwiic_joystick) | [Click Here](./app/example/sparkfun_qwiic_joystick) | [Click Here](./app/documentation/example/sparkfun_qwiic_joystick) | -| utm7segr_max6969 | [Click Here](./driver/public/mikroe/utm7segr_max6969) | [Click Here](./app/example/mikroe_utm7segr_max6969) | [Click Here](./app/documentation/example/mikroe_utm7segr_max6969) | -| human_presence_ak9753 | [Click Here](./driver/public/silabs/human_presence_ak9753) | [Click Here](./app/example/sparkfun_human_presence_ak9753) | [Click Here](./app/documentation/example/sparkfun_human_presence_ak9753) | -| soil_moisture | [Click Here](./driver/public/silabs/soil_moisture) | [Click Here](./app/example/sparkfun_soil_moisture) | [Click Here](./app/documentation/example/sparkfun_soil_moisture) | -| ir_aray_mlx90640 | [Click Here](./driver/public/silabs/ir_array_mlx90640) | [Click Here](./app/example/sparkfun_ir_array_mlx90640) | [Click Here](./app/documentation/example/sparkfun_ir_array_mlx90640) | -| proximity_vcnl4040 | [Click Here](./driver/public/silabs/proximity_vcnl4040) | [Click Here](./app/example/sparkfun_proximity_vcnl4040) | [Click Here](./app/documentation/example/sparkfun_proximity_vcnl4040) | -| eth_wiz_w5500 | [Click Here](./driver/public/mikroe/eth_wiz_w5500) | [Click Here](./app/example/mikroe_eth_wiz_w5500) | [Click Here](./app/documentation/example/mikroe_eth_wiz_w5500) | -| fuel_gauge_max17048 | [Click Here](./driver/public/silabs/fuel_gauge_max17048) | [Click Here](./app/example/maxim_fuel_gauge_max17048) | [Click Here](./app/documentation/example/maxim_fuel_gauge_max17048) | -| barcode2_em3080w | [Click Here](./driver/public/mikroe/barcode2_em3080w) | [Click Here](./app/example/mikroe_barcode2_em3080w) | [Click Here](./app/documentation/example/mikroe_barcode2_em3080w) | -| water_detect | [Click Here](./driver/public/mikroe/water_detect) | [Click Here](./app/example/mikroe_water_detect) | [Click Here](./app/documentation/example/mikroe_water_detect) | -| radar_mm5d91_00 | [Click Here](./driver/public/mikroe/radar_mm5d91_00) | [Click Here](./app/example/mikroe_radar_mm5d91_00) | [Click Here](./app/documentation/example/mikroe_radar_mm5d91_00) | -| rgb_led_is31fl3741 | [Click Here](./driver/public/silabs/rgb_led_is31fl3741) | [Click Here](./app/example/adafruit_rgb_led_is31fl3741) | [Click Here](./app/documentation/example/adafruit_rgb_led_is31fl3741) | -| fingerprint2_a172mrq | [Click Here](./driver/public/mikroe/fingerprint2_a172mrq) | [Click Here](./app/example/mikroe_fingerprint2_a172mrq) | [Click Here](./app/documentation/example/mikroe_fingerprint2_a172mrq) | -| air_quality_sgp40 | [Click Here](./driver/public/silabs/air_quality_sgp40) | [Click Here](./app/example/sparkfun_air_quality_sgp40) | [Click Here](./app/documentation/example/sparkfun_air_quality_sgp40) | -| environment2_sht40_sgp40 | [Click Here](./driver/public/mikroe/environment2_sht40_sgp40) | [Click Here](./app/example/mikroe_environment2_sht40_sgp40) | [Click Here](./app/documentation/example/mikroe_environment2_sht40_sgp40) | -| heartrate4_max30101 | [Click Here](./driver/public/mikroe/heartrate4_max30101) | [Click Here](./app/example/mikroe_heartrate4_max30101) | [Click Here](./app/documentation/example/mikroe_heartrate4_max30101) | -| hr_po_max30101_max32664 | [Click Here](./driver/public/silabs/hr_po_max30101_max32664) | [Click Here](./app/example/sparkfun_hr_po_max30101_max32664) | [Click Here](./app/documentation/example/sparkfun_hr_po_max30101_max32664) | -| alcohol_mq3 | [Click Here](./driver/public/mikroe/alcohol_mq3) | [Click Here](./app/example/mikroe_alcohol_mq3) | [Click Here](./app/documentation/example/mikroe_alcohol_mq3) | -| gps_lea6s | [Click Here](./driver/public/mikroe/gps_lea6s) | [Click Here](./app/example/mikroe_gps_lea6s) | [Click Here](./app/documentation/example/mikroe_gps_lea6s) | -| temphum15_sht40 | [Click Here](./driver/public/mikroe/temphum15_sht40) | [Click Here](./app/example/mikroe_temphum15_sht40) | [Click Here](./app/documentation/example/mikroe_temphum15_sht40) | -| irthermo3_mlx90632 | [Click Here](./driver/public/mikroe/irthermo3_mlx90632) | [Click Here](./app/example/mikroe_irthermo3_mlx90632) | [Click Here](./app/documentation/example/mikroe_irthermo3_mlx90632) | -| stepper_a3967 | [Click Here](./driver/public/silabs/stepper_a3967) | [Click Here](./app/example/mikroe_stepper_a3967) | [Click Here](./app/documentation/example/mikroe_stepper_a3967) | -| stepper2_a4988 | [Click Here](./driver/public/mikroe/stepper2_a4988) | [Click Here](./app/example/mikroe_stepper2_a4988) | [Click Here](./app/documentation/example/mikroe_stepper2_a4988) | -| dcmotor3_tb6549fg | [Click Here](./driver/public/mikroe/dcmotor3_tb6549fg) | [Click Here](./app/example/mikroe_dcmotor3_tb6549fg) | [Click Here](./app/documentation/example/mikroe_dcmotor3_tb6549fg) | -| environmental_bme280_ccs811 | [Click Here](./driver/public/silabs/environmental_bme280_ccs811) | [Click Here](./app/example/sparkfun_environmental_bme280_ccs811) | [Click Here](./app/documentation/example/sparkfun_environmental_bme280_ccs811) | -| oledc_ssd1351 | [Click Here](./driver/public/mikroe/oledc_ssd1351) | [Click Here](./app/example/mikroe_oledc_ssd1351) | [Click Here](./app/documentation/example/mikroe_oledc_ssd1351) | -| pressure3_dps310 | [Click Here](./driver/public/mikroe/pressure3_dps310) | [Click Here](./app/example/mikroe_pressure3_dps310) | [Click Here](./app/documentation/example/mikroe_pressure3_dps310) | -| lte_iot2_bg96 | [Click Here](./driver/public/mikroe/lte_iot2_bg96) | [Click Here](./app/example/mikroe_lte_iot2_bg96) | [Click Here](./app/documentation/example/mikroe_lte_iot2_bg96) | -| e_paper_154_inch | [Click Here](./driver/public/mikroe/e_paper_154_inch) | [Click Here](./app/example/mikroe_e_paper_154_inch) | [Click Here](./app/documentation/example/mikroe_e_paper_154_inch) | -| ir_array_amg88xx | [Click Here](./driver/public/silabs/ir_array_amg88xx) | [Click Here](./app/example/sparkfun_ir_array_amg88xx) | [Click Here](./app/documentation/example/sparkfun_ir_array_amg88xx) | -| nfc2_pn7150 | [Click Here](./driver/public/mikroe/nfc2_pn7150) | [Click Here](./app/example/mikroe_nfc2_pn7150) | [Click Here](./app/documentation/example/mikroe_nfc2_pn7150) | -| nfc2_pn7150_t2t_read | [Click Here](./driver/public/silabs/services_nfc) | [Click Here](./app/example/mikroe_nfc2_pn7150_nci_t2t_read) | [Click Here](./app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read) | -| nfc2_pn7150_t2t_write | [Click Here](./driver/public/silabs/services_nfc) | [Click Here](./app/example/mikroe_nfc2_pn7150_nci_t2t_write) | [Click Here](./app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write) | -| ir_generate | [Click Here](./driver/public/silabs/ir_generate) | [Click Here](./app/example/silabs_ir_generate) | [Click Here](./app/documentation/example/silabs_ir_generate) | -| triac | [Click Here](./driver/public/silabs/triac) | [Click Here](./app/example/silabs_triac) | [Click Here](./app/documentation/example/silabs_triac) | -| mikroe_microsd | [Click Here](./driver/public/mikroe/mikroe_microsd) | [Click Here](./app/example/mikroe_microsd) | [Click Here](./app/documentation/example/mikroe_microsd) | -| pir_ira_s210st01 | [Click Here](./driver/public/silabs/pir_ira_s210st01) | [Click Here](./app/example/silabs_pir_ira_s210st01) | [Click Here](./app/documentation/example/silabs_pir_ira_s210st01) | -| rf_meter_ad8318 | [Click Here](./driver/public/mikroe/rf_meter_ad8318) | [Click Here](./app/example/mikroe_rf_meter_ad8318) | [Click Here](./app/documentation/example/mikroe_rf_meter_ad8318) | -| nfctag2_nt3h2111 | [Click Here](./driver/public/silabs/nfctag2_nt3h2111) | [Click Here](./app/example/mikroe_nfctag2_nt3h2111) | [Click Here](./app/documentation/example/mikroe_nfctag2_nt3h2111) | -| pwm_driver_si8711cc | [Click Here](./driver/public/mikroe/pwm_driver_si8711cc) | [Click Here](./app/example/mikroe_pwm_driver_si8711cc) | [Click Here](./app/documentation/example/mikroe_pwm_driver_si8711cc) | -| mikroe_mic2 | [Click Here](./driver/public/mikroe/mic2) | [Click Here](./app/example/mikroe_mic2) | [Click Here](./app/documentation/example/mikroe_mic2) | -| turbidity_tsd10 | [Click Here](./driver/public/mikroe/turbidity_tsd10) | [Click Here](./app/example/mikroe_turbidity_tsd10) | [Click Here](./app/documentation/example/mikroe_turbidity_tsd10) | -| environment3_bme688 | [Click Here](./driver/public/silabs/environment3_bme688) | [Click Here](./app/example/mikroe_environment3_bme688) | [Click Here](./app/documentation/example/mikroe_environment3_bme688) | -| ozone2_mq131 | [Click Here](./driver/public/mikroe/ozone2_mq131) | [Click Here](./app/example/mikroe_ozone2_mq131) | [Click Here](./app/documentation/example/mikroe_ozone2_mq131) | -| uv_ml8511a | [Click Here](./driver/public/mikroe/uv_ml8511a) | [Click Here](./app/example/mikroe_uv_ml8511a) | [Click Here](./app/documentation/example/mikroe_uv_ml8511a) | -| tft_lcd_ili9341 | [Click Here](./driver/public/silabs/tft_lcd_ili9341) | [Click Here](./app/example/adafruit_tft_lcd_ili9341) | [Click Here](./app/documentation/example/adafruit_tft_lcd_ili9341) | -| tft_lcd_ili9341_lvgl | [Click Here](./driver/public/silabs/services_lvgl) | [Click Here](./app/example/adafruit_tft_lcd_ili9341_lvgl) | [Click Here](./app/documentation/example/adafruit_tft_lcd_ili9341_lvgl) | -| servo_pca9685 | [Click Here](./driver/public/mikroe/servo_pca9685) | [Click Here](./app/example/mikroe_servo_pca9685) | [Click Here](./app/documentation/example/mikroe_servo_pca9685) | -| force3_fsr400 | [Click Here](./driver/public/mikroe/force3_fsr400) | [Click Here](./app/example/mikroe_force3_fsr400) | [Click Here](./app/documentation/example/mikroe_force3_fsr400) | -| emg | [Click Here](./driver/public/mikroe/emg) | [Click Here](./app/example/mikroe_emg) | [Click Here](./app/documentation/example/mikroe_emg) | -| bthome_v2 | [Click Here](./driver/public/silabs/bthome_v2) | [Click Here](./app/example/bthome_v2) | [Click Here](./app/documentation/example/bthome_v2) | -| bthome_v2_server | [Click Here](./driver/public/silabs/bthome_v2_server) | [Click Here](./app/example/bthome_v2_server) | [Click Here](./app/documentation/example/bthome_v2_server) | -| services_enocean_switch_proxy_server | [Click Here](./driver/public/silabs/services_enocean_switch_proxy_server) | N/A | N/A | -| services_lin_bus_slave | [Click Here](./driver/public/silabs/services_lin_bus_slave) | [Click Here](./app/example/silabs_lin_bus) | [Click Here](./app/documentation/example/silabs_lin_bus) | -| obdii_stn1110 | [Click Here](./driver/public/mikroe/obdii_stn1110) | [Click Here](./app/example/mikroe_obdii_stn1110) | [Click Here](./app/documentation/example/mikroe_obdii_stn1110) | -| thunder_as3935 | [Click Here](./driver/public/mikroe/thunder_as3935) | [Click Here](./app/example/mikroe_thunder_as3935) | [Click Here](./app/documentation/example/mikroe_thunder_as3935) | -| mikroe_rng | [Click Here](./driver/public/mikroe/rng) | [Click Here](./app/example/mikroe_rng) | [Click Here](./app/documentation/example/mikroe_rng) | -| smoke2_adpd188bi | [Click Here](./driver/public/mikroe/smoke2_adpd188bi) | [Click Here](./app/example/mikroe_smoke2_adpd188bi) | [Click Here](./app/documentation/example/mikroe_smoke2_adpd188bi) | -| qwiic_keypad | [Click Here](./driver/public/silabs/qwiic_keypad) | [Click Here](./app/example/sparkfun_qwiic_keypad) | [Click Here](./app/documentation/example/sparkfun_qwiic_keypad) | -| tft_lcd_st7789 | [Click Here](./driver/public/silabs/tft_lcd_st7789) | [Click Here](./app/example/adafruit_tft_lcd_st7789) | [Click Here](./app/documentation/example/adafruit_tft_lcd_st7789) | -| tft_lcd_st7789_lvgl | [Click Here](./driver/public/silabs/services_lvgl) | [Click Here](./app/example/adafruit_tft_lcd_st7789_lvgl_dma) | [Click Here](./app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma) | -| tft_lcd_hxd8357d | [Click Here](./driver/public/silabs/tft_lcd_hxd8357d) | [Click Here](./app/example/adafruit_tft_lcd_hxd8357d) | [Click Here](./app/documentation/example/adafruit_tft_lcd_hxd8357d) | -| tft_lcd_hxd8357d_lvgl | [Click Here](./driver/public/silabs/tft_lcd_hxd8357d) | [Click Here](./app/example/adafruit_tft_lcd_hxd8357d_lvgl) | [Click Here](./app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl) | -| mikroe_stretch | [Click Here](./driver/public/mikroe/stretch) | [Click Here](./app/example/mikroe_stretch) | [Click Here](./app/documentation/example/mikroe_stretch) | -| adafruit_touchscreen_tsc2007 | [Click Here](./driver/public/silabs/touchscreen_tsc2007) | [Click Here](./app/example/adafruit_touchscreen_tsc2007) | [Click Here](./app/documentation/example/adafruit_touchscreen_tsc2007) | -| mikroe_dcmotor24_l9958 | [Click Here](./driver/public/mikroe/dcmotor24_l9958) | [Click Here](./app/example/mikroe_dcmotor24_l9958) | [Click Here](./app/documentation/example/mikroe_dcmotor24_l9958) | -| rtc10_ds3231m | [Click Here](./driver/public/mikroe/rtc10_ds3231m) | [Click Here](./app/example/mikroe_rtc10_ds3231m) | [Click Here](./app/documentation/example/mikroe_rtc10_ds3231m) | -| mikroe_hvac | [Click Here](./driver/public/mikroe/hvac_scd41) | [Click Here](./app/example/mikroe_hvac_scd41) | [Click Here](./app/documentation/example/mikroe_hvac_scd41) | -| mikroe_dcmotor26_tb9053ftg | [Click Here](./driver/public/mikroe/dcmotor26_tb9053ftg) | [Click Here](./app/example/mikroe_dcmotor26_tb9053ftg) | [Click Here](./app/documentation/example/mikroe_dcmotor26_tb9053ftg) | -| particulate_matter_sensor_sps30 | [Click Here](./driver/public/silabs/particulate_matter_sensor_sps30) | [Click Here](./app/example/sparkfun_particulate_matter_sensor_sps30) | [Click Here](./app/documentation/example/sparkfun_particulate_matter_sensor_sps30) | -| adafruit_neotrellis_keypad_atsamd09 | [Click Here](./driver/public/silabs/adafruit_neotrellis_keypad_atsamd09) | [Click Here](./app/example/adafruit_neotrellis_keypad_atsamd09) | [Click Here](./app/documentation/example/adafruit_neotrellis_keypad_atsamd09) | -| hvac_bundle_scd41_sps30 | [Click Here](./driver/public/mikroe/hvac_scd41)
[Click Here](./driver/public/silabs/particulate_matter_sensor_sps30)| [Click Here](./app/example/mikroe_hvac_bundle_scd41_sps30) | [Click Here](./app/documentation/example/mikroe_hvac_bundle_scd41_sps30) | -| mikroe_pir_pl_n823_01 | [Click Here](./driver/public/mikroe/pir_pl_n823_01) | [Click Here](./app/example/mikroe_pir_pl_n823_01) | [Click Here](./app/documentation/example/mikroe_pir_pl_n823_01) | -| mikroe_uwb_dwm1000 | [Click Here](./driver/public/mikroe/uwb_dwm1000) | [Click Here](./app/example/mikroe_uwb_dwm1000) | [Click Here](./app/documentation/example/mikroe_uwb_dwm1000) | -| mikroe_uwb2_dwm3000 | [Click Here](./driver/public/silabs/uwb2_dwm3000) | [Click Here](./app/example/mikroe_uwb2_dwm3000) | [Click Here](./app/documentation/example/mikroe_uwb2_dwm3000) | -| sparkfun_gnss_max_m10s | [Click Here](./driver/public/silabs/gnss_max_m10s) | [Click Here](./app/example/sparkfun_gnss_max_m10s) | [Click Here](./app/documentation/example/sparkfun_gnss_max_m10s) | -| sparkfun_6dof_imu_bmi270 | [Click Here](./driver/public/silabs/sparkfun_6dof_imu_bmi270) | [Click Here](./app/example/sparkfun_6dof_imu_bmi270) | [Click Here](./app/documentation/example/sparkfun_6dof_imu_bmi270) | +## SoC Compatibility ## + +The following table shows extension support for Silicon Labs SoCs where ![Static Badge](https://img.shields.io/badge/preview-orange) and ![Static Badge](https://img.shields.io/badge/supported-green) denote preview and support, respectively. + +| Chip family | v1.x.x | [v2.x.x](https://github.com/SiliconLabs/third_party_hw_drivers_extension/tree/release/v2) | [v3.x.x](https://github.com/SiliconLabs/third_party_hw_drivers_extension/tree/release/v3) | v4.x.x | +|---|---|---|---|---| +|Series 1|![Static Badge](https://img.shields.io/badge/supported-green)|![Static Badge](https://img.shields.io/badge/supported-green)|![Static Badge](https://img.shields.io/badge/supported-green)|| +|Series 2|![Static Badge](https://img.shields.io/badge/supported-green)|![Static Badge](https://img.shields.io/badge/supported-green)|![Static Badge](https://img.shields.io/badge/supported-green)|![Static Badge](https://img.shields.io/badge/supported-green)| +|SiWx917|||![Static Badge](https://img.shields.io/badge/preview-orange)|![Static Badge](https://img.shields.io/badge/supported-green)| + + +This extension supports Simplicity SDK from v4.0.0, prior versions support GSDK. + +For the SiW917 chip family, WiseConnect SDK is supported from v3.0.0. + +Each release provides SDK compatibility information in the README file, for further details check the version-specific readmes. + +A full list of all examples and drivers in this repository is defined below: + +## Examples ## + +| No | Name | Example | Documentation | +|:--:|:-------------|:-------------------:|:---------------:| +| 1 | A-172-MRQ - Fingerprint 2 Click (Mikroe) | [Example](./app/example/mikroe_fingerprint2_a172mrq) | [Documentation](./app/documentation/example/mikroe_fingerprint2_a172mrq) | +| 2 | A3967 - Stepper Click (Mikroe) | [Example](./app/example/mikroe_stepper_a3967) | [Documentation](./app/documentation/example/mikroe_stepper_a3967) | +| 3 | A4988 - Stepper 2 Click (Mikroe) | [Example](./app/example/mikroe_stepper2_a4988) | [Documentation](./app/documentation/example/mikroe_stepper2_a4988) | +| 4 | AC Current Click (Mikroe) | [Example](./app/example/mikroe_accurrent) | [Documentation](./app/documentation/example/mikroe_accurrent) | +| 5 | AD8318 - RF Meter Click (Mikroe) | [Example](./app/example/mikroe_rf_meter_ad8318) | [Documentation](./app/documentation/example/mikroe_rf_meter_ad8318) | +| 6 | AK9753 - Human Presence Sensor (Sparkfun) | [Example](./app/example/sparkfun_human_presence_ak9753) | [Documentation](./app/documentation/example/sparkfun_human_presence_ak9753) | +| 7 | AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun) | [Example](./app/example/sparkfun_ir_array_amg88xx) | [Documentation](./app/documentation/example/sparkfun_ir_array_amg88xx) | +| 8 | AS3935 - Thunder Click (Mikroe) | [Example](./app/example/mikroe_thunder_as3935) | [Documentation](./app/documentation/example/mikroe_thunder_as3935) | +| 9 | AS7265X - Triad Spectroscopy Sensor (SparkFun) | [Example](./app/example/sparkfun_spectroscopy_as7265x) | [Documentation](./app/documentation/example/sparkfun_spectroscopy_as7265x) | +| 10 | BG96 - LTE IoT 2 (Mikroe) | [Example](./app/example/mikroe_lte_iot2_bg96) | [Documentation](./app/documentation/example/mikroe_lte_iot2_bg96) | +| 11 | BMA400 - Accel 5 Click (Mikroe) - I2C | [Example](./app/example/mikroe_accel5_bma400) | [Documentation](./app/documentation/example/mikroe_accel5_bma400) | +| 12 | BMA400 - Accel 5 Click (Mikroe) - SPI | [Example](./app/example/mikroe_accel5_bma400) | [Documentation](./app/documentation/example/mikroe_accel5_bma400) | +| 13 | BME280 & CCS811 - Environmental Sensor Combo Breakout (Sparkfun) | [Example](./app/example/sparkfun_environmental_bme280_ccs811) | [Documentation](./app/documentation/example/sparkfun_environmental_bme280_ccs811) | +| 14 | BME688 - Environment 3 Click (Mikroe) - I2C | [Example](./app/example/mikroe_environment3_bme688) | [Documentation](./app/documentation/example/mikroe_environment3_bme688) | +| 15 | BME688 - Environment 3 Click (Mikroe) - SPI | [Example](./app/example/mikroe_environment3_bme688) | [Documentation](./app/documentation/example/mikroe_environment3_bme688) | +| 16 | BMI270 - 6DOF IMU (SparkFun) | [Example](./app/example/sparkfun_6dof_imu_bmi270) | [Documentation](./app/documentation/example/sparkfun_6dof_imu_bmi270) | +| 17 | BTHome v2 | [Example](./app/example/bthome_v2) | [Documentation](./app/documentation/example/bthome_v2) | +| 18 | BTHome v2 - Server | [Example](./app/example/bthome_v2_server) | [Documentation](./app/documentation/example/bthome_v2_server) | +| 19 | CAP1166 - Cap Touch 2 Click (Mikroe) | [Example](./app/example/mikroe_captouch2_cap1166) | [Documentation](./app/documentation/example/mikroe_captouch2_cap1166) | +| 20 | CMT-8540S-SMT - Buzz 2 Click (Mikroe) | [Example](./app/example/mikroe_buzz2_cmt_8540s_smt) | [Documentation](./app/documentation/example/mikroe_buzz2_cmt_8540s_smt) | +| 21 | DPS310 - Pressure 3 Click (Mikroe) - I2C | [Example](./app/example/mikroe_pressure3_dps310) | [Documentation](./app/documentation/example/mikroe_pressure3_dps310) | +| 22 | DPS310 - Pressure 3 Click (Mikroe) - SPI | [Example](./app/example/mikroe_pressure3_dps310) | [Documentation](./app/documentation/example/mikroe_pressure3_dps310) | +| 23 | DS3231M - RTC 10 (Mikroe) | [Example](./app/example/mikroe_rtc10_ds3231m) | [Documentation](./app/documentation/example/mikroe_rtc10_ds3231m) | +| 24 | DWM1000 - UWB Click (Mikroe) | [Example](./app/example/mikroe_uwb_dwm1000) | [Documentation](./app/documentation/example/mikroe_uwb_dwm1000) | +| 25 | DWM3000 - UWB 2 Click (Mikroe) | [Example](./app/example/mikroe_uwb2_dwm3000/SimplicityStudio) | [Documentation](./app/documentation/example/mikroe_uwb2_dwm3000) | +| 26 | E-Paper Display - eINK Click (Mikroe) | [Example](./app/example/mikroe_eink_display) | [Documentation](./app/documentation/example/mikroe_eink_display) | +| 27 | E-paper EXT3-1 | [Example](./app/example/epaper_ext3_1) | [Documentation](./app/documentation/example/epaper_ext3_1) | +| 28 | EM3080-W - Barcode 2 Click (Mikroe) | [Example](./app/example/mikroe_barcode2_em3080w) | [Documentation](./app/documentation/example/mikroe_barcode2_em3080w) | +| 29 | EMG Click (Mikroe) | [Example](./app/example/mikroe_emg) | [Documentation](./app/documentation/example/mikroe_emg) | +| 30 | FSR400 - Force 3 Click (Mikroe) | [Example](./app/example/mikroe_force3_fsr400) | [Documentation](./app/documentation/example/mikroe_force3_fsr400) | +| 31 | HXD8357D - TFT LCD with Touchscreen (Adafruit) - SPI | [Example](./app/example/adafruit_tft_lcd_hxd8357d) | [Documentation](./app/documentation/example/adafruit_tft_lcd_hxd8357d) | +| 32 | HXD8357D - TFT LCD with Touchscreen (Adafruit) - SPI with DMA | [Example](./app/example/adafruit_tft_lcd_hxd8357d) | [Documentation](./app/documentation/example/adafruit_tft_lcd_hxd8357d) | +| 33 | HXD8357D - TFT LCD with Touchscreen (Adafruit) with LVGL | [Example](./app/example/adafruit_tft_lcd_hxd8357d_lvgl) | [Documentation](./app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl) | +| 34 | HXD8357D - TFT LCD with Touchscreen (Adafruit) with LVGL + DMA | [Example](./app/example/adafruit_tft_lcd_hxd8357d_lvgl) | [Documentation](./app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl) | +| 35 | ID-12LA - RFID Qwiic Reader (Sparkfun) | [Example](./app/example/sparkfun_rfid_id12la) | [Documentation](./app/documentation/example/sparkfun_rfid_id12la) | +| 36 | ILI9341 - TFT LCD with Touchscreen (Adafruit) - SPI | [Example](./app/example/adafruit_tft_lcd_ili9341) | [Documentation](./app/documentation/example/adafruit_tft_lcd_ili9341) | +| 37 | ILI9341 - TFT LCD with Touchscreen (Adafruit) - SPI with DMA | [Example](./app/example/adafruit_tft_lcd_ili9341) | [Documentation](./app/documentation/example/adafruit_tft_lcd_ili9341) | +| 38 | ILI9341 - TFT LCD with Touchscreen (Adafruit) with LVGL | [Example](./app/example/adafruit_tft_lcd_ili9341_lvgl) | [Documentation](./app/documentation/example/adafruit_tft_lcd_ili9341_lvgl) | +| 39 | ILI9341 - TFT LCD with Touchscreen (Adafruit) with LVGL + DMA | [Example](./app/example/adafruit_tft_lcd_ili9341_lvgl) | [Documentation](./app/documentation/example/adafruit_tft_lcd_ili9341_lvgl) | +| 40 | IR Generator (Silabs) | [Example](./app/example/silabs_ir_generate) | [Documentation](./app/documentation/example/silabs_ir_generate) | +| 41 | IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) | [Example](./app/example/adafruit_rgb_led_is31fl3741) | [Documentation](./app/documentation/example/adafruit_rgb_led_is31fl3741) | +| 42 | L9958 - DC Motor 24 Click (Mikroe) | [Example](./app/example/mikroe_dcmotor24_l9958) | [Documentation](./app/documentation/example/mikroe_dcmotor24_l9958) | +| 43 | LB11685AV - Brushless 16 Click (Mikroe) | [Example](./app/example/mikroe_brushless16_lb11685av) | [Documentation](./app/documentation/example/mikroe_brushless16_lb11685av) | +| 44 | LCA717 - Relay 2 Click (Mikroe) | [Example](./app/example/mikroe_relay2_lca717) | [Documentation](./app/documentation/example/mikroe_relay2_lca717) | +| 45 | LEA-6S - GPS Click (Mikroe) | [Example](./app/example/mikroe_gps_lea6s) | [Documentation](./app/documentation/example/mikroe_gps_lea6s) | +| 46 | LIN Bus Master | [Example](./app/example/silabs_lin_bus/master) | [Documentation](./app/documentation/example/silabs_lin_bus) | +| 47 | LIN Bus Slave Device 1 | [Example](./app/example/silabs_lin_bus/slave) | [Documentation](./app/documentation/example/silabs_lin_bus) | +| 48 | LIN Bus Slave Device 2 | [Example](./app/example/silabs_lin_bus/slave) | [Documentation](./app/documentation/example/silabs_lin_bus) | +| 49 | MAX-M10S - GNSS Receiver Breakout (Sparkfun) | [Example](./app/example/sparkfun_gnss_max_m10s) | [Documentation](./app/documentation/example/sparkfun_gnss_max_m10s) | +| 50 | MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim) | [Example](./app/example/maxim_fuel_gauge_max17048) | [Documentation](./app/documentation/example/maxim_fuel_gauge_max17048) | +| 51 | MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun) | [Example](./app/example/sparkfun_hr_po_max30101_max32664) | [Documentation](./app/documentation/example/sparkfun_hr_po_max30101_max32664) | +| 52 | MAX30101 - Heart Rate 4 Click (Mikroe) | [Example](./app/example/mikroe_heartrate4_max30101) | [Documentation](./app/documentation/example/mikroe_heartrate4_max30101) | +| 53 | MAX6969 - UT-M 7-SEG R Click (Mikroe) | [Example](./app/example/mikroe_utm7segr_max6969) | [Documentation](./app/documentation/example/mikroe_utm7segr_max6969) | +| 54 | MAXM86161 - Heartrate 2 Click (Mikroe) | [Example](./app/example/mikroe_heartrate2_maxm86161) | [Documentation](./app/documentation/example/mikroe_heartrate2_maxm86161) | +| 55 | MIC 2 Click (Mikroe) | [Example](./app/example/mikroe_mic2) | [Documentation](./app/documentation/example/mikroe_mic2) | +| 56 | microSD Click (Mikroe) | [Example](./app/example/mikroe_microsd) | [Documentation](./app/documentation/example/mikroe_microsd) | +| 57 | ML8511A - UV Click (Mikroe) | [Example](./app/example/mikroe_uv_ml8511a) | [Documentation](./app/documentation/example/mikroe_uv_ml8511a) | +| 58 | MLX90632 - IrThermo 3 Click (Mikroe) | [Example](./app/example/mikroe_irthermo3_mlx90632) | [Documentation](./app/documentation/example/mikroe_irthermo3_mlx90632) | +| 59 | MLX90640 - IR Array Breakout (Sparkfun) | [Example](./app/example/sparkfun_ir_array_mlx90640) | [Documentation](./app/documentation/example/sparkfun_ir_array_mlx90640) | +| 60 | MM5D91-00 - Radar Click (Mikroe) | [Example](./app/example/mikroe_radar_mm5d91_00) | [Documentation](./app/documentation/example/mikroe_radar_mm5d91_00) | +| 61 | MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun) | [Example](./app/example/sparkfun_accelerometer_mma8452q) | [Documentation](./app/documentation/example/sparkfun_accelerometer_mma8452q) | +| 62 | MQ131 - Ozone 2 Click (Mikroe) | [Example](./app/example/mikroe_ozone2_mq131) | [Documentation](./app/documentation/example/mikroe_ozone2_mq131) | +| 63 | MQ3 - Alcohol Click (Mikroe) | [Example](./app/example/mikroe_alcohol_mq3) | [Documentation](./app/documentation/example/mikroe_alcohol_mq3) | +| 64 | MQ7 - CO Click (Mikroe) | [Example](./app/example/mikroe_co_mq7) | [Documentation](./app/documentation/example/mikroe_co_mq7) | +| 65 | NeoTrellis 4x4 Keypad (Adafruit) | [Example](./app/example/adafruit_neotrellis_keypad_atsamd09) | [Documentation](./app/documentation/example/adafruit_neotrellis_keypad_atsamd09) | +| 66 | NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C | [Example](./app/example/mikroe_nfctag2_nt3h2111) | [Documentation](./app/documentation/example/mikroe_nfctag2_nt3h2111) | +| 67 | PCA9685 - Servo Click (Mikroe) | [Example](./app/example/mikroe_servo_pca9685) | [Documentation](./app/documentation/example/mikroe_servo_pca9685) | +| 68 | PH 2 Click (Mikroe) | [Example](./app/example/mikroe_ph2) | [Documentation](./app/documentation/example/mikroe_ph2) | +| 69 | PL-N823-01 - PIR Click (Mikroe) | [Example](./app/example/mikroe_pir_pl_n823_01) | [Documentation](./app/documentation/example/mikroe_pir_pl_n823_01) | +| 70 | PN7150 - NFC 2 Click (Mikroe) - I2C | [Example](./app/example/mikroe_nfc2_pn7150) | [Documentation](./app/documentation/example/mikroe_nfc2_pn7150) | +| 71 | PN7150 - Read a T2T Tag with NCI | [Example](./app/example/mikroe_nfc2_pn7150_nci_t2t_read) | [Documentation](./app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read) | +| 72 | PN7150 - Write to a T2T Tag with NCI | [Example](./app/example/mikroe_nfc2_pn7150_nci_t2t_write) | [Documentation](./app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write) | +| 73 | Pocket Geiger Radiation Sensor - Type 5 (Sparkfun) | [Example](./app/example/sparkfun_dosimeter_type5) | [Documentation](./app/documentation/example/sparkfun_dosimeter_type5) | +| 74 | Qwiic Joystick (Sparkfun) | [Example](./app/example/sparkfun_qwiic_joystick) | [Documentation](./app/documentation/example/sparkfun_qwiic_joystick) | +| 75 | Qwiic Keypad (Sparkfun) | [Example](./app/example/sparkfun_qwiic_keypad) | [Documentation](./app/documentation/example/sparkfun_qwiic_keypad) | +| 76 | Qwiic Soil Moisture Sensor (Sparkfun) - I2C | [Example](./app/example/sparkfun_soil_moisture) | [Documentation](./app/documentation/example/sparkfun_soil_moisture) | +| 77 | RA-08 - LR 9 Click (Mikroe) | [Example](./app/example/mikroe_lr9_ra_08) | [Documentation](./app/documentation/example/mikroe_lr9_ra_08) | +| 78 | RNG Click (Mikroe) | [Example](./app/example/mikroe_rng) | [Documentation](./app/documentation/example/mikroe_rng) | +| 79 | SCD41 & SPS30 - HVAC Click Bundle (Mikroe) | [Example](./app/example/mikroe_hvac_bundle_scd41_sps30) | [Documentation](./app/documentation/example/mikroe_hvac_bundle_scd41_sps30) | +| 80 | SCD41 - HVAC Click (Mikroe) | [Example](./app/example/mikroe_hvac_scd41) | [Documentation](./app/documentation/example/mikroe_hvac_scd41) | +| 81 | SGP40 - Air Quality Sensor (Sparkfun) | [Example](./app/example/sparkfun_air_quality_sgp40) | [Documentation](./app/documentation/example/sparkfun_air_quality_sgp40) | +| 82 | SHT40 & SGP40 - Environment 2 Click (Mikroe) | [Example](./app/example/mikroe_environment2_sht40_sgp40) | [Documentation](./app/documentation/example/mikroe_environment2_sht40_sgp40) | +| 83 | SHT40 - Temp&Hum 15 Click (Mikroe) | [Example](./app/example/mikroe_temphum15_sht40) | [Documentation](./app/documentation/example/mikroe_temphum15_sht40) | +| 84 | SHTC3 - Temp&Hum 9 Click (Mikroe) | [Example](./app/example/mikroe_temphum9_shtc3) | [Documentation](./app/documentation/example/mikroe_temphum9_shtc3) | +| 85 | Si8711CC - PWM Driver Click (Mikroe) | [Example](./app/example/mikroe_pwm_driver_si8711cc) | [Documentation](./app/documentation/example/mikroe_pwm_driver_si8711cc) | +| 86 | Smoke 2 Click (Mikroe) - I2C | [Example](./app/example/mikroe_smoke2_adpd188bi) | [Documentation](./app/documentation/example/mikroe_smoke2_adpd188bi) | +| 87 | SPS30 - Particulate Matter Sensor (Sparkfun) - I2C | [Example](./app/example/sparkfun_particulate_matter_sensor_sps30) | [Documentation](./app/documentation/example/sparkfun_particulate_matter_sensor_sps30) | +| 88 | SPS30 - Particulate Matter Sensor (Sparkfun) - UART | [Example](./app/example/sparkfun_particulate_matter_sensor_sps30) | [Documentation](./app/documentation/example/sparkfun_particulate_matter_sensor_sps30) | +| 89 | SSD1306 - Micro OLED Breakout Qwiic (Sparkfun) | [Example](./app/example/sparkfun_micro_oled_ssd1306) | [Documentation](./app/documentation/example/sparkfun_micro_oled_ssd1306) | +| 90 | SSD1306 - Mikroe OLEDW Click (Mikroe) | [Example](./app/example/mikroe_oledw_ssd1306) | [Documentation](./app/documentation/example/mikroe_oledw_ssd1306) | +| 91 | SSD1306 - Mikroe OLEDW Click (Mikroe) with GLIB | [Example](./app/example/mikroe_oledw_ssd1306_glib) | [Documentation](./app/documentation/example/mikroe_oledw_ssd1306_glib) | +| 92 | SSD1351 - OLED C Click (Mikroe) | [Example](./app/example/mikroe_oledc_ssd1351) | [Documentation](./app/documentation/example/mikroe_oledc_ssd1351) | +| 93 | ST7789 - TFT LCD Display (Adafruit) - SPI | [Example](./app/example/adafruit_tft_lcd_st7789) | [Documentation](./app/documentation/example/adafruit_tft_lcd_st7789) | +| 94 | ST7789 - TFT LCD Display (Adafruit) - SPI with DMA | [Example](./app/example/adafruit_tft_lcd_st7789) | [Documentation](./app/documentation/example/adafruit_tft_lcd_st7789) | +| 95 | ST7789 - TFT LCD Display (Adafruit) - with LVGL + DMA | [Example](./app/example/adafruit_tft_lcd_st7789_lvgl_dma) | [Documentation](./app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma) | +| 96 | STN1110 - OBDII Click (Mikroe) | [Example](./app/example/mikroe_obdii_stn1110) | [Documentation](./app/documentation/example/mikroe_obdii_stn1110) | +| 97 | Stretch Click (Mikroe) | [Example](./app/example/mikroe_stretch) | [Documentation](./app/documentation/example/mikroe_stretch) | +| 98 | TB6549FG - DC Motor 3 Click (Mikroe) | [Example](./app/example/mikroe_dcmotor3_tb6549fg) | [Documentation](./app/documentation/example/mikroe_dcmotor3_tb6549fg) | +| 99 | TB9053FTG - DC Motor 26 Click (Mikroe) | [Example](./app/example/mikroe_dcmotor26_tb9053ftg) | [Documentation](./app/documentation/example/mikroe_dcmotor26_tb9053ftg) | +| 100 | TSC2007 - Resistive Touch Screen Controller (Adafruit) | [Example](./app/example/adafruit_touchscreen_tsc2007) | [Documentation](./app/documentation/example/adafruit_touchscreen_tsc2007) | +| 101 | TSD-10 - Turbidity Click (Mikroe) | [Example](./app/example/mikroe_turbidity_tsd10) | [Documentation](./app/documentation/example/mikroe_turbidity_tsd10) | +| 102 | VCNL4040 - Proximity Sensor (Sparkfun) | [Example](./app/example/sparkfun_proximity_vcnl4040) | [Documentation](./app/documentation/example/sparkfun_proximity_vcnl4040) | +| 103 | VL53L1X - Distance Sensor (Sparkfun) | [Example](./app/example/sparkfun_distance_vl53l1x) | [Documentation](./app/documentation/example/sparkfun_distance_vl53l1x) | +| 104 | W5500 - ETH Wiz Click (Mikroe) | [Example](./app/example/mikroe_eth_wiz_w5500) | [Documentation](./app/documentation/example/mikroe_eth_wiz_w5500) | +| 105 | Water Detect Click (Mikroe) | [Example](./app/example/mikroe_water_detect) | [Documentation](./app/documentation/example/mikroe_water_detect) | +| 106 | Weather Station (Sparkfun) | [Example](./app/example/sparkfun_weatherstation) | [Documentation](./app/documentation/example/sparkfun_weatherstation) | +| 107 | XM125 - PCR Click (Mikroe) | [Example](./app/example/mikroe_pcr_xm125) | [Documentation](./app/documentation/example/mikroe_pcr_xm125) | + + +## Drivers ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Audio & Voice
    CMT-8540S-SMT - Buzz 2 Click (Mikroe) + Driver +
    MIC 2 Click (Mikroe) + Driver +
Clock & Timing
    DS3231M - RTC 10 Click (Mikroe) + Driver +
Display & LED
    E-Paper Display - eINK Click (Mikroe) + Driver +
    E-Paper EXT3-1 (Pervasive Displays) + Driver +
    HXD8357D - TFT LCD Display (Adafruit) - SPI + Driver +
    HXD8357D - TFT LCD Display (Adafruit) - SPI with DMA + Driver +
    ILI9341 - TFT LCD Display (Adafruit) - SPI + Driver +
    ILI9341 - TFT LCD Display (Adafruit) - SPI with DMA + Driver +
    IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) - I2C + Driver +
    MAX6969 - UT-M 7-SEG R Click (Mikroe) + Driver +
    SSD1306 - Micro OLED Breakout (Sparkfun) - I2C + Driver +
    SSD1306 - OLED W Click (Mikroe) - SPI + Driver +
    SSD1351 - OLED C Click (Mikroe) + Driver +
    ST7789 - TFT LCD Display (Adafruit) - SPI + Driver +
    ST7789 - TFT LCD Display (Adafruit) - SPI with DMA + Driver +
Human Machine Interface
    A-172-MRQ - Fingerprint 2 Click (Mikroe) + Driver +
    CAP1166 - Capacitive Touch 2 Click (Mikroe) + Driver +
    NeoTrellis 4x4 Keypad (Adafruit) + Driver +
    Qwiic Joystick (Sparkfun) + Driver +
    Qwiic Keypad (Sparkfun) + Driver +
    Touch Screen (Analog) + Driver +
    Touch Screen Analog Interface (Gecko) + Driver +
    Touch Screen Analog Interface (Si91x) + Driver +
    TSC2007 - Resistive Touch Screen Controller (Adafruit) + Driver +
Interface
    STN1110 - OBDII Click (Mikroe) + Driver +
    W5500 - ETH WIZ Click (Mikroe) + Driver +
Miscellaneous
    IR Generator (Silabs) + Driver +
    LCA717 - Relay 2 Click (Mikroe) + Driver +
    RNG Click (Mikroe) + Driver +
Motor Control
    A3967 - Stepper Click (Mikroe) + Driver +
    A4988 - Stepper 2 Click (Mikroe) + Driver +
    L9958 - DC Motor 24 Click (Mikroe) + Driver +
    LB11685AV - Brushless 16 Click (Mikroe) + Driver +
    PCA9685 - Servo Click (Mikroe) + Driver +
    Si8711CC - PWM Driver Click (Mikroe) + Driver +
    TB6549FG - DC Motor 3 Click (Mikroe) + Driver +
    TB9053FTG - DC Motor 26 Click (Mikroe) + Driver +
Power Management
    MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim) + Driver +
Sensors
    AC Current Click (Mikroe) + Driver +
    AD8318 - RF Meter Click (Mikroe) + Driver +
    ADPD188BI - Smoke 2 Click (Mikroe) - I2C + Driver +
    AK9753 - Human Presence Sensor (Sparkfun) - I2C + Driver +
    AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun) + Driver +
    AS3935 - Thunder Click (Mikroe) + Driver +
    AS7265x - Triad Spectroscopy Sensor (Sparkfun) - I2C + Driver +
    BMA400 - Accel 5 Click (Mikroe) - I2C + Driver +
    BMA400 - Accel 5 Click (Mikroe) - SPI + Driver +
    BME280 - Atmospheric Sensor (Sparkfun) + Driver +
    BME688 - Environment 3 Click (Mikroe) - I2C + Driver +
    BME688 - Environment 3 Click (Mikroe) - SPI + Driver +
    BMI270 - 6DOF IMU Breakout (Sparkfun) + Driver +
    CCS811 - Air Quality Sensor (Sparkfun) + Driver +
    DPS310 - Pressure 3 Click (Mikroe) - I2C + Driver +
    DPS310 - Pressure 3 Click (Mikroe) - SPI + Driver +
    EM3080-W - Barcode 2 Click (Mikroe) + Driver +
    EMG Click (Mikroe) + Driver +
    FSR400 - Force 3 Click (Mikroe) + Driver +
    MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun) + Driver +
    MAX30101 - Heart Rate 4 Click (Mikroe) + Driver +
    MAXM86161 - Heart Rate 2 Click (Mikroe) + Driver +
    MCP606 - Water Detect Click (Mikroe) + Driver +
    ML8511A - UV Click (Mikroe) + Driver +
    MLX90632 - IrThermo 3 Click (Mikroe) + Driver +
    MLX90640 - IR Array Breakout (Sparkfun) + Driver +
    MM5D91-00 - Radar Click (Mikroe) + Driver +
    MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun) + Driver +
    MQ131 - Ozone 2 Click (Mikroe) + Driver +
    MQ3 - Alcohol Click (Mikroe) + Driver +
    MQ7 - CO Click (Mikroe) + Driver +
    PH2 Click (Mikroe) + Driver +
    PL-N823-01 - PIR Click (Mikroe) + Driver +
    Pocket Geiger Radiation - Type 5 (Sparkfun) + Driver +
    Qwiic Soil Moisture Sensor (Sparkfun) - I2C + Driver +
    SCD41 & SPS30 - HVAC Click Bundle (Mikroe) + Driver +
    SCD41 - HVAC Click (Mikroe) + Driver +
    SGP40 - Air Quality Sensor (Sparkfun) + Driver +
    SHT40 & SGP40 - Environment 2 Click (Mikroe) + Driver +
    SHT40 - Temp&Hum 15 Click (Mikroe) + Driver +
    SHTC3 - Temp&Hum 9 Click (Mikroe) + Driver +
    SPS30 - Particulate Matter Sensor (Sparkfun) - I2C + Driver +
    SPS30 - Particulate Matter Sensor (Sparkfun) - UART + Driver +
    Stretch Click (Mikroe) + Driver +
    TSD-10 - Turbidity Click (Mikroe) + Driver +
    VCNL4040 - Proximity Sensor (Sparkfun) + Driver +
    VL53L1X - Distance Sensor Breakout (Sparkfun) + Driver +
    Weather Meter Kit - Rainfall (Sparkfun) + Driver +
    Weather Meter Kit - Wind Direction (Sparkfun) + Driver +
    Weather Meter Kit - Wind Speed (Sparkfun) + Driver +
    XM125 - PCR Click (Mikroe) - I2C + Driver +
Services
    BTHome v2 + Driver +
    BTHome v2 - Server + Driver +
    EnOcean Switch Proxy Server + Driver +
    FatFS - Generic FAT Filesystem + Driver +
    GLIB - OLED Graphics Library + Driver +
    GPIO helper for SI91X platform + Driver +
    LIN bus slave + Driver +
    LVGL - Graphics Library + Driver +
    MIPI Display Bus Interface (SPI - 4Wire) +
    mikroSDK 2.0 SDK - Peripheral Drivers
        ADC + Driver +
        Digital I/O + Driver +
        I2C + Driver +
        OneWire + Driver +
        PWM + Driver +
        SPI + Driver +
        UART + Driver +
    NFC
        NFC - Common + Driver +
        NFC - NCI + Driver +
        NFC - NDEF + Driver +
        NFC - Tag + Driver +
Storage
    microSD - microSD Click (Mikroe) + Driver +
Wireless Connectivity
    BG96 - LTE IoT 2 Click (Mikroe) + Driver +
    DWM1000 - UWB Click (Mikroe) + Driver +
    DWM3000 - UWB 2 Click (Mikroe) + Driver +
    ID-12LA - RFID Reader (Sparkfun) - I2C + Driver +
    LEA-6S - GPS Click (Mikroe) + Driver +
    MAX-M10S - GNSS Receiver Breakout - I2C + Driver +
    NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C + Driver +
    PN7150 - NFC 2 Click (Mikroe) - I2C + Driver +
    RA-08 - LR 9 Click (Mikroe) + Driver +
## Requirements ## - Desired Silicon Labs Starter Kit - Driver specific test hardware -- Simplicity Studio v5.9.2.1 or newer -- Gecko SDK 4.4.3 -- WiSeConnect SDK 3.2.0 +- Simplicity Studio v5.9.3.2 or newer +- Simplicity SDK 2024.6.2 +- WiSeConnect SDK 3.3.4 ## How to add to Simplicity Studio IDE ## diff --git a/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/README.md b/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/README.md index a80d79c6..c2645141 100644 --- a/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/README.md +++ b/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/README.md @@ -9,22 +9,27 @@ Adafruit NeoTrellis 4x4 keypad is a trellis 4x4 elastomer-button keypad kit with ## Required Hardware ## - [BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [Adafruit NeoTrellis RGB for 4x4 Keypad](https://www.adafruit.com/product/3954) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| ---------------------- | ------ | -| BRD2704A | [SparkFun Thing Plus Matter - MGM240P](https://www.sparkfun.com/products/20270) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- **If the BGM220 Explorer Kit board is used**: -## Hardware Connection ## + Adafruit NeoTrellis can connect with your board easily via the Qwiic connector. It includes a JST-PH 4-pin connector that provides two I2C wires (SDA and SCL), 3v3, and GND. You can use [the JST PH to JST SH (qwiic) Cable](https://www.adafruit.com/product/4424) to connect to your board. + + The Adafruit NeoTrellis supports Qwiic, so it can connect easily to the Qwiic header of the BGM220 Explorer Kit board. The hardware connection is shown in the image below: + + ![connection](image/connection.png) -Adafruit NeoTrellis can connect with the BGM220 Explorer Kit easily via Qwiic connector. Adafruit NeoTrellis includes a JST-PH 4-pin connector that provides two I2C wires (SDA and SCL), 3v3, and GND. You can use [the JST PH to JST SH (qwiic) Cable](https://www.adafruit.com/product/4424) to connect the Adafruit Neotrellis to the BGM220 as in the picture below: +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: -![connection](image/connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | Adafruit NeoTrellis | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -32,39 +37,43 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "NeoTrellis". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "NeoTrellis". 2. Click **Create** button on the **Third Party Hardware Drivers - Neotrellis RGB 4x4 keypad (Adafruit)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - ![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file `app/example/adafruit_neotrellis_keypad/app.c` into the project root folder (overwriting existing file). +2. Copy the file `app/example/adafruit_neotrellis_keypad/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - [Application] → [Utility] → [Assert] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [NeoTrellis 4x4 Keypad (Adafruit)] + **If the BGM220 Explorer Kit is used** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Human Machine Interface] → [NeoTrellis 4x4 Keypad (Adafruit)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [NeoTrellis 4x4 Keypad (Adafruit)] 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension has already been installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **NeoTrellis 4x4 Keypad (Adafruit)** component. @@ -82,15 +91,13 @@ You can either create a project based on an example project or start with an emp |---------------------------------------------| | adafruit_seesaw.c | |---------------------------------------------| -| emlib | - --------------------------------------------- ``` The Adafruit NeoTrellis driver is implemented based on the Adafruit NeoPixel driver for the seesaw chip and the Adafruit seesaw driver. - `adafruit_neotrellis.c` : Use to control the keypad functions for interacting with multiple neotrellis boards - `adafruit_seesawneopixel.c`: This file is part of the Adafruit NeoPixel library used for compatibility with the seesaw chip. It helps control a wide variety of WS2811- and WS2812-based RGB LED devices such as Adafruit FLORA RGB Smart Pixels and NeoPixel strips -- `adafruit_seesaw.c`: Use to communicate with the Microcontroller via emlib of GSDK. +- `adafruit_seesaw.c`: Use to communicate with the Microcontroller. ### Testing ### diff --git a/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/connection.png b/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/connection.png index e61169dd..e9e5875d 100644 Binary files a/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/connection.png and b/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/connection.png differ diff --git a/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/create_example.png b/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/create_example.png index 764c57f4..c5271d85 100644 Binary files a/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/create_example.png and b/app/documentation/example/adafruit_neotrellis_keypad_atsamd09/image/create_example.png differ diff --git a/app/documentation/example/adafruit_rgb_led_is31fl3741/README.md b/app/documentation/example/adafruit_rgb_led_is31fl3741/README.md index 99cbac1d..d04e0bbd 100644 --- a/app/documentation/example/adafruit_rgb_led_is31fl3741/README.md +++ b/app/documentation/example/adafruit_rgb_led_is31fl3741/README.md @@ -6,20 +6,32 @@ This project aims to implement a hardware driver interacting with the [IS31FL374 Adafruit RGB LED Matrix is a 13x9 RGB LED matrix breakout. It features 117 RGB LEDs, each one 2x2mm in size, in a 13x9 grid with 3mm pitch spacing. The IS31FL3741 communicates over I2C and can set each LED element to have 16-bit color by using an 8-bit PWM signal. There's an adjustable current driver, so you can brighten or dim the whole display without losing color resolution. The module can be tiled side-to-side with others if desired up to 4 boards on the I2C bus. -## Quick Look Video +## Quick Look Video ## [![IS31FL3741 Quick Look Video](image/yt_thumbnail.jpg)](https://youtu.be/eNGRJq4ZlzU "Dev Lab - Adafruit 13x9 RGB LED Matrix IS31FL3741 – Silicon Labs") ## Required Hardware ## - [BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) + +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) + - [Adafruit IS31FL3741 - 13x9 PWM RGB LED Matrix](https://learn.adafruit.com/adafruit-is31fl3741) ## Hardware Connection ## -Adafruit RGB LED Matrix can connect with the BGM220 Explorer Kit easily via two STEMMA QT connectors which are compatible with Qwiic. Qwiic is a special connector that includes two I2C wires (SDA and SCL), 3v3, and GND. All of these wires are combined into 1 connection port so that it makes the connection between 2 devices become easier and more convenient. +- If the BGM220P Explorer Kit is used: + + Adafruit RGB LED Matrix can connect with the BGM220 Explorer Kit easily via two STEMMA QT connectors which are compatible with Qwiic. Qwiic is a special connector that includes two I2C wires (SDA and SCL), 3v3, and GND. All of these wires are combined into 1 connection port so that it makes the connection between 2 devices become easier and more convenient. + + ![connection](image/connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![connection](image/connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | Adafruit 13x9 PWM RGB LED Matrix | + | -------------| ------------- | ------------------ | ---------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -27,16 +39,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "rgb led". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "rgb led". -2. Click **Create** button on the **Third Party Hardware Drivers - IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) +2. Click **Create** button on the **Third Party Hardware Drivers - IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit)** example Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/adafruit_rgb_led_is31fl3741/app.c` into the project root folder (overwriting existing file). @@ -48,20 +61,31 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - [Application] → [Utility] → [Assert] - - [Third Party Hardware Drivers] → [Display & LED] → [IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) - I2C] - - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + **If the BGM220P Explorer Kit is used:** + + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Application] → [Utility] → [Assert] + - [Third Party Hardware Drivers] → [Display & LED] → [IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) - I2C] + - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Display & LED] → [IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) - I2C] + - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install **IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) - I2C** component. +- Third-party Drivers Extension must be enabled for the project to install **IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) - I2C** component. ### Display Configuration ### diff --git a/app/documentation/example/adafruit_rgb_led_is31fl3741/image/create_example.png b/app/documentation/example/adafruit_rgb_led_is31fl3741/image/create_example.png index c73a5f35..adfa9230 100644 Binary files a/app/documentation/example/adafruit_rgb_led_is31fl3741/image/create_example.png and b/app/documentation/example/adafruit_rgb_led_is31fl3741/image/create_example.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d/README.md b/app/documentation/example/adafruit_tft_lcd_hxd8357d/README.md index 3a1aa1f9..efc260df 100644 --- a/app/documentation/example/adafruit_tft_lcd_hxd8357d/README.md +++ b/app/documentation/example/adafruit_tft_lcd_hxd8357d/README.md @@ -15,32 +15,24 @@ For testing, you will need a HXD8357D display breakout, like [this large 3.5" TF ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [Adafruit HXD8357D - 3.5" TFT LCD with Touchscreen](https://www.adafruit.com/product/2050) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A ](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | - ## Hardware Connection ## -To connect the Adafruit 3.5" TFT LCD (with Touchscreen) with the EFR32xG24 Explorer Kit, you can see the pins mapping table below. +To connect the Adafruit 3.5" TFT LCD (with Touchscreen) with your board, you can see the pins mapping table below. -| Pin | Connection | Pin function | -|:---:|:-------------:|:---------------| -| PC8 | D/C | GPIO | -| PC0 | CS | SPI CS | -| PC1 | CLK | SPI SCK | -| PC2 | MISO | SPI MISO | -| PC3 | MOSI | SPI MOSI | -| PD5 | XP(X+) | AN | -| PD4 | YP(Y+) | AN | -| PB1 | YM(Y-) | AN | -| PA0 | XM(X-) | AN | +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | Connection | Pin function | +| --- | --- | --- | --- | +| PC8 | GPIO_47 (P26) | D/C | GPIO | +| PC0 | GPIO_28 (P31) | CS | SPI CS | +| PC1 | GPIO_25 (P25) | CLK | SPI SCK | +| PC2 | GPIO_26 (P27) | MISO | SPI MISO | +| PC3 | GPIO_27 (P29) | MOSI | SPI MOSI | +| PD5 | GPIO_7 (P20) | XP(X+) | AN | +| PD4 | ULP_GPIO_1 (P16) | YP(Y+) | AN | +| PB1 | GPIO_6 (P19) | YM(Y-) | AN | +| PA0 | ULP_GPIO_8 (P15) | XM(X-) | AN | *Note: To be able to communicate with TFT LCD using SPI mode, you need to solder closed the IM2 jumper on the back of the PCB.* @@ -50,7 +42,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **hxd8357d**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **hxd8357d**. 2. Click **Create** button on the example: @@ -66,51 +58,87 @@ You can either create a project based on an example project or start with an emp ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" or "SiWx917-RB4338A Radio Board" using Simplicity Studio v5. Use the default project settings. -2. Copy the file `app/example/adafruit_tft_lcd_hxd8357d/app.c` into the project root folder (overwriting the existing file). +2. Copy source files: + - With Gecko EFR32 SOCs: + - Copy the file `app/example/adafruit_tft_lcd_hxd8357d/gecko/app.c` into the project root folder (overwriting the existing file). + - With SiWx917 SoCs: + - Copy the file `app/example/adafruit_tft_lcd_hxd8357d/si91x/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Application] → [Utility] → [Log] + - With Gecko EFR32 SOCs: + - [Services] → [Timers] → [Sleep Timer] + - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] + - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Gecko)] → use the default configuration + - With SiWx917 SoCs: + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Service] → [Power Manager] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [LED] → [led0, led1] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Si91x)] → use the default configuration - [Application] → [Utility] → [Assert] - If using without DMA: [Third Party Hardware Drivers] → [Display & LED] → [HXD8357D - TFT LCD Display (Adafruit) - SPI] - If using with DMA: [Third Party Hardware Drivers] → [Display & LED] → [HXD8357D - TFT LCD Display (Adafruit) - SPI with DMA] - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] → use the default configuration + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] + +4. Enable DMA support for SPI module (for SiWx917 SoCs) -4. Build and flash the project to your device. + To improve SPI transfer speed, enable DMA support by changing configuration of GSPI component at: **[WiSeConnect 3 SDK] → [Device] → [Si91X] → [MCU] → [Peripheral] → [GSPI]** as the picture bellow + + | | | + | - | - | + | ![gspi](image/gspi.png) | ![gspi_dma](image/gspi_dma.png) | + +5. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension is already installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **HXD8357D - TFT LCD Display (Adafruit) - SPI** or **HXD8357D - TFT LCD Display (Adafruit) - SPI with DMA** component. ## Calibration for Touch function ## -Adafruit HXD8357D uses 4 resistive touch pins (Y+ X+ Y- X-) to determine touch points. We will read the analog values from these pins to detect where the touched point is on the screen. This process will surely have uncertainties so we have to calibrate it to detect touched points properly. Please follow the steps below to calibrate the touch screen. +Adafruit HXD8357D uses 4 resistive touch pins (Y+ X+ Y- X-) to determine touch points. We will read the analog values from these pins to detect where the touched point is on the screen. This process will surely have uncertainties so we have to calibrate it to detect touched points properly. + +The calibration parameters can be configured through the settings of the component: + +- [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Gecko)] + - Calib X-min + - Calib X-max + - Calib Y-min + - Calib Y-max + - Invert X-axis + - Invert Y-axis + - XY Swap + +![touchscreen_configuration](image/touch_settings.png) + +Follow the steps below to calibrate the touch screen. -- Open configuration for Touch Screen (Analog) component. Enable **calibration printf** option. - ![enable calib printf](image/enable_calib_printf.png) +1. Open app.c, set the `CALIB_ENABLED` macro to `1` to enable calib function -- Open the console window to monitor values of the 'x' and 'y' when touching some special points then update them in CALIBRATION settings. + > #define CALIB_ENABLED 1 - ![calib point](image/calib_point.png) +2. Measuring 2 points at 2 conners that is marked with green and yellow to determine the value of: + - Calib X-min: minimum value of X_RAW + - Calib X-max: maximum value of X_RAW + - Calib Y-min: minimum value of Y_RAW + - Calib Y-max: maximum value of Y_RAW -- Touch X1 point then update x for **Calib X-min** and y for **Calib Y-min**. + ![calib](image/calib.jpg) -- Touch X2 point then update x for **Calib X-max** +3. The origin of the screen (X = 0, Y = 0) is marked green, the maximum XY coordinate (X = 320, Y = 480) is marked yellow. We need to make the X and Y value of the touch screen is matched with these 2 points by changing 3 options in the `Touch Settings`: -- Touch X3 point then update y for **Calib Y-max** +- Invert X-axis +- Invert Y-axis +- XY Swap ## How It Works ## diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/calib.jpg b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/calib.jpg new file mode 100644 index 00000000..6be85875 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/calib.jpg differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/calib_point.png b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/calib_point.png deleted file mode 100644 index 02c35f7d..00000000 Binary files a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/calib_point.png and /dev/null differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/enable_calib_printf.png b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/enable_calib_printf.png deleted file mode 100644 index fc1bb9a4..00000000 Binary files a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/enable_calib_printf.png and /dev/null differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi.png b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi.png new file mode 100644 index 00000000..15443a18 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi_dma.png b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi_dma.png new file mode 100644 index 00000000..923c08e4 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi_dma.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/touch_settings.png b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/touch_settings.png new file mode 100644 index 00000000..2a5ee5f3 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_hxd8357d/image/touch_settings.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/README.md b/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/README.md index c26f1150..c58e9c2b 100644 --- a/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/README.md +++ b/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/README.md @@ -15,23 +15,24 @@ For testing, you'll need a HXD8357D display breakout, like [this large 3.5" TFT ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [Adafruit HXD8357D - 3.5" TFT LCD with Touchscreen](https://www.adafruit.com/product/2050) ## Hardware Connection ## -To connect the Adafruit 3.5" TFT LCD (with Touchscreen) with the EFR32xG24 Explorer Kit, you can see the pins mapping table below. +To connect the Adafruit 3.5" TFT LCD (with Touchscreen) with your board, you can see the pins mapping table below. -| Pin | Connection | Pin function | -|:---:|:-------------:|:---------------| -| PC8 | D/C | GPIO | -| PC0 | CS | SPI CS | -| PC1 | CLK | SPI SCK | -| PC2 | MISO | SPI MISO | -| PC3 | MOSI | SPI MOSI | -| PD5 | XP(X+) | AN | -| PD4 | YP(Y+) | AN | -| PB1 | YM(Y-) | AN | -| PA0 | XM(X-) | AN | +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | Connection | Pin function | +| --- | --- | --- | --- | +| PC8 | GPIO_47 (P26) | D/C | GPIO | +| PC0 | GPIO_28 (P31) | CS | SPI CS | +| PC1 | GPIO_25 (P25) | CLK | SPI SCK | +| PC2 | GPIO_26 (P27) | MISO | SPI MISO | +| PC3 | GPIO_27 (P29) | MOSI | SPI MOSI | +| PD5 | GPIO_7 (P20) | XP(X+) | AN | +| PD4 | ULP_GPIO_1 (P16) | YP(Y+) | AN | +| PB1 | GPIO_6 (P19) | YM(Y-) | AN | +| PA0 | ULP_GPIO_8 (P15) | XM(X-) | AN | *Note: To be able to communicate with TFT LCD using SPI mode, you need to solder closed the IM2 jumper on the back of the PCB.* @@ -41,7 +42,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **hxd8357d**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **hxd8357d**. 2. Click **Create** button on the example: @@ -57,37 +58,49 @@ You can either create a project based on an example project or start with an emp ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. - -2. Copy all the file in `app_ui/brd2703a` and the file `app/example/adafruit_tft_lcd_hxd8357d_lvgl/app.c` into the project root folder (overwriting the existing files). - +1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" or "SiWx917-RB4338A Radio Board" using Simplicity Studio v5. Use the default project settings. +2. Copy source files: + - With Gecko EFR32 SOCs: + - Copy all files in `app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui` except `ui_events_si91x.c` into the project root folder + - Copy the file `app/example/adafruit_tft_lcd_hxd8357d_lvgl/gecko/app.c` into the project root folder (overwriting the existing files) + - With SiWx917 SoCs: + - Copy all files in `app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui` except `ui_events_gecko.c` into the project root folder + - Copy the file `app/example/adafruit_tft_lcd_hxd8357d_lvgl/gecko/app.c` into the project root folder (overwriting the existing files) 3. Install the software components: - - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - - [Services] → [Timers] → [Sleep Timer] - - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] - - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0] + - With Gecko EFR32 SOCs: + - [Services] → [Timers] → [Sleep Timer] + - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] + - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Gecko)] → use the default configuration + - With SiWx917 SoCs: + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Service] → [Power Manager] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [LED] → [led0, led1] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Si91x)] → use the default configuration - If using single buffer mode without DMA: - [Third Party Hardware Drivers] → [Display & LED] → [HXD8357D - TFT LCD Display (Adafruit) - SPI] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] → use default configuration - - [Third Party Hardware Drivers] → [Services] → [LVGL - Graphic Library] → Using settings as below: - ![Create_example](image/single_buffered_lvgl_settings.png) - If using double buffered DMA mode: - [Third Party Hardware Drivers] → [Display & LED] → [HXD8357D - TFT LCD Display (Adafruit) - SPI with DMA] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] → use default configuration - - [Third Party Hardware Drivers] → [Services] → [LVGL - Graphic Library] → Using settings as below: - ![Create_example](image/double_buffered_lvgl_settings.png) + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] + - [Third Party Hardware Drivers] → [Services] → [LVGL - Graphic Library] → Using settings as below: + ![Create_example](image/double_buffered_lvgl_settings.png) + +4. Enable DMA support for SPI module (for SiWx917 SoCs) + + To improve SPI transfer speed, enable DMA support by changing configuration of GSPI component at: **[WiSeConnect 3 SDK] → [Device] → [Si91X] → [MCU] → [Peripheral] → [GSPI]** as the picture bellow + + | | | + | - | - | + | ![gspi](image/gspi.png) | ![gspi_dma](image/gspi_dma.png) | -4. Build and flash the project to your device. +5. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). ## Calibration for Touch function ## diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi.png b/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi.png new file mode 100644 index 00000000..15443a18 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi_dma.png b/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi_dma.png new file mode 100644 index 00000000..923c08e4 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi_dma.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341/README.md b/app/documentation/example/adafruit_tft_lcd_ili9341/README.md index 972f5e89..2ff33495 100644 --- a/app/documentation/example/adafruit_tft_lcd_ili9341/README.md +++ b/app/documentation/example/adafruit_tft_lcd_ili9341/README.md @@ -10,6 +10,7 @@ For testing, you'll need a ILI9341 display breakout, like [this large 2.8" TFT d ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - A ILI9341 TFT display as listed below: - [Adafruit ILI9341 - 2.4" TFT LCD with Touchscreen](https://www.adafruit.com/product/2478) - [2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341](https://www.adafruit.com/product/1770) @@ -17,19 +18,19 @@ For testing, you'll need a ILI9341 display breakout, like [this large 2.8" TFT d ## Hardware Connection ## -To connect the Adafruit 2.4" TFT LCD (with Touchscreen) with the EFR32xG24 Explorer Kit, you can see the pins mapping table below. +To connect the Adafruit 2.4" TFT LCD (with Touchscreen) with your board, you can see the pins mapping table below. -| Pin | Connection | Pin function | -|:---:|:-------------:|:---------------| -| PC8 | D/C | GPIO | -| PC0 | CS | SPI CS | -| PC1 | CLK | SPI SCK | -| PC2 | MISO | SPI MISO | -| PC3 | MOSI | SPI MOSI | -| PD5 | XP(X+) | AN | -| PD4 | YP(Y+) | AN | -| PB1 | YM(Y-) | AN | -| PA0 | XM(Y+) | AN | +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | Connection | Pin function | +| --- | --- | --- | --- | +| PC8 | GPIO_47 (P26) | D/C | GPIO | +| PC0 | GPIO_28 (P31) | CS | SPI CS | +| PC1 | GPIO_25 (P25) | CLK | SPI SCK | +| PC2 | GPIO_26 (P27) | MISO | SPI MISO | +| PC3 | GPIO_27 (P29) | MOSI | SPI MOSI | +| PD5 | GPIO_7 (P20) | XP(X+) | AN | +| PD4 | ULP_GPIO_1 (P16) | YP(Y+) | AN | +| PB1 | GPIO_6 (P19) | YM(Y-) | AN | +| PA0 | ULP_GPIO_8 (P15) | XM(X-) | AN | ## Setup ## @@ -37,8 +38,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **tft lcd**. - +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **tft lcd**. 2. Click **Create** button on the example: - **Third Party Hardware Drivers - ILI9341 - TFT LCD with Touchscreen (Adafruit) - SPI** if using without DMA. @@ -47,37 +47,49 @@ You can either create a project based on an example project or start with an emp Example project creation dialog pops up -> click Create and Finish and Project should be generated. ![Create_example](image/create_example.png) - 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. - -2. Copy the file `app/example/adafruit_tft_lcd_ili9341/app.c` into the project root folder (overwriting existing file). - +1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" or "SiWx917-RB4338A Radio Board" using Simplicity Studio v5. Use the default project settings. +2. Copy source files: + - With Gecko EFR32 SOCs: + - Copy the file `app/example/adafruit_tft_lcd_ili9341/gecko/app.c` into the project root folder (overwriting existing file). + - With SiWx917 SoCs: + - Copy the file `app/example/adafruit_tft_lcd_ili9341/si91x/app.c` into the project root folder (overwriting existing file). 3. Install the software components: - - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Application] → [Utility] → [Log] + - With Gecko EFR32 SOCs: + - [Services] → [Timers] → [Sleep Timer] + - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] + - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Gecko)] → use the default configuration + - With SiWx917 SoCs: + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Service] → [Power Manager] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [LED] → [led0, led1] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Si91x)] → use the default configuration - [Application] → [Utility] → [Assert] - If using without DMA: [Third Party Hardware Drivers] → [Display & LED] → [ILI9341 - TFT LCD Display (Adafruit) - SPI] - If using with DMA: [Third Party Hardware Drivers] → [Display & LED] → [ILI9341 - TFT LCD Display (Adafruit) - SPI with DMA] - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] → use default configuration + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] -4. Build and flash the project to your device. +4. Enable DMA support for SPI module (for SiWx917 SoCs) + + To improve SPI transfer speed, enable DMA support by changing configuration of GSPI component at: **[WiSeConnect 3 SDK] → [Device] → [Si91X] → [MCU] → [Peripheral] → [GSPI]** as the picture bellow + + | | | + | - | - | + | ![gspi](image/gspi.png) | ![gspi_dma](image/gspi_dma.png) | + +5. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **ILI9341 - TFT LCD Display (Adafruit) - SPI** or **ILI9341 - TFT LCD Display (Adafruit) - SPI with DMA** component. @@ -85,18 +97,38 @@ You can either create a project based on an example project or start with an emp Adafruit ILI9341 uses 4 resistive touch pins (Y+ X+ Y- X-) to determine touch points. We will read the analog values from these pins to detect where the touched point is on the screen. This process will surely have uncertainties so we have to calibrate it to detect touched points properly. Please follow these steps below to calibrate the touch screen. -- Open configuration for Touch Screen (Analog) component. Enable **calibration printf** option. - ![enable calib printf](image/enable_calib_printf.png) +The calibration parameters can be configured through the settings of the component: + +- [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Gecko)] + - Calib X-min + - Calib X-max + - Calib Y-min + - Calib Y-max + - Invert X-axis + - Invert Y-axis + - XY Swap + +![touchscreen_configuration](image/touch_settings.png) + +Follow the steps below to calibrate the touch screen. + +1. Open app.c, set the `CALIB_ENABLED` macro to `1` to enable calib function -- Open the console window to monitor values of the 'x' and 'y' when touching in some special points then update them in CALIBRATION settings. + > #define CALIB_ENABLED 1 - ![calib point](image/calib_point.png) +2. Measuring 2 points at 2 conners that is marked with green and yellow to determine the value of: + - Calib X-min: minimum value of X_RAW + - Calib X-max: maximum value of X_RAW + - Calib Y-min: minimum value of Y_RAW + - Calib Y-max: maximum value of Y_RAW -- Touch X1 point then update x for **Calib X-min** and y for **Calib Y-min**. + ![calib](image/calib.jpg) -- Touch X2 point then update x for **Calib X-max** +3. The origin of the screen (X = 0, Y = 0) is marked green, the maximum XY coordinate (X = 320, Y = 480) is marked yellow. We need to make the X and Y value of the touch screen is matched with these 2 points by changing 3 options in the `Touch Settings`: -- Touch X3 point then update y for **Calib Y-max** +- Invert X-axis +- Invert Y-axis +- XY Swap ## How It Works ## diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341/image/calib.jpg b/app/documentation/example/adafruit_tft_lcd_ili9341/image/calib.jpg new file mode 100644 index 00000000..6be85875 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_ili9341/image/calib.jpg differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341/image/calib_point.png b/app/documentation/example/adafruit_tft_lcd_ili9341/image/calib_point.png deleted file mode 100644 index 67e64fe5..00000000 Binary files a/app/documentation/example/adafruit_tft_lcd_ili9341/image/calib_point.png and /dev/null differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341/image/enable_calib_printf.png b/app/documentation/example/adafruit_tft_lcd_ili9341/image/enable_calib_printf.png deleted file mode 100644 index 7ecb1f25..00000000 Binary files a/app/documentation/example/adafruit_tft_lcd_ili9341/image/enable_calib_printf.png and /dev/null differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341/image/gspi.png b/app/documentation/example/adafruit_tft_lcd_ili9341/image/gspi.png new file mode 100644 index 00000000..15443a18 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_ili9341/image/gspi.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341/image/gspi_dma.png b/app/documentation/example/adafruit_tft_lcd_ili9341/image/gspi_dma.png new file mode 100644 index 00000000..923c08e4 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_ili9341/image/gspi_dma.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341/image/touch_settings.png b/app/documentation/example/adafruit_tft_lcd_ili9341/image/touch_settings.png new file mode 100644 index 00000000..1c9c310e Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_ili9341/image/touch_settings.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md b/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md index d813768f..49618b3d 100644 --- a/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md +++ b/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md @@ -10,6 +10,7 @@ This example uses the source files which are generated from [SquareLine Studio]( ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - A ILI9341 TFT display as listed below: - [Adafruit ILI9341 - 2.4" TFT LCD with Touchscreen](https://www.adafruit.com/product/2478) - [2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket - ILI9341](https://www.adafruit.com/product/1770) @@ -19,17 +20,17 @@ This example uses the source files which are generated from [SquareLine Studio]( To connect the Adafruit 2.4" TFT LCD (with Touchscreen) with the EFR32xG24 Explorer Kit, you can see the pins mapping table below. -| Pin | Connection | Pin function | -|:---:|:-------------:|:---------------| -| PC8 | D/C | GPIO | -| PC0 | CS | SPI CS | -| PC1 | CLK | SPI SCK | -| PC2 | MISO | SPI MISO | -| PC3 | MOSI | SPI MOSI | -| PD5 | XP(X+) | AN | -| PD4 | YP(Y+) | AN | -| PB1 | YM(Y-) | AN | -| PA0 | XM(Y+) | AN | +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | Connection | Pin function | +| --- | --- | --- | --- | +| PC8 | GPIO_47 (P26) | D/C | GPIO | +| PC0 | GPIO_28 (P31) | CS | SPI CS | +| PC1 | GPIO_25 (P25) | CLK | SPI SCK | +| PC2 | GPIO_26 (P27) | MISO | SPI MISO | +| PC3 | GPIO_27 (P29) | MOSI | SPI MOSI | +| PD5 | GPIO_7 (P20) | XP(X+) | AN | +| PD4 | ULP_GPIO_1 (P16) | YP(Y+) | AN | +| PB1 | GPIO_6 (P19) | YM(Y-) | AN | +| PA0 | ULP_GPIO_8 (P15) | XM(X-) | AN | ## Setup ## @@ -37,7 +38,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **lvgl**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **lvgl**. 2. Click **Create** button on the example: @@ -52,44 +53,54 @@ You can either create a project based on an example project or start with an emp ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" or "SiWx917-RB4338A Radio Board" using Simplicity Studio v5. Use the default project settings. -2. Copy the file `app/example/adafruit_tft_lcd_ili9341_lvgl/app.c` into the project root folder (overwriting existing file). +2. Copy source files: + - With Gecko EFR32 SOCs: + - Copy the file `app/example/adafruit_tft_lcd_ili9341_lvgl/gecko/app.c` into the project root folder (overwriting existing file). + - Copy all files in the folder below into the project root folder. + - `app_ui/brd2703a/single_buffer_without_dma` if using single buffer mode without DMA: + - `app_ui/brd2703a/double_buffered_dma` if using double buffered DMA mode: + - With SiWx917 SoCs: + - Copy the file `app/example/adafruit_tft_lcd_ili9341_lvgl/si91x/app.c` into the project root folder (overwriting existing file). + - Copy all files in the folder `app_ui/brd4338a/double_buffered_dma` -3. Copy all files in the folder below into the project root folder. - - - `app_ui/brd2703a/single_buffer_without_dma` if using single buffer mode without DMA: - - - `app_ui/brd2703a/double_buffered_dma` if using double buffered DMA mode: - -4. Install the software components: +3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - - [Services] → [Timers] → [Sleep Timer] + - With Gecko EFR32 SOCs: + - [Services] → [Timers] → [Sleep Timer] + - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] + - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Gecko)] → use the default configuration + - With SiWx917 SoCs: + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Service] → [Power Manager] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [LED] → [led0, led1] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [Button] → [btn0, btn1] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen Analog Interface (Si91x)] → use the default configuration - If using single buffer mode without DMA: - - [Platform] → [Driver] → [LED] → [Simple LED] → [led0] - [Third Party Hardware Drivers] → [Display & LED] → [ILI9341 - TFT LCD Display (Adafruit) - SPI] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] → use default configuration - - [Third Party Hardware Drivers] → [Services] → [LVGL - Graphic Library] → Using settings as below: - ![Create_example](image/single_buffered_lvgl_settings.png) - If using double buffered DMA mode: - - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] - - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] - [Third Party Hardware Drivers] → [Display & LED] → [ILI9341 - TFT LCD Display (Adafruit) - SPI with DMA] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] → use default configuration - - [Third Party Hardware Drivers] → [Services] → [LVGL - Graphic Library] → Using settings as below: - ![Create_example](image/double_buffered_lvgl_settings.png) + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Touch Screen (Analog)] + - [Third Party Hardware Drivers] → [Services] → [LVGL - Graphic Library] → Using settings as below: + ![Create_example](image/double_buffered_lvgl_settings.png) + +4. Enable DMA support for SPI module (for SiWx917 SoCs) + + To improve SPI transfer speed, enable DMA support by changing configuration of GSPI component at: **[WiSeConnect 3 SDK] → [Device] → [Si91X] → [MCU] → [Peripheral] → [GSPI]** as the picture bellow + + | | | + | - | - | + | ![gspi](image/gspi.png) | ![gspi_dma](image/gspi_dma.png) | 5. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). ## How It Works ## diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi.png b/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi.png new file mode 100644 index 00000000..15443a18 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi_dma.png b/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi_dma.png new file mode 100644 index 00000000..923c08e4 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi_dma.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_st7789/README.md b/app/documentation/example/adafruit_tft_lcd_st7789/README.md index bc797edd..b854ce71 100644 --- a/app/documentation/example/adafruit_tft_lcd_st7789/README.md +++ b/app/documentation/example/adafruit_tft_lcd_st7789/README.md @@ -12,34 +12,24 @@ For testing, you will need a ST7789 display breakout, like [Adafruit 1.14" 240x1 ![st7789_display](image/st7789_display.png) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | -| BRD2704A | [Sparkfun Thing Plus MGM240P](https://www.sparkfun.com/products/20270) | -| BRD2601B | [EFR32xG24 Dev Kit Board](https://www.silabs.com/development-tools/wireless/efr32xg24-dev-kit?tab=overview) | - ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - A ST7789 Color TFT display as listed below: - [Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789](https://www.adafruit.com/product/4383) ## Hardware Connection ## -To connect the Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789 with the EFR32xG24 Explorer Kit, you can see the pins mapping table below. +To connect the Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789 with your board, you can see the pins mapping table below. -| Pin | Connection | Pin function | -|:---:|:-------------:|:---------------| -| PC8 | D/C | GPIO | -| PC0 | CS | SPI CS | -| PC1 | CLK | SPI SCK | -| PC2 | MISO | SPI MISO | -| PC3 | MOSI | SPI MOSI | +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | Connection | Pin function | +| --- | --- | --- | --- | +| PC8 | GPIO_47 (P26) | D/C | GPIO | +| PC0 | GPIO_28 (P31) | CS | SPI CS | +| PC1 | GPIO_25 (P25) | CLK | SPI SCK | +| PC2 | GPIO_26 (P27) | MISO | SPI MISO | +| PC3 | GPIO_27 (P29) | MOSI | SPI MOSI | ## Setup ## @@ -47,7 +37,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **"st7789"**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"st7789"**. 2. Click **Create** button on the example: @@ -62,9 +52,14 @@ You can either create a project based on an example project or start with an emp ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" or "SiWx917-RB4338A Radio Board" using Simplicity Studio v5. Use the default project settings. -2. Copy all the *.c files in the `app/example/adafruit_tft_lcd_st7789` directory into the project root folder (overwriting existing file). +2. Copy source files: + - With Gecko EFR32 SOCs: + - Copy the file `app/example/adafruit_tft_lcd_st7789/gecko/app.c` into the project root folder (overwriting existing file). + - With SiWx917 SoCs: + - Copy the file `app/example/adafruit_tft_lcd_st7789/si91x/app.c` into the project root folder (overwriting existing file). + - Copy all the *.c files in the `app/example/adafruit_tft_lcd_st7789` directory into the project root folder (overwriting existing file). 3. Install the software components: @@ -73,20 +68,32 @@ You can either create a project based on an example project or start with an emp - Select the SOFTWARE COMPONENTS tab. - Install the following components: - - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Application] → [Utility] → [Log] + - With Gecko EFR32 SOCs: + - [Services] → [Timers] → [Sleep Timer] + - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] + - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] + - With SiWx917 SoCs: + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Service] → [Power Manager] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [LED] → [led0, led1] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [Button] → [btn0, btn1] - [Application] → [Utility] → [Assert] - If using without DMA: [Third Party Hardware Drivers] → [Display & LED] → [ST7789 - TFT LCD Display (Adafruit) - SPI] - If using with DMA: [Third Party Hardware Drivers] → [Display & LED] → [ST7789 - TFT LCD Display (Adafruit) - SPI with DMA] - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] -4. Build and flash the project to your device. +4. Enable DMA support for SPI module (for SiWx917 SoCs) + + To improve SPI transfer speed, enable DMA support by changing configuration of GSPI component at: **[WiSeConnect 3 SDK] → [Device] → [Si91X] → [MCU] → [Peripheral] → [GSPI]** as the picture bellow + + | | | + | - | - | + | ![gspi](image/gspi.png) | ![gspi_dma](image/gspi_dma.png) | + +5. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **ST7789 - TFT LCD Display (Adafruit) - SPI** or **ST7789 - TFT LCD Display (Adafruit) - SPI with DMA** component. diff --git a/app/documentation/example/adafruit_tft_lcd_st7789/image/gspi.png b/app/documentation/example/adafruit_tft_lcd_st7789/image/gspi.png new file mode 100644 index 00000000..15443a18 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_st7789/image/gspi.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_st7789/image/gspi_dma.png b/app/documentation/example/adafruit_tft_lcd_st7789/image/gspi_dma.png new file mode 100644 index 00000000..923c08e4 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_st7789/image/gspi_dma.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/README.md b/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/README.md index aff7c6f0..0842d30d 100644 --- a/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/README.md +++ b/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/README.md @@ -11,30 +11,25 @@ This example uses the source files which are generated from [SquareLine Studio]( ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - A ST7789 TFT display as listed below: - [Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789](https://www.adafruit.com/product/4383) ![st7789_display](image/st7789_display.png) ![hardware](image/hw.png) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | ## Hardware Connection ## -To connect the Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789 with the EFR32xG24 Explorer Kit, you can see the pins mapping table below. +To connect the Adafruit 1.14" 240x135 Color TFT Display + MicroSD Card Breakout - ST7789 with your board, you can see the pins mapping table below. -| Pin | Connection | Pin function | -|:---:|:-------------:|:---------------| -| PC8 | D/C | GPIO | -| PC0 | CS | SPI CS | -| PC1 | CLK | SPI SCK | -| PC2 | MISO | SPI MISO | -| PC3 | MOSI | SPI MOSI | +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | Connection | Pin function | +| --- | --- | --- | --- | +| PC8 | GPIO_47 (P26) | D/C | GPIO | +| PC0 | GPIO_28 (P31) | CS | SPI CS | +| PC1 | GPIO_25 (P25) | CLK | SPI SCK | +| PC2 | GPIO_26 (P27) | MISO | SPI MISO | +| PC3 | GPIO_27 (P29) | MOSI | SPI MOSI | ## Setup ## @@ -42,7 +37,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **"st7789"**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"st7789"**. 2. Click **Create** button on the example: @@ -55,10 +50,13 @@ You can either create a project based on an example project or start with an emp ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" or "SiWx917-RB4338A Radio Board" using Simplicity Studio v5. Use the default project settings. -2. Copy source file: - - Copy the file `app/example/adafruit_tft_lcd_st7789_lvgl_dma/app.c` into the project root folder (overwriting existing file). +2. Copy source files: + - With Gecko EFR32 SOCs: + - Copy the file `app/example/adafruit_tft_lcd_st7789_lvgl_dma/gecko/app.c` into the project root folder (overwriting existing file). + - With SiWx917 SoCs: + - Copy the file `app/example/adafruit_tft_lcd_st7789_lvgl_dma/si91x/app.c` into the project root folder (overwriting existing file). - Copy the `app/example/adafruit_tft_lcd_st7789_lvgl_dma/app_ui` folder and all the files in it into the project root folder. @@ -69,23 +67,33 @@ You can either create a project based on an example project or start with an emp - Select the SOFTWARE COMPONENTS tab. - Install the following components: - - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Application] → [Utility] → [Log] + - With Gecko EFR32 SOCs: + - [Services] → [Timers] → [Sleep Timer] + - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] + - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] + - With SiWx917 SoCs: + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Service] → [Power Manager] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [LED] → [led0, led1] + - [WiSeConnect 3 SDK] → [Device] → [MCU] → [Hardware] → [Button] → [btn0, btn1] - [Application] → [Utility] → [Assert] - - [Platform] → [Driver] → [LED] → [Simple LED] → [led0, led1] - - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1] - [Third Party Hardware Drivers] → [Display & LED] → [ST7789 - TFT LCD Display (Adafruit) - SPI with DMA] - [Third Party Hardware Drivers] → [Services] → [LVGL - Graphic Library] → Using settings as below: ![lvgl_config](image/lvgl_config.png) -4. Build and flash the project to your device. +4. Enable DMA support for SPI module (for SiWx917 SoCs) + + To improve SPI transfer speed, enable DMA support by changing configuration of GSPI component at: **[WiSeConnect 3 SDK] → [Device] → [Si91X] → [MCU] → [Peripheral] → [GSPI]** as the picture bellow + + | | | + | - | - | + | ![gspi](image/gspi.png) | ![gspi_dma](image/gspi_dma.png) | + +5. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **Third Party Hardware Drivers - ST7789 - TFT LCD Display (Adafruit) - with LVGL + DMA** component. diff --git a/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi.png b/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi.png new file mode 100644 index 00000000..15443a18 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi.png differ diff --git a/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi_dma.png b/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi_dma.png new file mode 100644 index 00000000..923c08e4 Binary files /dev/null and b/app/documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi_dma.png differ diff --git a/app/documentation/example/adafruit_touchscreen_tsc2007/README.md b/app/documentation/example/adafruit_touchscreen_tsc2007/README.md index c974c259..a3568594 100644 --- a/app/documentation/example/adafruit_touchscreen_tsc2007/README.md +++ b/app/documentation/example/adafruit_touchscreen_tsc2007/README.md @@ -8,29 +8,30 @@ This project aims to implement a hardware driver for Adafruit TSC2007 Touch Scre ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [Adafruit ILI9341 - 2.4" TFT LCD with Touchscreen](https://www.adafruit.com/product/2478) - [Adafruit TSC2007 I2C Resistive Touch Screen Controller - STEMMA QT](https://www.adafruit.com/product/5423) ## Hardware Connection ## -To test this example, you should connect the Adafruit TSC2007 Touch Screen Controller to the Adafruit 2.4" TFT LCD (with Touchscreen) and the EFR32xG24 Explorer Kit as shown below. +To test this example, you should connect the Adafruit TSC2007 Touch Screen Controller to the Adafruit 2.4" TFT LCD (with Touchscreen) and your board as shown below. ![hardware_connection](image/hardware_connection.png) -| EFR32xG24 Explorer Kit | Adafruit TSC2007 | Adafruit ILI9341 | Pin function | -|---|---|---|--- | -| PC4 | QWIIC SCL |-| I2C SCL | -| PC5 | QWIIC SDA |-| I2C SDA | -| PB0 | PENIRQ |-| GPIO IRQ | -|-| X+ | XP(X+) | Analog | -|-| Y+ | YP(Y+) | Analog | -|-| Y- | YM(Y-) | Analog | -|-| Y+ | XM(Y+) | Analog | -| PC8 |-| D/C | GPIO | -| PC0 |-| CS | SPI CS | -| PC1 |-| CLK | SPI SCK | -| PC2 |-| MISO | SPI MISO | -| PC3 |-| MOSI | SPI MOSI | +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | Adafruit TSC2007 | Adafruit ILI9341 | Pin function | +| --- | --- | --- | --- | --- | +| PC4 | ULP_GPIO_7 | QWIIC SCL | - | I2C SCL | +| PC5 | ULP_GPIO_6 | QWIIC SDA | - | I2C SDA | +| PB0 | - | PENIRQ |-| GPIO IRQ | +| - | - | X+ | XP(X+) | Analog | +| - | - | Y+ | YP(Y+) | Analog | +| - | - | Y- | YM(Y-) | Analog | +| - | - | Y+ | XM(Y+) | Analog | +| PC8 | GPIO_47 (P26) | - | D/C | GPIO | +| PC0 | GPIO_28 (P31) | - | CS | SPI CS | +| PC1 | GPIO_25 (P25) | - | CLK | SPI SCK | +| PC2 | GPIO_26 (P27) | - | MISO | SPI MISO | +| PC3 | GPIO_27 (P29) | - | MOSI | SPI MOSI | ## Setup ## @@ -38,7 +39,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **tsc2007**. +1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **tsc2007**. 2. Click **Create** button on the **Third Party Hardware Drivers - TSC2007 - Resistive Touch Screen Controller (Adafruit)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. ![create_example](image/create_example.png) @@ -70,7 +71,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension is already installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **TSC2007 - Resistive Touch Screen Controller (Adafruit)** component. diff --git a/app/documentation/example/epaper_ext3_1/README.md b/app/documentation/example/epaper_ext3_1/README.md new file mode 100644 index 00000000..82479d0e --- /dev/null +++ b/app/documentation/example/epaper_ext3_1/README.md @@ -0,0 +1,81 @@ +# E-Paper EXT3-1 # + +## Summary ## + +Electronic paper (E-Paper) or intelligent paper, is a display device that reflects ambient light, mimicking the appearance of ordinary ink on paper. EPD Extension Kit Generation 3 (EXT3 Kit) is a new extension board that connects to E-Paper Display (EPD). +This project aims to implement a hardware driver interacting with the EXT3-1 Kit to control an E-Paper Display. + +## Required Hardware ## + +- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [EPD Extension Kit Generation 3 revision 1](https://www.pervasivedisplays.com/product/epd-extension-kit-gen-3-ext3/#tab-3) +- [5.81″ E-ink displays](https://www.pervasivedisplays.com/product/5-81-e-ink-displays/) + +## Hardware Connection ## + +To connect the EPD Extension Kit to the EFR32xG24 Explorer Kit, you can see the pins mapping table below. + +| EFR32xG24 Explorer Kit | SiWx917-RB4338A Radio Board | EXT3-1 Kit | Pin function | +| --- | --- | --- | --- | +| PC0 | GPIO_49 (P30)| CS | SPI CS | +| PC1 | GPIO_46 (P24) | CLK | SPI SCK | +| PC2 | GPIO_47 (P26) | MISO | SPI MISO | +| PC3 | GPIO_48 (P28) | MOSI | SPI MOSI | +| PA0 | GPIO_50 (P32) | D/C | GPIO | +| PD5 | GPIO_52 (P40) | RST | GPIO | +| PB1 | GPIO_51 (P34) | BUSY | GPIO | + +## Setup ## + +You can either create a project based on an example project or start with an empty example project. + +### Create a project based on an example project ### + +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **ext3-1**. + +2. Click **Create** button on **Third Party Hardware Drivers - E-paper EXT3-1** examples. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![create_example](image/create_example.png) + +3. Build and flash this example to the board. + +### Start with an empty example project ### + +1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. + +2. Copy the file `app/example/epaper_ext3_1/app.c` and `app/example/epaper_ext3_1/silabs_logo.h` into the project root folder (overwriting the existing file). + +3. Install the software components: + + - Open the .slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. + + - Install the following components: + - [Third Party Hardware Drivers] → [Display & LED] → [E-Paper EXT3-1 (Pervasive Displays)] + - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + +4. Build and flash the project to your device. + +**Note:** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). + +- SDK Extension must be enabled for the project to install **E-Paper EXT3-1 (Pervasive Displays)** component. + +## How It Works ## + +E-paper (also called ePaper) is an electronic display technology that mimics the appearance of paper. Using the same inks as the traditional printing industry, e-paper displays (EPDs) have tiny capsules filled with charged ink particles. When the proper charge is applied, an EPD creates highly detailed images with the contrast ratio and readability of printed material. + +### Testing ### + +The E-paper will look something like the picture below. + +![result](image/result.png) + +## Report Bugs & Get Support ## + +To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. + +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/epaper_ext3_1/image/create_example.png b/app/documentation/example/epaper_ext3_1/image/create_example.png new file mode 100644 index 00000000..d17e9304 Binary files /dev/null and b/app/documentation/example/epaper_ext3_1/image/create_example.png differ diff --git a/app/documentation/example/epaper_ext3_1/image/result.png b/app/documentation/example/epaper_ext3_1/image/result.png new file mode 100644 index 00000000..e8014689 Binary files /dev/null and b/app/documentation/example/epaper_ext3_1/image/result.png differ diff --git a/app/documentation/example/maxim_fuel_gauge_max17048/README.md b/app/documentation/example/maxim_fuel_gauge_max17048/README.md index b11c95e2..f26a4619 100644 --- a/app/documentation/example/maxim_fuel_gauge_max17048/README.md +++ b/app/documentation/example/maxim_fuel_gauge_max17048/README.md @@ -12,31 +12,41 @@ The block diagram of this example is shown in the image below: - [MAX17048XEVKIT Evalue Kit](https://www.maximintegrated.com/en/products/power/battery-management/MAX17048XEVKIT.html) -- [Wireless Starter Kit Mainboard](https://www.silabs.com/development-tools/wireless/wireless-starter-kit-mainboard) +- [Wireless Starter Kit Mainboard](https://www.silabs.com/development-tools/wireless/wireless-starter-kit-mainboard) and [10dBm EFR32xG21 Radio Board](https://www.silabs.com/development-tools/wireless/slwrb4181b-efr32xg21-wireless-gecko-radio-board) -- [10dBm EFR32xG21 Radio Board](https://www.silabs.com/development-tools/wireless/slwrb4181b-efr32xg21-wireless-gecko-radio-board) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) - [Lithium Ion Battery](https://www.sparkfun.com/products/13851) - A high power resistor (e.g. 220Ω/5W) is as the load of the battery. -## Connections Required ## +## Hardware Connection ## -We can use some [Wire Jumpers Female to Female](https://www.mikroe.com/wire-jumpers-female-to-female-30cm-10pcs) to connect between the EFR32xG21 Wireless Starter Kit and the MAX17048XEVKIT Evalue Kit, and between the MAX17048XEVKIT Evalue Kit to the Lithium Ion Battery and the load as shown below. +- If the EFR32xG21 Radio Board is used: -![connection](image/connection.png) + We can use some [Wire Jumpers Female to Female](https://www.mikroe.com/wire-jumpers-female-to-female-30cm-10pcs) to connect between the EFR32xG21 Wireless Starter Kit and the MAX17048XEVKIT Evalue Kit, and between the MAX17048XEVKIT Evalue Kit to the Lithium Ion Battery and the load as shown below. -| WSTK markings | MAX17048XEVKIT Evalue Kit markings | -|---------------------------|:-----------------------------------:| -| Extension PIN 1 - GND | J2-4: GND | -| Extension PIN 9 - PD03 | J2-5: SDA | -| Extension PIN 7 - PD02 | J2-3: SCL | -| Extension PIN 6 - PC01 | J2-6: ALRT | + ![connection](image/connection.png) -| MAX17048XEVKIT Evalue Kit markings | Lithium Ion Battery | -|:----------------------------------:|:--------------------:| -| PK+ | BAT+ | -| PK- | BAT- | + | WSTK markings | MAX17048XEVKIT Evalue Kit markings | + |---------------------------|:-----------------------------------:| + | Extension PIN 1 - GND | J2-4: GND | + | Extension PIN 9 - PD03 | J2-5: SDA | + | Extension PIN 7 - PD02 | J2-3: SCL | + | Extension PIN 6 - PC00 | J2-6: ALRT | + + | MAX17048XEVKIT Evalue Kit markings | Lithium Ion Battery | + |:----------------------------------:|:--------------------:| + | PK+ | BAT+ | + | PK- | BAT- | + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP/Breakout Header | Maxim Battery Fuel Gauge MAX17048 | + | -------------| ------------- | ------------------ | ---------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | J2-5: SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | J2-3: SCL | + | ALRT | GPIO_46 | P24 | J2-6: ALRT | **Note:** The MAX17048 EV kit is set by default to evaluate 1-cell Li+ batteries. LDO U2 is provided so that only a single supply is needed to power the EV kit in the case a 2-cell battery is used. When evaluating the MAX17048, set jumper JU1 to pins 1-2 and remove any shunt installed on JU2 to bypass the LDO. @@ -46,51 +56,59 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4181B to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter max17048evkit. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **max17048evkit**. -2. Click **Create** button on the **Third Party Hardware Drivers - MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) +2. Click **Create** button on the **Third Party Hardware Drivers - MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim) +** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG21 2.4 GHz 10 dBm Radio Board (BRD4181B)" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/maxim_fuel_gauge_max17048/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - - Open the .slcp file in the project. - - - Select the SOFTWARE COMPONENTS tab. + - Open the .slcp file in the project. + - Select the SOFTWARE COMPONENTS tab. + - Install the following components: - - Install the following components: + **If the BGM220P Explorer Kit is used:** - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - Set **Enable Virtual COM UART** in **[Platform] > [Board Control]** component. + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - Set **Enable Virtual COM UART** in **[Platform] > [Board Control]** component. - ![enable_vcom](image/vcom.png) + ![enable_vcom](image/vcom.png) + - [Services] → [Timers] → [Sleep Timer] + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Third Party Hardware Drivers] → [Power Management] → [MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim)] → use default configuaration - - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] → [Power Management] → [MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim)] → use default configuaration + ![max17048_config](image/max17048_config.png) - ![max17048_config](image/max17048_config.png) + - [Third Party] → [Tiny printf] - - Install printf float + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** - - Open Properties of the project. - - Select **C/C++ Build > Settings > Tool Settings >GNU ARM C Linker > General**. Check **Printf float**. + - [Application] → [Utility] → [Assert] + - [Third Party Hardware Drivers] → [Power Management] → [MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim)] → use default configuaration - ![enable_print_float](image/float.png) + ![max17048_config](image/max17048_config.png) + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [BJT Temperature Sensor] 4. Build and flash this example to the board. **Note:** -- Make sure the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim)" component. Selecting this component will also include the "I2CSPM" component with default configurated instance: **fuel_gauge**. +- Third-party Drivers Extension must be enabled for the project to install "MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim)" component. ## How It Works ## diff --git a/app/documentation/example/maxim_fuel_gauge_max17048/image/create_example.png b/app/documentation/example/maxim_fuel_gauge_max17048/image/create_example.png index 00a665b1..46ef563a 100644 Binary files a/app/documentation/example/maxim_fuel_gauge_max17048/image/create_example.png and b/app/documentation/example/maxim_fuel_gauge_max17048/image/create_example.png differ diff --git a/app/documentation/example/maxim_fuel_gauge_max17048/image/float.png b/app/documentation/example/maxim_fuel_gauge_max17048/image/float.png deleted file mode 100644 index 0590ffc6..00000000 Binary files a/app/documentation/example/maxim_fuel_gauge_max17048/image/float.png and /dev/null differ diff --git a/app/documentation/example/maxim_fuel_gauge_max17048/image/log.png b/app/documentation/example/maxim_fuel_gauge_max17048/image/log.png index c55b6c64..251d0edf 100644 Binary files a/app/documentation/example/maxim_fuel_gauge_max17048/image/log.png and b/app/documentation/example/maxim_fuel_gauge_max17048/image/log.png differ diff --git a/app/documentation/example/maxim_fuel_gauge_max17048/image/max17048_config.png b/app/documentation/example/maxim_fuel_gauge_max17048/image/max17048_config.png index c20fe6a7..5ac73b3b 100644 Binary files a/app/documentation/example/maxim_fuel_gauge_max17048/image/max17048_config.png and b/app/documentation/example/maxim_fuel_gauge_max17048/image/max17048_config.png differ diff --git a/app/documentation/example/mikroe_accel5_bma400/README.md b/app/documentation/example/mikroe_accel5_bma400/README.md index b514eec0..649d4762 100644 --- a/app/documentation/example/mikroe_accel5_bma400/README.md +++ b/app/documentation/example/mikroe_accel5_bma400/README.md @@ -4,30 +4,47 @@ This project aims to show the hardware driver that is used to interface with the BMA400 Sensor via APIs of GSDK. This driver is based on [BMA400 Sensor API](https://github.com/BoschSensortec/BMA400-API) from Bosch Sensortec. -The BMA400 is the first real ultra-low power acceleration sensor that minimizes power consumption without compromise on performance. +The BMA400 is the first real ultra-low power acceleration sensor that minimizes power consumption without compromising performance. With its ultra-low power consumption, onboard data processing, output data lowpass filtering, and ability to detect many different events, the BMA400 is a perfect solution for IoT applications. It can also be used to develop applications for wearables, smart home applications, drop detection for warranty logging, power management based on motion, and similar. ## Required Hardware ## -- [A BGM220P Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [A MikroE Accel 5 Click board](https://www.mikroe.com/accel-5-click) -- [A MikroE Accel 5 Click board.](https://www.mikroe.com/accel-5-click) +## Hardware Connection ## -**NOTE:** -Tested boards for working with this example: +- **If the BGM220 Bluetooth Module Explorer Kit is used**: + + The Accel 5 Click board supports MikroBus; therefore, it can connect easily to the MikroBus header of the BGM220P Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A ](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | + ![board](image/hardware_connection.png) -## Hardware Connection ## +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + + **If I2C interface is used:** + + | Description | BRD4338A GPIO | BRD4002 EXP Header | Accel 5 Click Board | + | -------------| ------------- | ------------------ | ------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | BMA400_INT1 | GPIO_46 | P24 | IT2 | + | BMA400_INT2 | GPIO_47 | P26 | IT1 | -The Accel 5 Click board supports MikroBus; therefore, it can connect easily to the MikroBus header of the BGM220P Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. + **If SPI interface is used:** -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Accel 5 Click Board | + | -------------------------| ------------- | -------------------- | ------------------- | + | BMA400_INT1 | GPIO_46 | P24 | IT2 | + | BMA400_INT2 | GPIO_47 | P26 | IT1 | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -35,51 +52,63 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: bma400. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "bma400". -2. Click **Create** button on the example: +2. Click **Create** button on the project: - - **Third Party Hardware Drivers - BMA400 - Accelerometer Sensor (Mikroe) - I2C** if using the I2C interface. + - **Third Party Hardware Drivers - BMA400 - Accelerometer Sensor (Mikroe) - I2C** if using the I2C interface. - - **Third Party Hardware Drivers - BMA400 - Accelerometer Sensor (Mikroe) - SPI** if using the SPI interface. + - **Third Party Hardware Drivers - BMA400 - Accelerometer Sensor (Mikroe) - SPI** if using the SPI interface. + + ![Create_example](image/create_example.png) Example project creation dialog pops up -> click Create and Finish and Project should be generated. - ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_accelerometer_bma400/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Platform] → [Driver] → [GPIOINT] - - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Third Party] → [Tiny printf] + - [Application] → [Utility] → [Log] + - If using the I2C interface: [Third Party Hardware Drivers] → [Sensors] → [BMA400 - Accel 5 Click (Mikroe) - I2C] → use default configuration + - If using the SPI interface: [Third Party Hardware Drivers] → [Sensors] → [BMA400 - Accel 5 Click (Mikroe) - SPI] → use the default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - If using the I2C interface: [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] - If using the I2C interface: [Third Party Hardware Drivers] → [Sensors] → [BMA400 - Accel 5 Click (Mikroe) - I2C] → use default configuration - - If using the SPI interface: [Third Party Hardware Drivers] → [Sensors] → [BMA400 - Accel 5 Click (Mikroe) - SPI] → use default configuration + - If using the SPI interface: [Third Party Hardware Drivers] → [Sensors] → [BMA400 - Accel 5 Click (Mikroe) - SPI] → use the default configuration + +4. Install "Printf float" + + - Open Properties of the project. + + - Select C/C++ Build > Settings > Tool Settings > GNU ARM C Linker > General > Check "Printf float". -4. Build and flash this example to the board. +5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). ## How It Works ## -You can choose the mode of operation by selecting the corresponding macro MIKROE_BMA400_READ_MODE_INTERRUPT or MIKROE_BMA400_READ_MODE_POLLING. +You can choose the mode of operation by selecting the corresponding macro MIKROE_BMA400_READ_MODE_INTERRUPT or MIKROE_BMA400_READ_MODE_POLLING is defined in "app.c". -The application reads the accelerometer xyz data and convert them to Gravity data in m/s^2. You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. A screenshot of the console output is shown in the figure below. +The application reads the accelerometer XYZ data and converts them to Gravity data in m/s^2. You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. A screenshot of the console output is shown in the figure below. ![usb_debug](image/log.png "USB Debug Output Data") diff --git a/app/documentation/example/mikroe_accel5_bma400/image/create_example.png b/app/documentation/example/mikroe_accel5_bma400/image/create_example.png index 5d386ebb..1bf828a5 100644 Binary files a/app/documentation/example/mikroe_accel5_bma400/image/create_example.png and b/app/documentation/example/mikroe_accel5_bma400/image/create_example.png differ diff --git a/app/documentation/example/mikroe_accel5_bma400/image/hardware_connection.png b/app/documentation/example/mikroe_accel5_bma400/image/hardware_connection.png index f2498102..05658c27 100644 Binary files a/app/documentation/example/mikroe_accel5_bma400/image/hardware_connection.png and b/app/documentation/example/mikroe_accel5_bma400/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_accurrent/README.md b/app/documentation/example/mikroe_accurrent/README.md new file mode 100644 index 00000000..26317915 --- /dev/null +++ b/app/documentation/example/mikroe_accurrent/README.md @@ -0,0 +1,97 @@ +# AC Current Click (Mikroe) # + +## Summary ## + +This project aims to show the hardware driver that is used to interface with the AC Current driver with the Silicon Labs Platform. + +AC Current click is a device that is able to measure the alternating current (AC) running through the conductor. The non-invasive sensor works by utilizing the electromagnetic induction phenomenon, similar to a transformer. The primary coil does not exist though, the electromagnetic field is generated by the AC Current running through the cable which is measured. The low-noise 12-bit SAR A/D converter (ADC) converts the sensor voltage, providing conversion data via the industry-standard SPI interface. + +The Click board™ comes equipped with the 3.5mm jack connector which is used to attach the sensing probe. This board also comes as the part of the [AC Current click - bundle](https://www.mikroe.com/ac-current-click-bundle), which also contains the current measuring sensor, calibrated and well suited to work with the AC Current click (10A - 1V). + +## Required Hardware ## + +- [BGM220 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) + +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [AC Current Click](https://www.mikroe.com/ac-current-click) + +## Hardware Connection ## + +- If the BGM220 Explorer Kit is used: + + The AC Current Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | AC Current Click | + | ----------- | ------------- | ------------------ | ---------------- | + | CLK | GPIO_25 | P25 | SCK | + | MISO | GPIO_26 | P27 | SDO | + | CS | GPIO_28 | P31 | CS | + +## Setup ## + +You can either create a project based on an example project or start with an empty example project. + +### Create a project based on an example project ### + +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by 'accurrent'. + +2. Click **Create** button on the **Third Party Hardware Drivers - AC Current Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) + +3. Build and flash this example to the board. + +### Start with an empty example project ### + +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. + +2. Copy the file `app/example/mikroe_accurrent/app.c` into the project root folder (overwriting the existing file). + +3. Install the software components: + + - Open the .slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. + + - Install the following components: + + **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Services] → [Timers] → [Sleep Timer] + - [Third Party Hardware Drivers] → [Sensors] → [AC Current Click (Mikroe)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [AC Current Click (Mikroe)] + +4. Build and flash this example to the board. + +**Note:** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). + +- Third-party Drivers Extension extension must be enabled for the project to install the "AC Current Click (Mikroe)" component. + +## How It Works ## + +AC Current Click Click communicates with the Silicon Labs hardware via SPI interface. The example measuring AC current and shows a message on the log screen. + +You can launch Console which is integrated into Simplicity Studio or use a third-party terminal tool like Putty to receive the data from the USB. A screenshot of the console output and an actual test image are shown in the figure below. + +![console_log](image/console_log.png) + +## Report Bugs & Get Support ## + +To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. + +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. \ No newline at end of file diff --git a/app/documentation/example/mikroe_accurrent/image/console_log.png b/app/documentation/example/mikroe_accurrent/image/console_log.png new file mode 100644 index 00000000..571a6347 Binary files /dev/null and b/app/documentation/example/mikroe_accurrent/image/console_log.png differ diff --git a/app/documentation/example/mikroe_accurrent/image/create_example.png b/app/documentation/example/mikroe_accurrent/image/create_example.png new file mode 100644 index 00000000..662fee52 Binary files /dev/null and b/app/documentation/example/mikroe_accurrent/image/create_example.png differ diff --git a/app/documentation/example/mikroe_accurrent/image/hardware_connection.png b/app/documentation/example/mikroe_accurrent/image/hardware_connection.png new file mode 100644 index 00000000..59e83f8a Binary files /dev/null and b/app/documentation/example/mikroe_accurrent/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/install_float.png b/app/documentation/example/mikroe_accurrent/image/install_float.png similarity index 100% rename from app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/install_float.png rename to app/documentation/example/mikroe_accurrent/image/install_float.png diff --git a/app/documentation/example/mikroe_alcohol_mq3/README.md b/app/documentation/example/mikroe_alcohol_mq3/README.md index 0a158b83..48df3093 100644 --- a/app/documentation/example/mikroe_alcohol_mq3/README.md +++ b/app/documentation/example/mikroe_alcohol_mq3/README.md @@ -10,17 +10,17 @@ The MQ-3 provides an analog representation of its concentration in the air sent ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -- [**Mikroe Alcohol Click** board based on MQ-3 sensor](https://www.mikroe.com/alcohol-click). +- [**Mikroe Alcohol Click** board based on MQ-3 sensor](https://www.mikroe.com/alcohol-click) ## Hardware Connection ## - If the EFR32xG24 Explorer Kit is used: - The Alcohol Click supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + The Alcohol Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: @@ -31,7 +31,6 @@ The MQ-3 provides an analog representation of its concentration in the air sent | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Acohol Click | | ----------------------| ---------------| ---------------------| -------------------- | | Positive analog input | ULP_GPIO_1 | P16 | OUT | - | Negative analog input | ULP_GPIO_7 | EXP_HEADER-15 to GND | -- | ## Setup ## @@ -41,14 +40,9 @@ You can either create a project based on an example project or start with an emp 1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **mq3**. -2. Click **Create** button on the project: +2. Click **Create** button on the **Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - - **Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe)** example if the EFR32xG24 Explorer Kit is used. - ![Create_example](image/create_example_1.png) - - **Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used. - ![Create_example](image/create_example_2.png) - - Example project creation dialog pops up -> click Create and Finish and Project should be generated. + ![Create_example](image/create_example.png) ### Start with an empty example project ### @@ -74,7 +68,7 @@ You can either create a project based on an example project or start with an emp **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] - - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_0] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration - [Third Party Hardware Drivers] → [Sensors] → [MQ3 - Alcohol Click (Mikroe)] 4. Install printf float @@ -88,9 +82,9 @@ You can either create a project based on an example project or start with an emp **Note :** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "MQ3 - Alcohol Click (Mikroe)" component. Selecting this component will also include the "IADC" component. +- SDK Extension must be enabled for the project to install "MQ3 - Alcohol Click (Mikroe)" component. ## How It Works ## @@ -100,7 +94,7 @@ You can either create a project based on an example project or start with an emp ### Testing ### -The example detects the presence and concentration of alcohol in the air and shows a message on the log screen, which is raw data and the output voltage of IADC. +The example detects the presence and concentration of alcohol in the air and shows a message on the log screen, which is raw data and the output voltage of ADC. You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like TeraTerm to receive the data from the USB. A screenshot of the console output is shown in the figure below. diff --git a/app/documentation/example/mikroe_alcohol_mq3/image/create_example.png b/app/documentation/example/mikroe_alcohol_mq3/image/create_example.png new file mode 100644 index 00000000..09e5922c Binary files /dev/null and b/app/documentation/example/mikroe_alcohol_mq3/image/create_example.png differ diff --git a/app/documentation/example/mikroe_alcohol_mq3/image/create_example_1.png b/app/documentation/example/mikroe_alcohol_mq3/image/create_example_1.png deleted file mode 100644 index c95e414a..00000000 Binary files a/app/documentation/example/mikroe_alcohol_mq3/image/create_example_1.png and /dev/null differ diff --git a/app/documentation/example/mikroe_alcohol_mq3/image/create_example_2.png b/app/documentation/example/mikroe_alcohol_mq3/image/create_example_2.png deleted file mode 100644 index ab7b7703..00000000 Binary files a/app/documentation/example/mikroe_alcohol_mq3/image/create_example_2.png and /dev/null differ diff --git a/app/documentation/example/mikroe_barcode2_em3080w/README.md b/app/documentation/example/mikroe_barcode2_em3080w/README.md index 916be0a0..79244711 100644 --- a/app/documentation/example/mikroe_barcode2_em3080w/README.md +++ b/app/documentation/example/mikroe_barcode2_em3080w/README.md @@ -8,15 +8,28 @@ Barcode 2 Click is an adapter add-on board that contains a computerized image re ## Required Hardware ## -- [A BGM220P Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) - -- [A MikroE Barcode 2 click board.](https://www.mikroe.com/barcode-2-click) +- [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [A MikroE Barcode2 Click board](https://www.mikroe.com/barcode-2-click) ## Hardware Connection ## -The Barcode 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- **If BGM220P Explorer Kit is used:** + + The MikroE Barcode2 Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the BGM220P Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | MikroE Barcode2 Click board | + | ------------ | --------------- | ------------------ | --------------------------- | + | UART1_RX_PIN | GPIO_6 | P19 | TX | + | UART1_TX_PIN | GPIO_7 | P20 | RX | + | GPIO | GPIO_46 | P24 | RST | + | GPIO | GPIO_47 | P26 | TRG | ## Setup ## @@ -24,16 +37,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter EM3080-W. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "em3080-w". 2. Click **Create** button on the **Third Party Hardware Drivers - EM3080-W - Barcode 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_barcode2_em3080w/app.c` into the project root folder (overwriting the existing file). @@ -45,32 +59,33 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] + - [Application] → [Utility] → [Assert] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - [Application] → [Utility] → [Log] - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: mikroe -> Set Baud rate to 9600 and Receiver buffer size to 256 as below - ![UART config](image/uart_config.png) + - [Services] → [IO Stream] → [IO Stream: USART] → [mikroe] → Set "Receiver buffer size" to **256** + - [Third Party Hardware Drivers] → [Sensors] → [EM3080-W - Barcode 2 Click (Mikroe)] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Application] → [Utility] → [Assert] - [Third Party Hardware Drivers] → [Sensors] → [EM3080-W - Barcode 2 Click (Mikroe)] → use default configuration - ![Barcode 2 config](image/barcode2_config.png) + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [UART] → disable "UART1 DMA" 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide) -- SDK Extension must be enabled for the project to install "EM3080-W - Barcode 2 Click (Mikroe)" component. +- Third-party Drivers Extension must be enabled for the project to install "EM3080-W - Barcode 2 Click (Mikroe)" component. ## How It Works ## -This is an example that demonstrates the use of the Barcode 2 Click board: - -- First, it enables scanning and waits for the barcode to be detected. -- If the barcode or QR Code is detected, it displays its content to the USB UART. -- After that, disables scanning for 1 second. -- Results are being sent to the USART Terminal where you can track their changes. - -You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Putty to receive the data from the USB. A screenshot of the console output is shown in the figure below. +After you flash the code to your board and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that your board uses the default baud rate of 115200. First, the main program performs sensor initialization, after that it enables scanning and waits for the barcode to be detected. If the barcode or QR Code is detected, it displays the barcode's content to the console. After that, it disables scanning for 1 second. In the image below, you can see an example of how the output is displayed. ![usb_debug](image/log.png "USB Debug Output Data") diff --git a/app/documentation/example/mikroe_barcode2_em3080w/image/barcode2_config.png b/app/documentation/example/mikroe_barcode2_em3080w/image/barcode2_config.png deleted file mode 100644 index 48db73ad..00000000 Binary files a/app/documentation/example/mikroe_barcode2_em3080w/image/barcode2_config.png and /dev/null differ diff --git a/app/documentation/example/mikroe_barcode2_em3080w/image/log.png b/app/documentation/example/mikroe_barcode2_em3080w/image/log.png index 28665e2a..19c39881 100644 Binary files a/app/documentation/example/mikroe_barcode2_em3080w/image/log.png and b/app/documentation/example/mikroe_barcode2_em3080w/image/log.png differ diff --git a/app/documentation/example/mikroe_barcode2_em3080w/image/uart_config.png b/app/documentation/example/mikroe_barcode2_em3080w/image/uart_config.png deleted file mode 100644 index c0eca521..00000000 Binary files a/app/documentation/example/mikroe_barcode2_em3080w/image/uart_config.png and /dev/null differ diff --git a/app/documentation/example/mikroe_brushless16_lb11685av/README.md b/app/documentation/example/mikroe_brushless16_lb11685av/README.md index cb0496f2..f411256f 100644 --- a/app/documentation/example/mikroe_brushless16_lb11685av/README.md +++ b/app/documentation/example/mikroe_brushless16_lb11685av/README.md @@ -10,15 +10,27 @@ Brushless 16 Click as its foundation uses the LB11685AV, a three-phase full-wave - [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [**Brushless 16 Click** board based on LB11685AV IC](https://www.mikroe.com/brushless-16-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [**Brushless 16 Click** board based on LB11685AV IC](https://www.mikroe.com/brushless-16-click) ## Hardware Connection ## -The Brushless 16 board supports MikroBus, so it can connect easily to BGM220P Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220P Explorer Kit is used: + + The Brushless 16 board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png "Hardware connection") -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png "Hardware connection") + | Description | BRD4338A GPIO | BRD4002 Breakout | Brushless 16 Click | + | ------------------------- | ------------- | ---------------- | ------------------ | + | Enable | GPIO_48 | P28 | EN | + | Rotation Speed Indication | GPIO_47 | P26 | FG | + | Motor Lock Detection | GPIO_46 | P24 | RD | ## Setup ## @@ -26,16 +38,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter brushless. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *brushless*. 2. Click **Create** button on the **Third Party Hardware Drivers - LB11685AV - Brushless 16 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_brushless16_lb11685av/app.c` into the project root folder (overwriting existing file). @@ -47,17 +60,23 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Application] → [Utility] → [Assert] - - [Third Party Hardware Drivers] → [Motor Control] → [LB11685AV - Brushless 16 Click (Mikroe)] → use default config + - [Third Party Hardware Drivers] → [Motor Control] → [LB11685AV - Brushless 16 Click (Mikroe)] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Motor Control] → [LB11685AV - Brushless 16 Click (Mikroe)] → use default configuration 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "LB11685AV - Brushless 16 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_brushless16_lb11685av/image/create_example.png b/app/documentation/example/mikroe_brushless16_lb11685av/image/create_example.png index 58609773..b7bf840f 100644 Binary files a/app/documentation/example/mikroe_brushless16_lb11685av/image/create_example.png and b/app/documentation/example/mikroe_brushless16_lb11685av/image/create_example.png differ diff --git a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md index a52e7b54..993b0c82 100644 --- a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md +++ b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/README.md @@ -16,7 +16,7 @@ This project shows the driver implementation of a magnetic buzzer using the CMT- - If the BGM220 Explorer Kit is used: - The BUZZ2 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + The BUZZ2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: @@ -36,14 +36,9 @@ You can either create a project based on an example project or start with an emp 1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *buzz*. -2. Click **Create** button on the project: +2. Click **Create** button on the **Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - - **Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe)** example if the BGM220 Explorer Kit is used. ![Create_example](image/create_example.png) - - **Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used. - ![Create_example](image/create_example_si91x.png) - - Example project creation dialog pops up -> click Create and Finish and Project should be generated. 3. Build and flash this example to the board. @@ -78,7 +73,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "CMT-8540S-SMT - Buzz 2 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png index 514a7f12..ca4aa06f 100644 Binary files a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png and b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png differ diff --git a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png b/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png deleted file mode 100644 index 8a670329..00000000 Binary files a/app/documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png and /dev/null differ diff --git a/app/documentation/example/mikroe_captouch2_cap1166/README.md b/app/documentation/example/mikroe_captouch2_cap1166/README.md index 5b7bdeb0..3bbfdf74 100644 --- a/app/documentation/example/mikroe_captouch2_cap1166/README.md +++ b/app/documentation/example/mikroe_captouch2_cap1166/README.md @@ -10,32 +10,48 @@ Cap Touch 2 click is a capacitive touch sensing Click board™ which features th - [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [**Cap Touch 2 Click** board based on CAP1166 IC](https://www.mikroe.com/cap-touch-2-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [**Cap Touch 2 Click** board based on CAP1166 IC](https://www.mikroe.com/cap-touch-2-click) ## Hardware Connection ## -The CAP1166 MikroE board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- **If the BGM220 Explorer Kit is used**: + + The Cap Touch 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. -The hardware connection is shown in the image below: + The hardware connection is shown in the image below: -![board](image/hardware_connection.png) + ![board](image/hardware_connection.png) +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit** is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Cap Touch 2 Click Board | + | ------------------------ | -------------- | -------------------- | ----------------------- | + | Alert/Interrupt | GPIO_46 | P24 | ALT | + | Device Reset | GPIO_47 | P26 | RST | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | + ## Setup ## You can either create a project based on an example project or start with an empty example project. ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter cap1166. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **cap1166**. 2. Click **Create** button on the **Third Party Hardware Drivers - CAP1166 - Cap Touch 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_captouch2_cap1166/app.c` into the project root folder (overwriting existing file). @@ -47,17 +63,25 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220 Explorer Kit is used**: + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - [Application] → [Utility] → [Assert] - [Application] → [Utility] → [log] + - [Platform] → [Driver] → [SPI] → [SPIDRV] → default instance name: **mikroe** + - [Third Party Hardware Drivers] → [Human Machine Interface] → [CAP1166 - Capacitive Touch 2 Click (Mikroe)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] - [Third Party Hardware Drivers] → [Human Machine Interface] → [CAP1166 - Capacitive Touch 2 Click (Mikroe)] 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "CAP1166 - Capacitive Touch 2 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_captouch2_cap1166/image/create_example.png b/app/documentation/example/mikroe_captouch2_cap1166/image/create_example.png index c88182cb..b5254e3c 100644 Binary files a/app/documentation/example/mikroe_captouch2_cap1166/image/create_example.png and b/app/documentation/example/mikroe_captouch2_cap1166/image/create_example.png differ diff --git a/app/documentation/example/mikroe_captouch2_cap1166/image/log.png b/app/documentation/example/mikroe_captouch2_cap1166/image/log.png index 12f77d9b..d01e848a 100644 Binary files a/app/documentation/example/mikroe_captouch2_cap1166/image/log.png and b/app/documentation/example/mikroe_captouch2_cap1166/image/log.png differ diff --git a/app/documentation/example/mikroe_co_mq7/README.md b/app/documentation/example/mikroe_co_mq7/README.md index 4a51ed50..a63b0a04 100644 --- a/app/documentation/example/mikroe_co_mq7/README.md +++ b/app/documentation/example/mikroe_co_mq7/README.md @@ -2,21 +2,30 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the MQ7 Sensor via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the MQ7 Sensor using Silicon Labs platform. CO Click is a compact add-on board that can detect the presence of carbon monoxide. This board features MQ-7, a carbon monoxide sensor from Zhengzhou Winsen Electronics Technology. The gas sensing layer on the MQ-7 sensor unit is made of Tin dioxide (SnO2), an inorganic compound with lower conductivity in clean air (the conductivity increases as the levels of carbon monoxide rise). It has a high sensitivity to carbon monoxide and can be used to detect alcohol in concentrations from 20 to 2000ppm communication with the host MCU through the analog mikroBUS line. This Click board is suitable as a domestic CO gas leakage alarm, industrial CO gas alarm, and portable CO gas detector. ## Required Hardware ## -- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit). +- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) -- [CO Click](https://www.mikroe.com/co-click). +- [Mikroe CO Click](https://www.mikroe.com/co-click) ## Hardware Connection ## -The CO Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220 Explorer Kit is used: -![board](image/hardware_connection.png) + The CO Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Acohol Click | + | ----------------------| ---------------| ---------------------| -------------------- | + | Positive analog input | ULP_GPIO_1 | P16 | OUT | ## Setup ## @@ -24,16 +33,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter mq7. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *mq7*. + +2. Click **Create** button on **Third Party Hardware Drivers - MQ7 - CO Click (Mikroe)**. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -2. Click **Create** button on the **Third Party Hardware Drivers - MQ7 - CO Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_co_mq7/app.c` into the project root folder (overwriting the existing file). @@ -45,11 +55,18 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Services] → [Timers] → [Sleep Timer]** - - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Third Party Hardware Drivers] → [Sensors] → [MQ7 - CO Click (Mikroe)]** → use default configuration - ![Default Configuration](image/default_configuration.png) + **If the BGM220 Explorer Kit is used:** + + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Third Party Hardware Drivers] → [Sensors] → [MQ7 - CO Click (Mikroe)] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration + - [Third Party Hardware Drivers] → [Sensors] → [MQ7 - CO Click (Mikroe)] 4. Install printf float @@ -63,7 +80,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **MQ7 - CO Click (Mikroe)** component. diff --git a/app/documentation/example/mikroe_co_mq7/image/create_example.png b/app/documentation/example/mikroe_co_mq7/image/create_example.png index f01fe28d..26d14c67 100644 Binary files a/app/documentation/example/mikroe_co_mq7/image/create_example.png and b/app/documentation/example/mikroe_co_mq7/image/create_example.png differ diff --git a/app/documentation/example/mikroe_co_mq7/image/default_configuration.png b/app/documentation/example/mikroe_co_mq7/image/default_configuration.png deleted file mode 100644 index 2bc139a1..00000000 Binary files a/app/documentation/example/mikroe_co_mq7/image/default_configuration.png and /dev/null differ diff --git a/app/documentation/example/mikroe_co_mq7/image/log.png b/app/documentation/example/mikroe_co_mq7/image/log.png index d4fb835d..ac898eaf 100644 Binary files a/app/documentation/example/mikroe_co_mq7/image/log.png and b/app/documentation/example/mikroe_co_mq7/image/log.png differ diff --git a/app/documentation/example/mikroe_dcmotor24_l9958/README.md b/app/documentation/example/mikroe_dcmotor24_l9958/README.md index b1d0452e..b5c17605 100644 --- a/app/documentation/example/mikroe_dcmotor24_l9958/README.md +++ b/app/documentation/example/mikroe_dcmotor24_l9958/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the DC motor driver using the L9958 via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the DC motor driver using the L9958 with the Silicon Labs Platform. DC Motor 24 Click is a compact add-on board with a brushed DC motor driver. This board features the L9958, an SPI-controlled H-bridge from STMicroelectronics. The L9958 is rated for an operating voltage range from 4V to 28V, with direct PWM motor control and current regulation threshold set by the SPI interface from 2.5A to 8.6A. It also has complete diagnostic and protection capabilities supporting robust and reliable operation. This Click board™ is suitable for controlling DC and stepper motors in safety-critical automotive applications and under extreme environmental conditions. @@ -10,26 +10,31 @@ DC Motor 24 Click is a compact add-on board with a brushed DC motor driver. This - [BGM220 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [DC Motor 24 Click](https://www.mikroe.com/dc-motor-24-click) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| -------- | ------------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- If the BGM220 Explorer Kit is used: -## Hardware Connection ## + The DC Motor 24 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. -The DC Motor 24 Click board supports mikroBUS™, so it can connect easily to the header of the BGM220 Bluetooth Module Explorer Kit. + The hardware connection is shown in the image below: -During the assembly process, make sure that the 45-degree corner of the Click board matches the 45-degree white line of the Silicon Labs Explorer Kit. + ![board](image/hardware_connection.png) -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | DC Motor 24 Click | + | ------------------------ | ------------- | ------------------ | ----------------- | + | DIR | GPIO_48 | P28 | DIR | + | EN | GPIO_46 | P24 | EN | + | PWM | GPIO_7 | P20 | PWM | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -37,10 +42,11 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter 'l9958'. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by 'l9958'. 2. Click **Create** button on the **Third Party Hardware Drivers - L9958 - DC Motor 24 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. @@ -58,18 +64,26 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Services] → [IO Stream] → [IO Stream: EUSART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Services] → [Timers] → [Sleep Timer]** - - **[Third Party Hardware Drivers] → [Motor Control] → [L9958 - DC MOTOR 24 Click (Mikroe)]** + **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Services] → [Timers] → [Sleep Timer] + - [Third Party Hardware Drivers] → [Motor Control] → [L9958 - DC MOTOR 24 Click (Mikroe)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [PWM] → [channel_0] → use default configuration + - [Third Party Hardware Drivers] → [Motor Control] → [L9958 - DC MOTOR 24 Click (Mikroe)] 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third Party Hardware Drivers extension must be enabled for the project to install the "L9958 - DC MOTOR 24 Click (Mikroe)" component. +- Third-party Drivers Extension extension must be enabled for the project to install the "L9958 - DC MOTOR 24 Click (Mikroe)" component. ## How It Works ## diff --git a/app/documentation/example/mikroe_dcmotor26_tb9053ftg/README.md b/app/documentation/example/mikroe_dcmotor26_tb9053ftg/README.md index 0f652160..9cbea761 100644 --- a/app/documentation/example/mikroe_dcmotor26_tb9053ftg/README.md +++ b/app/documentation/example/mikroe_dcmotor26_tb9053ftg/README.md @@ -4,33 +4,40 @@ MikroE DC Motor 26 Click features the TB9053FTG, a PWM-type, dual-channel, H-bridge, brushed DC motor driver. The TB9053FTG is rated for an operating voltage range from 4.5V to 28V, with the motor controlled directly through a PWM signal or SPI serial interface. This board can control one or two DC motors, selectable motor control functions and operational modes, current monitoring and more. -The example demonstrates the use of MikroE DC Motor 26 Click board by controlling the speed of a DC motor over the PWM duty cycle as well as displaying the current consumption of the motor by using APIs of GSDK. - +The example demonstrates the use of MikroE DC Motor 26 Click board by controlling the speed of a DC motor over the PWM duty cycle as well as displaying the current consumption of the motor with the Silicon Labs Platform. ## Required Hardware ## - [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [MikroE DC Motor 26 Click](https://www.mikroe.com/dc-motor-26-click) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| -------- | ------------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- If the EFR32xG24 Explorer Kit is used: -## Hardware Connection ## + The DC Motor 26 Click board supports mikroBUS™, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. -The DC Motor 26 Click board supports mikroBUS™, so it can connect easily to the header of the EFR32xG24 Explorer Kit. + The hardware connection is shown in the image below: -During the assembly process, make sure that the 45-degree corner of the Click board matches the 45-degree white line of the Silicon Labs Explorer Kit. + ![hardware_connection](image/hardware_connection.png) -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![hardware_connection](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | DC Motor 26 Click | + | ------------------------ | ------------- | ------------------ | ----------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Channel Current Monitor | ULP_GPIO_1 | P16 | CM | + | Sleep / ID SEL | GPIO_46 | P24 | SLP | + | Interrupt | GPIO_47 | P26 | INT | + | PWM Signal | GPIO_48 | P28 | PWM | + | CS | GPIO_49 | P30 | CS | + | RTE_SSI_MASTER_SCK_PIN | GPIO_25 | P25 | SCK | + | RTE_SSI_MASTER_MOSI_PIN | GPIO_26 | P27 | SDI | + | RTE_SSI_MASTER_MISO_PIN | GPIO_27 | P29 | SDO | **Note:** @@ -42,16 +49,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **"motor 26"**. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"motor 26"**. 2. Click the **Create** button on the **Third Party Hardware Drivers - TB9053FTG - DC Motor 26 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](image/create_project.png) + + ![create_project](image/create_project.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_dcmotor26_tb9053ftg/app.c` into the project root folder (overwriting the existing file). @@ -63,28 +71,32 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom. - - - [Application] → [Utility] → [Log] + **If the BGM220P Explorer Kit is used:** - - [Application] → [Utility] → [Assert] + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom. + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Services] → [Timers] → [Sleep Timer] + - [Third Party Hardware Drivers] → [Motor Control] → [TB9053FTG - DC Motor 26 Click (Mikroe)] - - [Services] → [Timers] → [Sleep Timer] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** - - [Third Party Hardware Drivers] → [Motor Control] → [TB9053FTG - DC Motor 26 Click (Mikroe)] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [PWM] → [channel_0] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Motor Control] → [TB9053FTG - DC Motor 26 Click (Mikroe)] 4. Install **printf float** - - Open **Properties** of the project. - - - Select C/C++ Build → Settings → Tool Settings → GNU ARM C Linker → General. Check **Printf float**. - ![install_float](image/install_float.png) + - Open Properties of the Project. + - Select C/C++ Build > Settings > Tool Settings >GNU ARM C Linker > General. Check Printf float. 5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension has already been installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third Party Hardware Drivers extension must be enabled for the project to install the **"TB9053FTG - DC Motor 26 Click (Mikroe)"** component. diff --git a/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/console_log.png b/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/console_log.png index bfa18521..088ccaa8 100644 Binary files a/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/console_log.png and b/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/console_log.png differ diff --git a/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/create_project.png b/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/create_project.png index b77c979d..982aa699 100644 Binary files a/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/create_project.png and b/app/documentation/example/mikroe_dcmotor26_tb9053ftg/image/create_project.png differ diff --git a/app/documentation/example/mikroe_dcmotor3_tb6549fg/README.md b/app/documentation/example/mikroe_dcmotor3_tb6549fg/README.md index 62115776..33e8ced6 100644 --- a/app/documentation/example/mikroe_dcmotor3_tb6549fg/README.md +++ b/app/documentation/example/mikroe_dcmotor3_tb6549fg/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the DC motor driver using the TB6549FG from Toshiba via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the DC motor driver using the TB6549FG from Toshiba with the Silicon Labs Platform. DC MOTOR 3 Click is a mikroBUS™ add-on board with a Toshiba TB6549FG full-bridge driver for direct current motors. The IC is capable of outputting currents of up to 3.5 A with 30V, making it suitable for high-power motors. @@ -10,26 +10,28 @@ DC MOTOR 3 Click is a mikroBUS™ add-on board with a Toshiba TB6549FG full-brid - [BGM220 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [DC Motor 3 Click](https://www.mikroe.com/dc-motor-3-click) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- If the BGM220P Explorer Kit is used: -## Hardware Connection ## + The DC Motor 3 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. -The DC Motor 3 Click board supports mikroBUS™, so it can connect easily to BGM220 Bluetooth Module Explorer Kit's header. + The hardware connection is shown in the image below: -During the assembly process, make sure that the 45-degree corner of the Click board matches the 45-degree white line of the Silicon Labs Explorer Kit. + ![board](image/hardware_connection.png) -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | DC Motor 3 Click | + | ----------- | ------------- | ------------------ | ---------------- | + | IN1 | GPIO_48 | P28 | IN1 | + | IN2 | GPIO_47 | P26 | IN2 | + | SLP | GPIO_46 | P24 | SLP | + | PWM | GPIO_7 | P20 | PWM | ## Setup ## @@ -37,16 +39,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter dc +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *dc* 2. Click **Create** button on the **Third Party Hardware Drivers - TB6549FG - DC Motor 3 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_dcmotor3_tb6549fg/app.c` into the project root folder (overwriting the existing file). @@ -58,16 +61,24 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Services] → [Timers] → [Sleep Timer]** - - **[Third Party Hardware Drivers] → [Miscellaneous] → [TB6549FG - DC MOTOR 3 Click (Mikroe)]** + **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Services] → [Timers] → [Sleep Timer] + - [Third Party Hardware Drivers] → [Miscellaneous] → [TB6549FG - DC MOTOR 3 Click (Mikroe)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [PWM] → [channel_0] → use default configuration + - [Third Party Hardware Drivers] → [Miscellaneous] → [TB6549FG - DC MOTOR 3 Click (Mikroe)] 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party drivers extension must be enabled for the project to install "TB6549FG - DC MOTOR 3 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/create_example.png b/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/create_example.png index a6129096..a7716550 100644 Binary files a/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/create_example.png and b/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/create_example.png differ diff --git a/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/log.png b/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/log.png index 9b8fe77d..9b411e61 100644 Binary files a/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/log.png and b/app/documentation/example/mikroe_dcmotor3_tb6549fg/image/log.png differ diff --git a/app/documentation/example/mikroe_e_paper_154_inch/README.md b/app/documentation/example/mikroe_e_paper_154_inch/README.md deleted file mode 100644 index d3b19231..00000000 --- a/app/documentation/example/mikroe_e_paper_154_inch/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# E-Paper display 1.54" 200x200 dots (Mikroe) # - -## Summary ## - -This project aims to show the hardware driver that is used to interface with the E-Paper display 1,54" 200x200 dots driver from Mikroe via APIs of GSDK. - -E-Paper display is based on Active Matrix Electrophoretic Display (AMEPD) technology and has an integrated pixel driver, which uses the SPI interface to communicate with the host MCU. E-Paper display has resolution of 200(V) X 200(H) pixels and an active display area of 27.6 X 27.6. The size of its square shaped pixels is 0.138mm x 0.138mm. The screen displays a clear and crisp graphics, and has an ultra-wide viewing range. Another key feature of the E-Ink technology is the extremely low power consumption, even when the display actively refresh its content. - -## Required Hardware ## - -- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) - -- [EINK CLICK - WITHOUT DISPLAY](https://www.mikroe.com/eink-click-without-display) - -- [E-Paper display 1,54" 200x200 dots](https://www.mikroe.com/e-paper-display-154-200x200-dots) - -## Hardware Connection ## - -eINK display needs an external adapter to interface with the EFR32xG24 Explorer Kit. The hardware connection is shown in the image below: - -![board](image/hardware_connection.png) - -## Setup ## - -You can either create a project based on an example project or start with an empty example project. - -### Create a project based on an example project ### - -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **E-Paper**. - -2. Click **Create** button on the **Third Party Hardware Drivers - E-Paper Display (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) - -3. Build and flash this example to the board. - -### Start with an empty example project ### - -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. - -2. Copy the file `app/example/mikroe_e_paper_154_inch/app.c` into the project root folder (overwriting the existing file). - -3. Install the software components: - - - Open the .slcp file in the project. - - - Select the SOFTWARE COMPONENTS tab. - - - Install the following components: - - - **[Third Party Hardware Drivers] → [Display & LED] → [E-Paper display 1.54" 200x200 dots (Mikroe)]** - - **[Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library]** - -4. Build and flash this example to the board. - -**Note:** - -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - -- Third-party drivers extension must be enabled for the project to install "E-Paper Display (Mikroe)" component. - -## How It Works ## - -### Testing ### - -After setting up all the required components, flash the code to the Explorer Kit and you will see the result looks like below. - -![result](image/result.png) - -## Report Bugs & Get Support ## - -To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. - -Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/mikroe_e_paper_154_inch/image/create_example.png b/app/documentation/example/mikroe_e_paper_154_inch/image/create_example.png deleted file mode 100644 index 23052624..00000000 Binary files a/app/documentation/example/mikroe_e_paper_154_inch/image/create_example.png and /dev/null differ diff --git a/app/documentation/example/mikroe_eink_display/README.md b/app/documentation/example/mikroe_eink_display/README.md new file mode 100644 index 00000000..a100ebf5 --- /dev/null +++ b/app/documentation/example/mikroe_eink_display/README.md @@ -0,0 +1,98 @@ +# E-Paper Display - eINK Click (Mikroe) # + +## Summary ## + +This project aims to show the hardware driver that is used to interface with eINK Click and E-Paper display using the Silicon Labs platform. + +E-Paper display is based on Active Matrix Electrophoretic Display (AMEPD) technology and has an integrated pixel driver, which uses the SPI interface to communicate with the host MCU. The screen displays a clear and crisp graphics, and has an ultra-wide viewing range. Another key feature of the E-Ink technology is the extremely low power consumption, even when the display actively refresh its content. + +## Required Hardware ## + +- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) + +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) + +- [EINK CLICK - WITHOUT DISPLAY](https://www.mikroe.com/eink-click-without-display) + +- [E-Paper display 1,54" 200x200 dots](https://www.mikroe.com/e-paper-display-154-200x200-dots) +- Or [E-Paper display 2,13" 122x250 dots](https://www.mikroe.com/e-paper-display-213-122x250-dots) +- Or [E-Paper display 2,9" 296x128 dots](https://www.mikroe.com/e-paper-display-29-inches) + +## Hardware Connection ## + +- If the EFR32xG24 Explorer Kit is used: + + eINK display needs an external adapter to interface with the EFR32xG24 Explorer Kit. The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | EINK CLICK - WITHOUT DISPLAY Board | + | -------------------------| ---------------| ---------------------| --------------------| + | Reset | GPIO_46 | P24 | RTS | + | Busy indicator | GPIO_47 | P26 | BSY | + | Data/Config | GPIO_48 | P28 | D/C | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | + +## Setup ## + +You can either create a project based on an example project or start with an empty example project. + +### Create a project based on an example project ### + +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **eink**. + +2. Click **Create** button on the **Third Party Hardware Drivers - E-Paper Display - eINK Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![create_project](image/create_example.png) + +3. Build and flash this example to the board. + +### Start with an empty example project ### + +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. + +2. Copy the file `app/example/mikroe_eink_display/app.c` into the project root folder (overwriting the existing file). + +3. Install the software components: + + - Open the .slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. + + - Install the following components: + + **If the EFR32xG24 Explorer Kit is used:** + + - [Third Party Hardware Drivers] → [Display & LED] → [E-Paper display 1.54" 200x200 dots (Mikroe)] + - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Third Party Hardware Drivers] → [Display & LED] → [E-Paper display 1.54" 200x200 dots (Mikroe)] + - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + +4. Build and flash this example to the board. + +**Note:** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). + +- Third-party Drivers Extension must be enabled for the project to install "E-Paper Display (Mikroe)" component. + +## How It Works ## + +### Testing ### + +After setting up all the required components, flash the code to the Explorer Kit and you will see the result looks like below. + +![result](image/result.png) + +## Report Bugs & Get Support ## + +To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. + +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/mikroe_eink_display/image/create_example.png b/app/documentation/example/mikroe_eink_display/image/create_example.png new file mode 100644 index 00000000..182c829e Binary files /dev/null and b/app/documentation/example/mikroe_eink_display/image/create_example.png differ diff --git a/app/documentation/example/mikroe_e_paper_154_inch/image/hardware_connection.png b/app/documentation/example/mikroe_eink_display/image/hardware_connection.png similarity index 100% rename from app/documentation/example/mikroe_e_paper_154_inch/image/hardware_connection.png rename to app/documentation/example/mikroe_eink_display/image/hardware_connection.png diff --git a/app/documentation/example/mikroe_e_paper_154_inch/image/result.png b/app/documentation/example/mikroe_eink_display/image/result.png similarity index 100% rename from app/documentation/example/mikroe_e_paper_154_inch/image/result.png rename to app/documentation/example/mikroe_eink_display/image/result.png diff --git a/app/documentation/example/mikroe_emg/README.md b/app/documentation/example/mikroe_emg/README.md index 810c4a74..ec7ad821 100644 --- a/app/documentation/example/mikroe_emg/README.md +++ b/app/documentation/example/mikroe_emg/README.md @@ -11,18 +11,27 @@ This sensor is often used to diagnose the health of the muscles, and the neurons ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). -- [**Mikroe EMG Click**](https://www.mikroe.com/emg-click). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) +- [**Mikroe EMG Click**](https://www.mikroe.com/emg-click) - [ECG/EMG cable](https://www.mikroe.com/ecg-cable) - [Disposable adhesive pads](https://www.mikroe.com/ecg-30pcs) ## Hardware Connection ## -The EMG Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: -The hardware connection is shown in the image below: + The EMG Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit via MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. -![hardware_connection](image/hardware_connection.png) + The hardware connection is shown in the image below: + + ![hardware_connection](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | EMG Click | + | ----------------------| ---------------| ---------------------| -------------------- | + | Positive analog input | ULP_GPIO_1 | P16 | OUT | + | Negative analog input | ULP_GPIO_7 | EXP_HEADER-15 to GND | -- | The electrodes are connected to the board with a cable that plugs into the onboard 3.5mm phone jack. @@ -30,14 +39,17 @@ The electrodes are connected to the board with a cable that plugs into the onboa You can either create a project based on an example project or start with an empty example project. -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter **"emg"**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"emg"**. + +2. Click **Create** button on **Third Party Hardware Drivers - EMG Click (Mikroe)**. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -2. Click **Create** button on the **Third Party Hardware Drivers - EMG Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](image/create_example.png) + ![create_project](image/create_example.png) + +3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_emg/app.c` into the project root folder (overwriting the existing file). @@ -47,18 +59,25 @@ You can either create a project based on an example project or start with an emp - Select the SOFTWARE COMPONENTS tab. - - Install the following components: + - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom** - [Application] → [Utility] → [Log] - [Services] → [Timers] → [Sleep Timer] - [Third Party Hardware Drivers] → [Sensors] → [EMG Click (Mikroe)] → use the default configuration. + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration + - [Third Party Hardware Drivers] → [Sensors] → [EMG Click (Mikroe)] + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install the "EMG Click (Mikroe)" component. Selecting this component will also include the "IADC" component. diff --git a/app/documentation/example/mikroe_emg/image/create_example.png b/app/documentation/example/mikroe_emg/image/create_example.png index 4ea20dfa..15998905 100644 Binary files a/app/documentation/example/mikroe_emg/image/create_example.png and b/app/documentation/example/mikroe_emg/image/create_example.png differ diff --git a/app/documentation/example/mikroe_environment2_sht40_sgp40/README.md b/app/documentation/example/mikroe_environment2_sht40_sgp40/README.md index d8a8b79b..f14bc9b9 100644 --- a/app/documentation/example/mikroe_environment2_sht40_sgp40/README.md +++ b/app/documentation/example/mikroe_environment2_sht40_sgp40/README.md @@ -2,19 +2,32 @@ ## Summary ## -This project shows the implementation of Environment-sensor driver using SHT40 & SGP40 from Mikroe Integrated with EFR32xG24 Explorer Kit based on I2C communication. +This project shows the implementation of Environment-sensor driver using SHT40 & SGP40 from Mikroe Integrated with Silicon Labs platform based on I2C communication. ## Required Hardware ## - [**BRD2703A-EFR32xG24** EFR32xG24 Bluetooth Module Explorer Kit (BRD2703A-EFR32xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [**Environment 2 Click** board based on SHT40 & SGP40 from Mikroe Integrated](https://www.mikroe.com/environment-2-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [**Environment 2 Click** board based on SHT40 & SGP40 from Mikroe Integrated](https://www.mikroe.com/environment-2-click) ## Hardware Connection ## -The Environment 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. The board also has the I2C-bus pull-ups. Just be sure that the click board is configured into I2C-mode (the default) by the resistors and not into SPI-mode. +- If the EFR32xG24 Explorer Kit is used: + + The Environment 2 Click board supports MikroBus, so it can connect easily to Explorer Kit via MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. The board also has the I2C-bus pull-ups. Just be sure that the click board is configured into I2C-mode (the default) by the resistors and not into SPI-mode. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png "EFR32xG24 Explorer Kit Board and Environment 2 Click Board") + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png "EFR32xG24 Explorer Kit Board and Environment 2 Click Board") + | Description | BRD4338A GPIO | BRD4002 EXP Header | Temp&Hum 9 Click | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -22,16 +35,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter: 'sht40', 'sgp40'. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by 'sht40' and 'sgp40'. 2. Click **Create** button on the **Third Party Hardware Drivers - SHT40 & SGP40 - Environment 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_environment2_sht40_sgp40/app.c` into the project root folder (overwriting existing file). @@ -43,23 +57,32 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] → [Sensors] → [SHT40 & SGP40 - Environment 2 Click (Mikroe)] + - [Third Party Hardware Drivers] → [Sensors] → [SHT40 & SGP40 - Environment 2 Click (Mikroe)] → using default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [SHT40 & SGP40 - Environment 2 Click (Mikroe)] → using default configuration 4. Install printf float - Open Properties of the project. - Select C/C++ Build → Settings → Tool Settings → GNU ARM C Linker → General. Check Printf float. -![float](image/float.png) + + ![float](image/float.png) 5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "SHT40 & SGP40 - Environment 2 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_environment2_sht40_sgp40/image/create_example.png b/app/documentation/example/mikroe_environment2_sht40_sgp40/image/create_example.png index e4de2b36..4f79e8a2 100644 Binary files a/app/documentation/example/mikroe_environment2_sht40_sgp40/image/create_example.png and b/app/documentation/example/mikroe_environment2_sht40_sgp40/image/create_example.png differ diff --git a/app/documentation/example/mikroe_environment2_sht40_sgp40/image/log.png b/app/documentation/example/mikroe_environment2_sht40_sgp40/image/log.png index c60436e2..52a3e2fe 100644 Binary files a/app/documentation/example/mikroe_environment2_sht40_sgp40/image/log.png and b/app/documentation/example/mikroe_environment2_sht40_sgp40/image/log.png differ diff --git a/app/documentation/example/mikroe_environment3_bme688/README.md b/app/documentation/example/mikroe_environment3_bme688/README.md index 1e720363..bd75015b 100644 --- a/app/documentation/example/mikroe_environment3_bme688/README.md +++ b/app/documentation/example/mikroe_environment3_bme688/README.md @@ -2,24 +2,46 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the BME688 Sensor via APIs of GSDK. This driver is based on [BME68x Sensor API](https://github.com/BoschSensortec/BME68x-Sensor-API) from Bosch Sensortec. +This project aims to show the hardware driver that is used to interface with the BME688 Sensor using the Silicon Labs platform. This driver is based on [BME68x Sensor API](https://github.com/BoschSensortec/BME68x-Sensor-API) from Bosch Sensortec. BME688 is a first gas sensor with Artificial Intelligence (AI), and integrated high-linearity/high-accuracy pressure, humidity, and temperature sensors from Bosch Sensortec. The BME688 can be used for indoor and outdoor air quality measurement, detection of unusual gases and smells, and various temperature and humidity-related applications. For more information, see [Gas Sensor BME688](https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme688/). ## Required Hardware ## -- [**BRD2703A-EFR32xG24** EFR32xG24 Bluetooth Module Explorer Kit (BRD2703A-EFR32xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) - -- [**Environment 3 Click** board based on BME688 from Mikroe Integrated](https://www.mikroe.com/environment-3-click). +- [**BRD2703A-EFR32xG24** EFR32xG24 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [**Environment 3 Click** board based on BME688 from Mikroe Integrated](https://www.mikroe.com/environment-3-click) ## Hardware Connection ## -The Environment 3 Click board supports MikroBus; therefore, it can connect easily to the MikroBus header of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. +- **If the EFR32xG24 Explorer Kit is used**: + + The Environment 3 Click board supports MikroBus; therefore, it can connect easily to the MikroBus header of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png "BGM220 Explorer Kit Board and Environment 3 Click Board") + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + + **- If using I2C interface:** + + | Description | BRD4338A GPIO | BRD4002 EXP Header | Environment 3 Click Board | + | -------------| ------------- | ------------------ | ------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | -The hardware connection is shown in the image below: + **- If using SPI interface:** -![board](image/hardware_connection.png "BGM220 Explorer Kit Board and Environment 3 Click Board") + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Environment 3 Click Board | + | -------------------------| ------------- | -------------------- | ------------------------- | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -27,7 +49,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter 'bme688'. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by 'bme688'. 2. Click **Create** button on the example: @@ -35,14 +57,15 @@ You can either create a project based on an example project or start with an emp - **Third Party Hardware Drivers - BME688 - Environment 3 Click (Mikroe) - SPI** if using the SPI interface. - Example project creation dialog pops up -> click Create and Finish and Project should be generated. - ![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) + + - Example project creation dialog pops up -> click Create and Finish and Project should be generated. 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_environment3_bme688/app.c` into the project root folder (overwriting the existing file). @@ -54,13 +77,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - If using the SPI interface: - - [Third Party Hardware Drivers] → [Sensors] → [BME688 - Environment 3 Click (Mikroe) - SPI] - - If using the I2C interface: - - [Third Party Hardware Drivers] → [Sensors] → [BME688 - Environment 3 Click (Mikroe) - I2C] + - **If the EFR32xG24 Explorer Kit is used** + + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + + If using I2C interface: + - [Platform] → [Driver] → [I2C] → [I2CSPM] → [mikroe instance] + - [Third Party Hardware Drivers] → [Sensors] → [BME688 - Environment 3 Click (Mikroe) - I2C] → use default configuration + + If using SPI interface: + - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe instance] + - [Third Party Hardware Drivers] → [Sensors] → [BME688 - Environment 3 Click (Mikroe) - SPI] → use default configuration + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + If using I2C interface: + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [BME688 - Environment 3 Click (Mikroe) - I2C] → use default configuration + + If using I2C interface: + - [Third Party Hardware Drivers] → [Sensors] → [BME688 - Environment 3 Click (Mikroe) - SPI] → use the default configuration 4. Install printf float @@ -72,14 +109,14 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension has already be installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third-party drivers extension must be enabled for the project to install "BME688 - Environment 3 Click (Mikroe)" component. +- Third-party drivers extension must be enabled for the project to install "BME688 - Environment 3 Click (Mikroe)" component ## How It Works ## -The application reads the temperature, humidity, pressure, and gas resistance data from the sensor in the forced mode and displays all values on the USART every 2 seconds. -You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. A screenshot of the console output is shown in the figure below. +After you flash the code to your board and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that your board uses the default baud rate of 115200. +In the image below you can see an example of how the output is displayed. The application reads the temperature, humidity, pressure, and gas resistance data from the sensor in the forced mode and displays all values on the console. There is a periodic timer in the code, which determines the sampling intervals; the default sensor sampling rate is 2000 ms. If you need more frequent sampling, it is possible to change the corresponding timer value of the "app.c" file. ![usb_debug](image/log.png "USB Debug Output Data") diff --git a/app/documentation/example/mikroe_environment3_bme688/image/create_example.png b/app/documentation/example/mikroe_environment3_bme688/image/create_example.png index 1827ce1e..2e8db525 100644 Binary files a/app/documentation/example/mikroe_environment3_bme688/image/create_example.png and b/app/documentation/example/mikroe_environment3_bme688/image/create_example.png differ diff --git a/app/documentation/example/mikroe_eth_wiz_w5500/README.md b/app/documentation/example/mikroe_eth_wiz_w5500/README.md index b16641fa..d8127bb0 100644 --- a/app/documentation/example/mikroe_eth_wiz_w5500/README.md +++ b/app/documentation/example/mikroe_eth_wiz_w5500/README.md @@ -8,23 +8,32 @@ W5500 enables users to have the Internet connectivity in their applications just The board can be used for industrial automation systems, IP set-top boxes, VoIP/Video phone systems, security systems, home networks and gateways and test and measurement equipment and for many other applications. -ETH Wiz Click board™ communicates with the target microcontroller over SPI interface that corresponds to the pinout on the mikroBUS™ socket as shown below. +## Required Hardware ## -![mikroBus](image/mikrobus.png) +- [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [A ETH WIZ Click](https://www.mikroe.com/eth-wiz-click) +- A Ethernet Cable, e.g. [Ethernet Roll Cable](https://www.mikroe.com/ethernet-roll-transparent) -## Required Hardware ## +## Hardware Connection ## -- [A BGM220P Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- **If the BGM220P Explorer Kit is used:** -- [A ETH WIZ Click.](https://www.mikroe.com/eth-wiz-click) + The ETH WIZ Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the BGM220P Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: -- A Ethernet Cable, e.g. [Ethernet Roll Cable](https://www.mikroe.com/ethernet-roll-transparent). + ![board](image/board.png) -## Hardware Connection ## +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -The ETH Wiz click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + The hardware connection is shown in the table below: -![board](image/board.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | The ETH WIZ Click board | + | -------------| ------------- | -------------------- | ---------------------------| + | GPIO_RESET | GPIO_46 | P24 | RESET | + | GPIO_CS | GPIO_47 | P26 | CS | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | ## Setup ## @@ -32,16 +41,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter W5500. +1. From the Launcher Home, add the your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "w5500". 2. Click **Create** button on the **Third Party Hardware Drivers - W5500 - ETH Wiz Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) + + ![create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create a "Platform - Empty C Project" project for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. Be sure to connect and select the BGM220 Explorer Kit Board from the "Debug Adapters" on the left before creating a project. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_eth_wiz_w5500/app.c` into the project root folder (overwriting the existing file). @@ -53,18 +63,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [IO Stream] → [IO Stream: EUSART] with the default instance name: **vcom**. - - [Services] → [Timers] → [Sleep Timer]. - - [Application] → [Utility] → [Log]. - - [Application] → [Utility] → [Assert]. - - [Third Party Hardware Drivers] → [Interface] → [W5500 - ETH WIZ Click (Mikroe)] → use the default configuration. - ![config](image/w5500_config.png) - + **If the BGM220P Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: EUSART] with the default instance name: **vcom** + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe] → change the configuration for [SPI master chip select (CS) control scheme] to "CS controlled by the application" and select the CS pin to None as below: + + ![spi config](image/spi_config.png) + + - [Third Party Hardware Drivers] → [Interface] → [W5500 - ETH WIZ Click (Mikroe)] → use the default configuration + + ![config](image/w5500_config.png) + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Third Party Hardware Drivers] → [Interface] → [W5500 - ETH WIZ Click (Mikroe)] → use the default configuration + - [Application] → [Utility] → [Assert] + 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **W5500 - ETH WIZ Click (Mikroe)** component. @@ -114,7 +133,7 @@ The following diagram shows the program flow as implemented in the file `app.c`: ![Work Flow](image/flow.png) -Use a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like PuTTY to receive the logs from the virtual COM port. You should expect a similar output to the one below. +Use a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like PuTTY to receive the logs from the virtual COM port. Note that the board uses the default baud rate of 115200. You should expect a similar output to the one below. ![log](image/log.png) diff --git a/app/documentation/example/mikroe_eth_wiz_w5500/image/mikrobus.png b/app/documentation/example/mikroe_eth_wiz_w5500/image/mikrobus.png deleted file mode 100644 index 3c5cd394..00000000 Binary files a/app/documentation/example/mikroe_eth_wiz_w5500/image/mikrobus.png and /dev/null differ diff --git a/app/documentation/example/mikroe_eth_wiz_w5500/image/spi_config.png b/app/documentation/example/mikroe_eth_wiz_w5500/image/spi_config.png new file mode 100644 index 00000000..febf8543 Binary files /dev/null and b/app/documentation/example/mikroe_eth_wiz_w5500/image/spi_config.png differ diff --git a/app/documentation/example/mikroe_eth_wiz_w5500/image/w5500_config.png b/app/documentation/example/mikroe_eth_wiz_w5500/image/w5500_config.png index 883a58d0..492b7a86 100644 Binary files a/app/documentation/example/mikroe_eth_wiz_w5500/image/w5500_config.png and b/app/documentation/example/mikroe_eth_wiz_w5500/image/w5500_config.png differ diff --git a/app/documentation/example/mikroe_fingerprint2_a172mrq/README.md b/app/documentation/example/mikroe_fingerprint2_a172mrq/README.md index 13d88d34..9dd55b78 100644 --- a/app/documentation/example/mikroe_fingerprint2_a172mrq/README.md +++ b/app/documentation/example/mikroe_fingerprint2_a172mrq/README.md @@ -10,16 +10,31 @@ The board also includes some features such as the ability to store and match up ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). -- [**Fingerprint 2 Click** board based on A-172-MRQ](https://www.mikroe.com/fingerprint-2-click). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [**Fingerprint 2 Click** board based on A-172-MRQ](https://www.mikroe.com/fingerprint-2-click) ## Hardware Connection ## -The Fingerprint 2 Click supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: -The hardware connection is shown in the image below: + The Fingerprint 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. -![board](image/hardware_connection.png) + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Fingerprint 2 click | + | ----------------- | ------------------------ | -------------------- | ----------- | + | UART1_RX_PIN | GPIO_6 | P19 | TX | + | UART1_TX_PIN | GPIO_7 | P20 | RX | + | RESET | GPIO_46 | P24 | RST | + | Compare indicator | GPIO_47 | P26 | LD1 | + | Compare indicator | GPIO_48 | P28 | LD2 | + | General Purpose | GPIO_49 | P30 | GP1 | + | General Purpose | GPIO_50 | P32 | GP2 | ## Setup ## @@ -27,14 +42,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **fingerprint**. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *fingerprint*. + 2. Click **Create** button on the **Third Party Hardware Drivers - A-172-MRQ - Fingerprint 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) + +3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_fingerprint2_a172mrq/app.c` into the project root folder (overwriting existing file). @@ -46,27 +64,26 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: **vcom** - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **mikroe** - [Third Party Hardware Drivers] → [Human Machine Interface] → [A-172-MRQ - Fingerprint 2 Click (Mikroe)] → use default configuration - - | Mikroe pin | BRD2703A pin | - |:----------|:------------------:| - | A172MRQ_GP1 | PC00 | - | A172MRQ_GP2 | PA00 | - | A172MRQ_LD1 | PB00 | - | A172MRQ_LD2 | PB01 | - | A172MRQ_RESET | PC08 | - - [Application] → [Utility] → [Assert] - [Application] → [Utility] → [Log] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [MM5D91-00 - Radar Click (Mikroe)] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [UART] → disable "UART1 DMA" + 4. Build and flash this example to the board. **Note :** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "A-172-MRQ - Fingerprint 2 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_fingerprint2_a172mrq/image/create_example.png b/app/documentation/example/mikroe_fingerprint2_a172mrq/image/create_example.png index e88141ad..dba5fad6 100644 Binary files a/app/documentation/example/mikroe_fingerprint2_a172mrq/image/create_example.png and b/app/documentation/example/mikroe_fingerprint2_a172mrq/image/create_example.png differ diff --git a/app/documentation/example/mikroe_force3_fsr400/README.md b/app/documentation/example/mikroe_force3_fsr400/README.md index 5fcf40a8..05cc884e 100644 --- a/app/documentation/example/mikroe_force3_fsr400/README.md +++ b/app/documentation/example/mikroe_force3_fsr400/README.md @@ -18,24 +18,26 @@ The sensor is placed in a voltage divider configuration with a fixed resistor R2 - [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [**Force 3 Click** board based on FSR 400 sensor](https://www.mikroe.com/force-3-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [**Force 3 Click** board based on FSR 400 sensor](https://www.mikroe.com/force-3-click) ## Hardware Connection ## -The Force 3 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. +- If the BGM220P Explorer Kit is used: + + The Force 3 Click board supports MikroBus, so it can connect easily to Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | Force 3 Click | + | -------------| ------------- | ------------------ | ----------------| + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -43,16 +45,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "force". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *force*. 2. Click **Create** button on the **Third Party Hardware Drivers - FSR400 - Force 3 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file 'app/example/mikroe_force3_fsr400/app.c' into the project root folder (overwriting the existing file). @@ -64,22 +67,30 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Third Party Hardware Drivers] → [Sensors] → [FSR 400 - Force 3 Click (Mikroe)] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [FSR 400 - Force 3 Click (Mikroe)] + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Drivers Extension must be enabled for the project to install "FSR 400 - Force 3 Click (Mikroe)" component. ## How It Works ## -After you flashed the code to the Explorer Kit and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the BGM220P board uses the default baud rate of 115200. +After you flashed the code to the your board and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the BGM220P board uses the default baud rate of 115200. In the below image, you can see an example of how the output is displayed. The main program reads the raw ADC value from the sensor. Then convert it to the relative pressure on the sensor. diff --git a/app/documentation/example/mikroe_force3_fsr400/image/create_example.png b/app/documentation/example/mikroe_force3_fsr400/image/create_example.png index 53714074..b5ce83d4 100644 Binary files a/app/documentation/example/mikroe_force3_fsr400/image/create_example.png and b/app/documentation/example/mikroe_force3_fsr400/image/create_example.png differ diff --git a/app/documentation/example/mikroe_gps_lea6s/README.md b/app/documentation/example/mikroe_gps_lea6s/README.md index 4703c7db..7141040f 100644 --- a/app/documentation/example/mikroe_gps_lea6s/README.md +++ b/app/documentation/example/mikroe_gps_lea6s/README.md @@ -9,13 +9,28 @@ GPS click is a compact solution for adding GPS functionality to your device. It - [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [**GPS Click** board based on LEA-6S from Mikroe Integrated](https://www.mikroe.com/gps-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [**GPS Click** board based on LEA-6S from Mikroe Integrated](https://www.mikroe.com/gps-click) + +- Option: [GPS/GNSS Magnetic Mount Antenna](https://www.sparkfun.com/products/14986) ## Hardware Connection ## -The GPS Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. The GPS antenna needs to be connected to the GPS click board to ensure that the satellite signals can be received. +- If the BGM220 Explorer Kit is used: + + The GPS Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. The GPS antenna needs to be connected to the GPS click board to ensure that the satellite signals can be received. -![board](image/hardware_connection.png "BGM220 Explorer Kit Board and GPS Click Board") + ![board](image/hardware_connection.png "BGM220 Explorer Kit Board and GPS Click Board") + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | GPS click | + | ------------ | --------------- | -------------------- | ----------- | + | UART1_RX_PIN | GPIO_6 | P19 | TX | + | UART1_TX_PIN | GPIO_7 | P20 | RX | + | RESET | GPIO_46 | P24 | RST | + | Time Pulse | GPIO_47 | P26 | TP | ## Setup ## @@ -23,16 +38,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter 'gps'. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *gps*. 2. Click **Create** button on the **Third Party Hardware Drivers - LEA-6S - GPS Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220P Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_gpsclick_lea6s/app.c` into the project root folder (overwriting the existing file). @@ -44,18 +60,31 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: mikroe → Set "Baud rate" to 9600 + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: mikroe - [Application] → [Utility] → [Log] - [Application] → [Utility] → [Application Queue] - [Third Party Hardware Drivers] → [Sensors] → [LEA-6S - GPS Click (Mikroe)] -4. Build and flash this example to the board. + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [LEA-6S - GPS Click (Mikroe)] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [UART] → disable "UART1 DMA" + +4. Install printf float + + - Open Properties of the project. + - Select C/C++ Build > Settings > Tool Settings >GNU ARM C Linker > General. Check Printf float. + +5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "LEA-6S - GPS Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_gps_lea6s/image/create_example.png b/app/documentation/example/mikroe_gps_lea6s/image/create_example.png index 64af5e09..5e7cef76 100644 Binary files a/app/documentation/example/mikroe_gps_lea6s/image/create_example.png and b/app/documentation/example/mikroe_gps_lea6s/image/create_example.png differ diff --git a/app/documentation/example/mikroe_heartrate2_maxm86161/README.md b/app/documentation/example/mikroe_heartrate2_maxm86161/README.md index 03f1297d..a43d227c 100644 --- a/app/documentation/example/mikroe_heartrate2_maxm86161/README.md +++ b/app/documentation/example/mikroe_heartrate2_maxm86161/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project shows the implementation of Bio-sensor driver using Maxm86161 from Maxim Integrated with BGM220 Explorer Kit based on I2C communication. +This project shows the implementation of Bio-sensor driver using Maxm86161 from Maxim Integrated with the Silicon Labs platform based on I2C communication. Heart Rate 2 Click board™ is an add-on board based on MAXM86161 integrated optical module from Analog Devices (AD). It is a complete, integrated, optical data acquisition system, ideal for optical pulse-oximetry (SpO2) and heart-rate (HR) detection applications. It can be implemented in various wearable health-related devices, like optimized for in-ear applications, or miniature package for mobile applications. @@ -10,13 +10,28 @@ Heart Rate 2 Click board™ is an add-on board based on MAXM86161 integrated opt - [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [**Heart Rate 2 Click** board based on MAXM86161 from Maxim Integrated](https://www.mikroe.com/heart-rate-2-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [**Heart Rate 2 Click** board based on MAXM86161 from Maxim Integrated](https://www.mikroe.com/heart-rate-2-click) ## Hardware Connection ## -The Heart Rate 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. The board also has the I2C-bus pull-ups. Just be sure that the click board is configured into I2C-mode (the default) by the resistors and not into SPI-mode. +- If the BGM220P Explorer Kit is used: + + The Heart Rate 2 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + The board also has the I2C-bus pull-ups. Just be sure that the click board is configured into I2C-mode (the default) by the resistors and not into SPI-mode. + + ![board](image/hardware_connection.png "BGM220 Explorer Kit Board and Heart Rate 2 Click Board") -![board](image/hardware_connection.png "BGM220 Explorer Kit Board and Heart Rate 2 Click Board") +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout/ EXP Header | Heartrate 2 Click | + | ----------------| ------------- | ---------------------------- | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | General Purpose | GPIO_46 | P24 | GP | + | Enable Input | GPIO_47 | P26 | EN | + | Interrupt | GPIO_48 | P28 | INT | ## Setup ## @@ -24,16 +39,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter maxm86161. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *maxm86161*. 2. Click **Create** button on the **Third Party Hardware Drivers - MAXM86161 - Heartrate 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_heartrate2_maxm86161/app.c` into the project root folder (overwriting existing file). @@ -45,16 +61,24 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Third Party Hardware Drivers] → [Sensors] → [MAXM86161 - Heart Rate 2 Click (Mikroe)] -> use default configuration + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [MAXM86161 - Heart Rate 2 Click (Mikroe)] -> use default configuration + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "MAXM86161 - Heart Rate 2 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_heartrate2_maxm86161/image/create_example.png b/app/documentation/example/mikroe_heartrate2_maxm86161/image/create_example.png index b6a53c56..ac10cec3 100644 Binary files a/app/documentation/example/mikroe_heartrate2_maxm86161/image/create_example.png and b/app/documentation/example/mikroe_heartrate2_maxm86161/image/create_example.png differ diff --git a/app/documentation/example/mikroe_heartrate4_max30101/README.md b/app/documentation/example/mikroe_heartrate4_max30101/README.md index 7f1985e3..ec411f2b 100644 --- a/app/documentation/example/mikroe_heartrate4_max30101/README.md +++ b/app/documentation/example/mikroe_heartrate4_max30101/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the heart rate sensor via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the heart rate sensor with the Silicon Labs Platform. Heart rate 4 click carries the MAX30101 high-sensitivity pulse oximeter and heart-rate sensor from Analog Devices. The MAX30101 is a pulse oximeter and heart rate sensor that uses a combination of red and infrared LEDs and a photodetector to measure the oxygen saturation of blood and the heart rate of a person. The sensor is non-invasive, and it can be placed on the fingertip, earlobe, or other parts of the body to measure the heart rate and oxygen saturation. The sensor provides a high level of accuracy, and it can be used in a wide range of applications such as medical monitoring, sports and fitness tracking, and sleep analysis. The MAX30101 sensor communicates with other devices using I2C interface and it is also low power consumption making it suitable for portable devices and wearables. @@ -10,15 +10,27 @@ Heart rate 4 click carries the MAX30101 high-sensitivity pulse oximeter and hear - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [Heart Rate 4 Click](https://www.mikroe.com/heart-rate-4-click). ## Hardware Connection ## -The Heart Rate 4 Click board support MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the Explorer Kit is used: + + The Heart Rate 4 Click board supports MikroBus, so it can connect easily to the header of the Explorer Kit. During the assembly process, make sure that the 45-degree corner of the Click board matches the 45-degree white line of the Silicon Labs Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png "Hardware connection") -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png "Hardware connection") + | Description | BRD4338A GPIO | BRD4002 EXP Header | Heart Rate 4 Click | + | ----------- | ------------- | ------------------ | ------------------ | + | INT | GPIO_46 | P24 | INT | + | SDA | ULP_GPIO_6 | EXP_16 | SDA | + | SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -26,16 +38,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter max30101 +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *max30101* 2. Click **Create** button on the **Third Party Hardware Drivers - MAX30101 - Heart Rate 4 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_heartrate4_max30101/app.c` into the project root folder (overwriting the existing file). @@ -47,20 +60,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Platform] → [Driver] → [GPIOINT]** - - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - - **[Services] → [Timers] → [Sleep Timer]** - - **[Application] → [Utility] → [Log]** - - **[Third Party Hardware Drivers] → [Sensors] → [MAX30101 - Heart Rate 4 Click (Mikroe)]** -> use default configuration. + **If the Explorer Kit is used:** + + - [Platform] → [Driver] → [GPIOINT] + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Services] → [Timers] → [Sleep Timer] + - [Application] → [Utility] → [Log] + - [Third Party Hardware Drivers] → [Sensors] → [MAX30101 - Heart Rate 4 Click (Mikroe)] -> use default configuration. ![config](image/default_config.png) + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [MAX30101 - Heart Rate 4 Click (Mikroe)] -> use default configuration. + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "MAX30101 - Heart Rate 4 Click (Mikroe)" component. +- Third-party Drivers Extension extension must be enabled for the project to install "MAX30101 - Heart Rate 4 Click (Mikroe)" component. ## How It Works ## diff --git a/app/documentation/example/mikroe_heartrate4_max30101/image/create_example.png b/app/documentation/example/mikroe_heartrate4_max30101/image/create_example.png index fe5d50bb..b2a3dc5c 100644 Binary files a/app/documentation/example/mikroe_heartrate4_max30101/image/create_example.png and b/app/documentation/example/mikroe_heartrate4_max30101/image/create_example.png differ diff --git a/app/documentation/example/mikroe_heartrate4_max30101/image/default_config.png b/app/documentation/example/mikroe_heartrate4_max30101/image/default_config.png index 6c20e6ab..56b97082 100644 Binary files a/app/documentation/example/mikroe_heartrate4_max30101/image/default_config.png and b/app/documentation/example/mikroe_heartrate4_max30101/image/default_config.png differ diff --git a/app/documentation/example/mikroe_heartrate4_max30101/image/log.png b/app/documentation/example/mikroe_heartrate4_max30101/image/log.png index 0aa9db30..b2a90890 100644 Binary files a/app/documentation/example/mikroe_heartrate4_max30101/image/log.png and b/app/documentation/example/mikroe_heartrate4_max30101/image/log.png differ diff --git a/app/documentation/example/mikroe_hvac_bundle_scd41_sps30/README.md b/app/documentation/example/mikroe_hvac_bundle_scd41_sps30/README.md index f283fe47..de0dfb8f 100644 --- a/app/documentation/example/mikroe_hvac_bundle_scd41_sps30/README.md +++ b/app/documentation/example/mikroe_hvac_bundle_scd41_sps30/README.md @@ -2,34 +2,41 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the HVAC Bunble Click including SCD41 carbon dioxide sensor and SPS30 optical particle sensor via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the HVAC Bunble Click including SCD41 carbon dioxide sensor and SPS30 optical particle sensor using Silicon Labs platform. -The HVAC Click contains SCD41 sensor a carbon dioxide sensor built on the photoacoustic sensing principle. On-chip signal compensation is realized with the built-in humidity and temperature sensor. It operates within a specified range from 400 to 5’000 ppm, configurable through the I2C interface with a single shot mode supported. This Click board™ is also suitable for indoor air quality applications using an additional SPS30 that allows smart ventilation systems to regulate ventilation in the most energy-efficient and human-friendly way, maintaining low CO2 concentration for a healthy, productive environment. The Sensirion Particulate Matter Sensor SPS30 is a compact, high-quality, optical particle sensor that uses laser scattering and Sensirion's innovative contamination resistance technology to achieve superior binning and particle measurement. This sensor allows users to measure mass concentration and number of particles of 1 µg/m^3, 2.5 µg/m^3, 4 µg/m^3, and 10 µg/m^3. +This driver has the related drivers, which may be worth reading before. Find them here: + +- [SCD41 - HVAC Click (Mikroe)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/app/documentation/example/mikroe_hvac_scd41) +- [SPS30 - Particulate Matter Sensor (Sparkfun) - I2C](https://github.com/SiliconLabs/third_party_hw_drivers_extension/tree/master/app/documentation/example/sparkfun_particulate_matter_sensor_sps30) ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) + +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -- [**HVAC Click** board based on SCD41 sensor](https://www.mikroe.com/hvac-click). +- [**HVAC Click** board based on SCD41 sensor](https://www.mikroe.com/hvac-click) - [**SPS30** - Particulate Matter Sensor](https://www.sparkfun.com/products/15103) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## + +- **If the EFR32xG24 Explorer Kit is used**: -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | + The HVAC Click board supports MikroBus, so it can connect easily to the MikroBus header of the Explorer Kit. Be sure that the 45-degree corner of the Click Board matches the 45-degree white line of the Silicon Labs Explorer Kit. The Click board also has extra connector to connect with the Particulate Matter Sensor SPS30. -## Hardware Connection ## + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) -The HVAC Click board supports MikroBus, so it can connect easily to the MikroBus header of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. The Click board™ also has extra connector to connect with the Particulate Matter Sensor SPS30. +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -The hardware connection is shown in the image below: + The hardware connection is shown in the table below: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | HVAC Click board | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -37,18 +44,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "bundle". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "bundle". 2. Click **Create** button on the **Third Party Hardware Drivers - SCD41 & SPS30 - HVAC Click Bundle (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file 'app/example/mikroe_hvac_bundle_scd41_sps30/app.c' into the project root folder (overwriting the existing file). +2. Copy the file `app/example/mikroe_hvac_bundle_scd41_sps30/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: @@ -58,11 +66,18 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - [Application] → [Utility] → [Assert] - - [Third Party Hardware Drivers] → [Sensors] → [SCD41 & SPS30 - HVAC Click Bundle (Mikroe)] + - **If the Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Third Party Hardware Drivers] → [Sensors] → [SCD41 & SPS30 - HVAC Click Bundle (Mikroe)] + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [SCD41 & SPS30 - HVAC Click Bundle (Mikroe)] 4. Install printf float @@ -76,20 +91,18 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension is already installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Drivers Extension must be enabled for the project to install the "SCD41 & SPS30 - HVAC Click Bundle (Mikroe)" component. ## How It Works ## -After you flash the code to the Explorer Kit and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the EFR32xG24 Explorer Kit board uses the default baud rate of 115200. - -In the image below you can see an example of how the output is displayed. After initializing, the program will measure the Carbon Dioxide concentration, temperature, relative humidity, and other particle concentrations such as (pm1.0, pm2.5, pm4.0, pm10.0 ...). - -There is a periodic timer in the code, which determines the sampling intervals; the default sensor sampling rate is 5000 ms. If you need more frequent sampling, it is possible to change the corresponding timer value of the "app.c" file. +After initializing, the program will measure the Carbon Dioxide concentration, temperature, relative humidity, and other particle concentrations such as (pm1.0, pm2.5, pm4.0, pm10.0 ...). Use Putty/Tera Term (or another program) to read the values of the serial output. You should expect a similar output to the one below. ![logging_screen](image/log.png) +There is a periodic timer in the code, which determines the sampling intervals; the default sensor sampling rate is 5000 ms. If you need more frequent sampling, it is possible to change the corresponding timer value of the `app.c` file. + ## Report Bugs & Get Support ## To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. diff --git a/app/documentation/example/mikroe_hvac_scd41/README.md b/app/documentation/example/mikroe_hvac_scd41/README.md index a90bdb08..9268d9d0 100644 --- a/app/documentation/example/mikroe_hvac_scd41/README.md +++ b/app/documentation/example/mikroe_hvac_scd41/README.md @@ -10,26 +10,28 @@ The HVAC Click is a compact add-on device containing next generation miniature C ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [EFR32xG24-EK2703A EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [HVAC Click board based on SCD41 sensor](https://www.mikroe.com/hvac-click) -- [**HVAC Click** board based on SCD41 sensor](https://www.mikroe.com/hvac-click). +## Hardware Connection ## -**NOTE:** -Tested boards for working with this example: +- **If the EFR32xG24 Explorer Kit is used**: -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | + The HVAC Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. -## Hardware Connection ## + The hardware connection is shown in the image below: -The HVAC Click board supports MikroBus, so it can connect easily to the MikroBus header of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. + ![board](image/hardware_connection.png) -The hardware connection is shown in the image below: +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -![board](image/hardware_connection.png) + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | HVAC Click board | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -37,18 +39,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "scd41". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *scd41*. 2. Click **Create** button on the **Third Party Hardware Drivers - SCD41 - HVAC Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file 'app/example/mikroe_hvac_scd41/app.c' into the project root folder (overwriting the existing file). +2. Copy the file `app/example/mikroe_hvac_scd41/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: @@ -58,16 +61,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] → [Sensors] → [SCD41 - HVAC Click (Mikroe)] + - **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Third Party Hardware Drivers] → [Sensors] → [SCD41 - HVAC Click (Mikroe)] + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [SCD41 - HVAC Click (Mikroe)] + +4. Install "Printf float" + + - Open Properties of the project. + - Select C/C++ Build > Settings > Tool Settings > GNU ARM C Linker > General > Check "Printf float". -4. Build and flash this example to the board. +5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension is already installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Drivers Extension must be enabled for the project to install "SCD41 - HVAC Click (Mikroe)" component. @@ -76,7 +90,7 @@ You can either create a project based on an example project or start with an emp Driver Layer Diagram is shown in the image below: ![driver_layer](image/driver_layer.png) -After you flash the code to the Explorer Kit and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the EFR32xG24 Explorer Kit board uses the default baud rate of 115200. +After you flash the code to your board and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that your board uses the default baud rate of 115200. In the image below you can see an example of how the output is displayed. The main program first performs a factory reset of the sensor and reads the serial number and feature set version. The main program continuously activates single shot measurements and receives measured values ​​(CO2 concentration, temperature and relative humidity). diff --git a/app/documentation/example/mikroe_hvac_scd41/image/create_example.png b/app/documentation/example/mikroe_hvac_scd41/image/create_example.png index 9a53e7eb..b350c358 100644 Binary files a/app/documentation/example/mikroe_hvac_scd41/image/create_example.png and b/app/documentation/example/mikroe_hvac_scd41/image/create_example.png differ diff --git a/app/documentation/example/mikroe_irthermo3_mlx90632/README.md b/app/documentation/example/mikroe_irthermo3_mlx90632/README.md index f79dbc31..6310d0d8 100644 --- a/app/documentation/example/mikroe_irthermo3_mlx90632/README.md +++ b/app/documentation/example/mikroe_irthermo3_mlx90632/README.md @@ -2,32 +2,34 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the contactless temperature sensor via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the contactless temperature sensor using the Silicon Labs. IRThermo 3 click uses the MLX90632 FIR sensor from Melexis as the contactless temperature sensor. This sensor is a thermopile IR sensor. A thermopile sensor is actually a serially connected thermocouple array, with hot junctions located on the heat-absorbing membrane. It uses a highly advanced MLX90632 FIR sensor, which detects the average temperature of objects within its field of view (FOV), which is typically ±25°. It is factory calibrated, with the calibration constants stored in its internal EEPROM. Besides EEPROM used for storing trimming values, device settings, and calibration constants, it has an additional RAM area that can be used for auxiliary measurement data storage. The integrated temperature sensor provides ambient temperature measurement, necessary for proper calibration. The device is calibrated to sense objects with a temperature ranging from -20 ℃ up to 200 ℃, and an ambient temperature ranging up to 80℃. The measurement resolution is 0.02℃. Measured data is available via the industry standard I2C communication bus. ## Required Hardware ## -- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [IrThermo 3 Click](https://www.mikroe.com/ir-thermo-3-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A ](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [IrThermo 3 Click](https://www.mikroe.com/ir-thermo-3-click) ## Hardware Connection ## -The IrThermo 3 Click board support MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The IrThermo 3 Click board support MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png "Hardware connection") -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png "Hardware connection") + | Description | BRD4338A GPIO | BRD4002 EXP Header | IrThermo 3 Click | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -35,16 +37,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter mlx90632 +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *mlx90632* 2. Click **Create** button on the **Third Party Hardware Drivers - MLX90632 - IrThermo 3 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_irthermo3_mlx90632/app.c` into the project root folder (overwriting the existing file). @@ -56,11 +59,18 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - **[Services] → [Timer] → [Sleep Timer]** - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - **[Application] → [Utility] → [Log]** - - **[Third Party Hardware Drivers] → [Sensors] → [MLX90632 - IrThermo 3 Click (Mikroe)]** -> use default configuration. - ![config](image/default_config.png) + - **[Third Party Hardware Drivers] → [Sensors] → [MLX90632 - IrThermo 3 Click (Mikroe)]** -> use default configuration. + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [MLX90632 - IrThermo 3 Click (Mikroe)] -> use default configuration. 4. Install printf float @@ -73,7 +83,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "MLX90632 - IrThermo 3 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_irthermo3_mlx90632/image/create_example.png b/app/documentation/example/mikroe_irthermo3_mlx90632/image/create_example.png index 34148f91..d8065273 100644 Binary files a/app/documentation/example/mikroe_irthermo3_mlx90632/image/create_example.png and b/app/documentation/example/mikroe_irthermo3_mlx90632/image/create_example.png differ diff --git a/app/documentation/example/mikroe_irthermo3_mlx90632/image/default_config.png b/app/documentation/example/mikroe_irthermo3_mlx90632/image/default_config.png deleted file mode 100644 index 36c69ea0..00000000 Binary files a/app/documentation/example/mikroe_irthermo3_mlx90632/image/default_config.png and /dev/null differ diff --git a/app/documentation/example/mikroe_irthermo3_mlx90632/image/log.png b/app/documentation/example/mikroe_irthermo3_mlx90632/image/log.png index ef81014a..175fc215 100644 Binary files a/app/documentation/example/mikroe_irthermo3_mlx90632/image/log.png and b/app/documentation/example/mikroe_irthermo3_mlx90632/image/log.png differ diff --git a/app/documentation/example/mikroe_lr9_ra_08/README.md b/app/documentation/example/mikroe_lr9_ra_08/README.md new file mode 100644 index 00000000..fca84550 --- /dev/null +++ b/app/documentation/example/mikroe_lr9_ra_08/README.md @@ -0,0 +1,86 @@ +# RA-08 - LR 9 Click (Mikroe) # + +## Summary ## + +This example project shows an example of Mikroe LR 9 Click board driver integration with the Silicon Labs Platform. + +LR 9 Click is based on the RA-08, a LoRaWAN module from Ai-Thinker Technology. This module is made for ultra-long-range spread spectrum communication tasks powered by the ASR6601. The ASR6601 is an LPWAN wireless communication system-on-chip (SoC) that combines RF transceivers, modems, and a 32-bit RISC microcontroller (MCU). + +This example demonstrates the ability to transmit and receive data via the LoRaWan network between two Silicon Labs boards using the AT instruction set. The example uses LR 9 click to process incoming data and display them on the screen. + +## Required Hardware ## + +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) + +- [Mikroe LR 9 Click](https://www.mikroe.com/lr-9-click) + +## Hardware Connection ## + +The LR 9 Click board supports MikroBus, so it can connect easily to Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + +The hardware connection is shown in the image below: + +![hardware_connection](image/hardware_connection.png) + +## Setup ## + +You can either create a project based on an example project or start with an empty example project. + +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *lr*. + +2. Click the **Create** button on the **Third Party Hardware Drivers - RA-08 - LR 9 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![create_project](image/create_project.png) + +3. Build and flash this example to the board. + +### Start with an empty example project ### + +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. + +2. Copy the file `app/example/mikroe_lr_ra_08/app.c` into the project root folder (overwriting the existing file). + +3. Install the software components: + + - Open the .slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. + + - Install the following components: + + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: USART] → use an instance name: **mikroe** + - [Services] → [IO Stream] → [IO Stream: ESART] → use the default instance name: **vcom** + - [Application] → [Utility] → [Log] + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [RA-08 - LR 9 Click (Mikroe)] → use default configuration + +4. Build and flash this example to the board. + +**Note :** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). + +- SDK Extension must be enabled for the project to install the "RA-08 - LR 9 Click (Mikroe)" component. + +## How It Works ## + +The example uses two Silicon Labs boards for each direction. One runs in the transmitter role and the other operates in the receiver role. The transmitter sends a "Silabs" string every two seconds. The receiver parses the incoming data and displays the string on the screen. + +The source code is suitable for running in two roles. However, the original code is used for the transmitter role. To create the receiver device, the `DEMO_APP_TRANSMITTER` macro in the `app.c` file should be commented. + +```c +// Comment the line below to switch application mode to receiver +#define DEMO_APP_TRANSMITTER +``` + +You can launch Console, which is integrated into Simplicity Studio or you can use a third-party terminal tool like Tera Term to receive the data. Data is coming from the UART COM port. A screenshot of the console output of the receiver device is shown in the figure below. + +| Transmitter | Receiver | +| :-----------: | :--------: | +|![console_log](image/log_transmitter.png) | ![console_log](image/log_receiver.png) | + +## Report Bugs & Get Support ## + +To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. + +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/mikroe_lr9_ra_08/image/create_project.png b/app/documentation/example/mikroe_lr9_ra_08/image/create_project.png new file mode 100644 index 00000000..f8b19404 Binary files /dev/null and b/app/documentation/example/mikroe_lr9_ra_08/image/create_project.png differ diff --git a/app/documentation/example/mikroe_lr9_ra_08/image/hardware_connection.png b/app/documentation/example/mikroe_lr9_ra_08/image/hardware_connection.png new file mode 100644 index 00000000..2bf27901 Binary files /dev/null and b/app/documentation/example/mikroe_lr9_ra_08/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_lr9_ra_08/image/log_receiver.png b/app/documentation/example/mikroe_lr9_ra_08/image/log_receiver.png new file mode 100644 index 00000000..0eae20dd Binary files /dev/null and b/app/documentation/example/mikroe_lr9_ra_08/image/log_receiver.png differ diff --git a/app/documentation/example/mikroe_lr9_ra_08/image/log_transmitter.png b/app/documentation/example/mikroe_lr9_ra_08/image/log_transmitter.png new file mode 100644 index 00000000..712ae349 Binary files /dev/null and b/app/documentation/example/mikroe_lr9_ra_08/image/log_transmitter.png differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/README.md b/app/documentation/example/mikroe_lte_iot2_bg96/README.md index ccb2a16c..e6bf7c53 100644 --- a/app/documentation/example/mikroe_lte_iot2_bg96/README.md +++ b/app/documentation/example/mikroe_lte_iot2_bg96/README.md @@ -2,31 +2,36 @@ ## Summary ## -This project shows the implementation of an LTE IoT 2 Click driver using Quectel BG96 LTE module from Mikroe Integrated with EFR32xG24 Explorer Kit based on UART communication. +This project shows the implementation of an LTE IoT 2 Click driver using Quectel BG96 LTE module from Mikroe Integrated with Silicon Labs platform based on UART communication. + LTE IoT 2 Click is a Click board™ that allows connection to the LTE networks, featuring Quectel BG96 LTE module, which offers two LTE technologies aimed at Machine to Machine communication (M2M) and the Internet of Things (IoT). This module is an embedded IoT communication solution that supports the LTE Cat M1 and NB1 technologies, offering an alternative to similar Low Power Wide Area Network (LPWAN) solutions, such as the ones provided by Sigfox and LoRa. The LTE CAT1 and NB1 technologies are designed with specific requirements of the IoT network in mind. LTE IoT 2 click also offers various other features, allowing simple and reliable connection to these new 3GPP IoT technologies. ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). - -- [**LTE IoT 2 Click** board based on Quectel BG96 LTE module from Mikroe Integrated](https://www.mikroe.com/lte-iot-2-click). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -**NOTE:** -Tested boards for working with this example: +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [**LTE IoT 2 Click** board based on Quectel BG96 LTE module from Mikroe Integrated](https://www.mikroe.com/lte-iot-2-click) ## Hardware Connection ## -The LTE IoT 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. The GSM antenna needs to be connected to the LTE IOT 2 Click board to ensure that the mobile network signal can be received. And also a SIM card is properly attached to the module. If the user using the GPS function then the GPS antenna needs to be connected to the LTE IoT 2 Click board to ensure that the satellite signals can be received. +- If the EFR32xG24 Explorer Kit is used: + + The LTE IoT 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the images below: + + ![board_1](image/hardware_connection_1.png "BRD2703A xG24 Explorer Kit Board and LTE IoT 2 Click Board") + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board_1](image/hardware_connection_1.png "BRD2703A xG24 Explorer Kit Board and LTE IoT 2 Click Board") -![board_2](image/hardware_connection_2.png "BRD2703A xG24 Explorer Kit Board and LTE IoT 2 Click Board") -![board_3](image/hardware_connection_3.png "BRD2703A xG24 Explorer Kit Board and LTE IoT 2 Click Board") + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | LTE IOT 2 Click board | + | ----------------- | ------------------------ | -------------------- | ----------- | + | UART1_RX_PIN | GPIO_6 | P19 | TX | + | UART1_TX_PIN | GPIO_7 | P20 | RX | + | Module Power-Up | GPIO_47 | P26 | PWK | + | Module status | GPIO_46 | P24 | STA | ## Setup ## @@ -34,18 +39,32 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter 'bg96'. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **bg96**. 2. Click **Create** button on the **Third Party Hardware Drivers - BG96 - LTE IoT 2 CLick (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) -3. Build and flash this example to the board. + ![Create_example](image/create_example.png) + +3. From the project root folder, open file **app_iostream_cli.c** (if using EFR32xG24 Explorer Kit) or **app_iostream_cli_si91x.c** (if using SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit). Replace " *** " by the receiver's phone number. + + ![config_sms_phone_number](image/config_sms_phone_number.png) + + If you want to send pdu message replace the " *** " by the service center phone number and the receiver's phone number respectively. + + ![config_pdu_phone_number](image/config_pdu_phone_number.png) + +4. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy the files `app/example/mikroe_lte_iot2_bg96/app.c`, `app/example/mikroe_lte_iot2_bg96/app_iostream_cli.c`, `app/example/mikroe_lte_iot2_bg96/app_iostream_cli.h` into the project root folder (overwriting the existing file). +2. Copy the following files into the project root folder (overwriting the existing file): + + - `app/example/mikroe_lte_iot2_bg96/app.c` + - `app/example/mikroe_lte_iot2_bg96/app_iostream_cli.h` + - `app/example/mikroe_lte_iot2_bg96/app_iostream_cli.c` if using EFR32xG24 Explorer Kit + - `app/example/mikroe_lte_iot2_bg96/app_iostream_cli_si91x.c` if using the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit 3. Install the software components: @@ -55,17 +74,36 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: mikroe - [Application] → [Utility] → [Log] - [Third-Party Hardware Drivers] → [Sensors] → [BG96 - LTE IoT 2 Click (Mikroe)] + - [Platform] → [Utilities] → [Circular Queue] → set Max Queue Length to 256 as below: -4. Build and flash this example to the board. + ![queue_config](image/config_queue_size.png) + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Third-Party Hardware Drivers] → [Sensors] → [BG96 - LTE IoT 2 Click (Mikroe)] + - [WiSeConnect 3 SDK v3.3.3] → [Device] → [Si91x] → [MCU] → [Peripheral] → [UART] → turn off DMA configuration as below: + + ![uart_config](image/config_uart_si91x.png) + + - [Platform] → [Utilities] → [Circular Queue] → set Max Queue Length to 256 as below: + + ![queue_config](image/config_queue_size.png) + +4. Configure receiver's phone number, refers to step 3 in [Create a project based on an example project](#create-a-project-based-on-an-example-project). + +5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third-party Hardware Drivers Extension must be enabled for the project to install "BG96- LTE IoT 2 Click (Mikroe)" component. +- SDK Extension must be enabled for the project to install "BG96 - LTE IoT 2 Click (Mikroe)" component. ## How It Works ## @@ -252,10 +290,10 @@ Creating a high-level function means a single AT command or a list of AT command ### Testing ### -- You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. In this example, we build a simple command line interface application. There are commonly used commands predefined in the "app_iostream_cli.c" file. When the user wants to test a feature, just call the corresponding commands. +- You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. In this example, we build a simple command line interface application. There are commonly used commands predefined in the `app_iostream_cli.h` file. When the user wants to test a feature, just call the corresponding commands. - First, after the chip has finished booting, the user needs to start the LTE IoT 2 module. Enter the command "wakeup" into Tera Term and end with an "Enter" key. A logline is printed confirming the command has been executed. The lower layer library will control the GPIO pin connected to the PWK pin to power the LTE IoT 2 module. After a few seconds the module boots up, and it will respond with a successful boot confirmation. - After the LTE IoT 2 module boots up successfully, users can check basic parameters such as getting imei code, and getting revision by "imei", "infor" commands. The user then calls the "service" command to configure the service domain type CS and PS. Next, the user calls the command "gsm" to select TE character set to GSM. -- In this example, we send a text message from LTE IoT 2 Click module to a given phone number. There are two operating modes "textmode" and "pdumode" need to call these 2 commands first to put the module into operation mode respectively. The user can then invoke the "smstext" and "smspdu" commands to send the message. After confirming the successful message delivery, there will be a response, which contains the reference information of that sms. +- In this example, we send a text message from LTE IoT 2 Click module to a given phone number. There are two operating modes "textmode" and "pdumode" need to call these 2 commands first to put the module into operation mode respectively. The user can then invoke the "smstext" and "smspdu" commands to send the message. After confirming the successful message delivery, there will be a response, which contains the reference information of that sms. - In addition, we also provide an example using the GPS function. First, users need to turn on the GPS module with the "gpsstart" command. After the LTE IoT 2 Click module captures the satellite signal, the user can get the location coordinates with the "location" command. After getting the results, users can use the longitude and latitude values ​​entered into Google Maps to check the actual location. In addition, the command also returns information such as UTC, altitude, date, etc. After use, the user can turn off the GPS function with the command "gpsstop", this is to save energy for the system. - A screenshot of the console output is shown in the figure below: diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/config_pdu_phone_number.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_pdu_phone_number.png new file mode 100644 index 00000000..c8772011 Binary files /dev/null and b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_pdu_phone_number.png differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/config_queue_size.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_queue_size.png new file mode 100644 index 00000000..82ba0d26 Binary files /dev/null and b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_queue_size.png differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/config_sms_phone_number.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_sms_phone_number.png new file mode 100644 index 00000000..13ad6561 Binary files /dev/null and b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_sms_phone_number.png differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/config_uart_si91x.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_uart_si91x.png new file mode 100644 index 00000000..006bc0b5 Binary files /dev/null and b/app/documentation/example/mikroe_lte_iot2_bg96/image/config_uart_si91x.png differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/create_example.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/create_example.png index 8a9d75b3..70443bb9 100644 Binary files a/app/documentation/example/mikroe_lte_iot2_bg96/image/create_example.png and b/app/documentation/example/mikroe_lte_iot2_bg96/image/create_example.png differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_1.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_1.png index 83c67c73..f90ac325 100644 Binary files a/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_1.png and b/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_1.png differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_2.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_2.png deleted file mode 100644 index 999cdbe6..00000000 Binary files a/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_2.png and /dev/null differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_3.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_3.png deleted file mode 100644 index 5e74637d..00000000 Binary files a/app/documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_3.png and /dev/null differ diff --git a/app/documentation/example/mikroe_lte_iot2_bg96/image/sms_receive.png b/app/documentation/example/mikroe_lte_iot2_bg96/image/sms_receive.png index 49c07d8e..4442ede9 100644 Binary files a/app/documentation/example/mikroe_lte_iot2_bg96/image/sms_receive.png and b/app/documentation/example/mikroe_lte_iot2_bg96/image/sms_receive.png differ diff --git a/app/documentation/example/mikroe_mic2/README.md b/app/documentation/example/mikroe_mic2/README.md index 84a784ed..12f3309f 100644 --- a/app/documentation/example/mikroe_mic2/README.md +++ b/app/documentation/example/mikroe_mic2/README.md @@ -10,39 +10,43 @@ This example can be used to determine the sound intensity of your location. The ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [Mikroe MIC 2 Click](https://www.mikroe.com/mic-2-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220-EK4314A - BGM220 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [Mikroe MIC 2 Click](https://www.mikroe.com/mic-2-click) ## Hardware Connection ## -The MIC 2 Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The MIC 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![hardware_connection](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP/Breakout Header | MIC 2 Click | + | --------------------- | ------------- | --------------------------- | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Positive analog input | ULP_GPIO_1 | P16 | AN | ## Setup ## You can either create a project based on an example project or start with an empty example project. -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter **"mic 2"**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"mic 2"**. 2. Click **Create** button on the **Third Party Hardware Drivers - MIC 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](image/create_example.png) + + ![create_project](image/create_example.png) ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_mic2/app.c` into the project root folder (overwriting the existing file). @@ -54,25 +58,32 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom** - [Application] → [Utility] → [Log] - [Services] → [Timers] → [Sleep Timer] - - [Third Party Hardware Drivers] → [Audio & Voice] → [MIC 2 Click (Mikroe)] → use the default configuration. + - [Third Party Hardware Drivers] → [Audio & Voice] → [MIC 2 Click (Mikroe)] → use the default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Audio & Voice] → [MIC 2 Click (Mikroe)] → use the default configuration 4. Install printf float - Open Properties of the Project. - - Select C/C++ Build → Settings → Tool Settings → GNU ARM C Linker → General. Check Printf float. - ![install_float](image/install_float.png) 5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install the "MIC 2 Click (Mikroe)" component. Selecting this component will also include the "I2CSPM" component with instance "mikroe" and "IADC" component. +- SDK Extension must be enabled for the project to install the "MIC 2 Click (Mikroe)" component. ## How It Works ## @@ -84,13 +95,13 @@ You can either create a project based on an example project or start with an emp This example reads the ADC value and converts this value to Decibel (dB) value. With decibel value, you can perceive the noise level of the surrounding environment. -You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like TeraTerm to receive the data from the USB. A screenshot of the console output is shown in the figure below. +After the sensor is initialed successfully, the application reads the analog signal every 500 milliseconds. Right after getting this value, it will be converted to a Decibel value. -![console_log](image/console_log.png) +To test the functionality, you can change the sound intensity surrounding the sensor in many ways. You can talk louder or applaud near the sensor. Then you will see the Decibel value change on the console in Simplicity Studio or other third-party terminal tools. -This example uses the I2CSPM diver with the "Mikroe" instance and IADC0 to read the analog signal. After the sensor is initialed successfully, the application reads the analog signal every 500 milliseconds. Right after getting this value, it will be converted to a Decibel value. +You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like TeraTerm to receive the data from the USB. A screenshot of the console output is shown in the figure below. -To test the functionality, you can change the sound intensity surrounding the sensor in many ways. You can talk louder or applaud near the sensor. Then you will see the Decibel value change on the console in Simplicity Studio or other third-party terminal tools. +![console_log](image/console_log.png) ## Report Bugs & Get Support ## diff --git a/app/documentation/example/mikroe_mic2/image/console_log.png b/app/documentation/example/mikroe_mic2/image/console_log.png index 79d4b348..d66c1e22 100644 Binary files a/app/documentation/example/mikroe_mic2/image/console_log.png and b/app/documentation/example/mikroe_mic2/image/console_log.png differ diff --git a/app/documentation/example/mikroe_mic2/image/create_example.png b/app/documentation/example/mikroe_mic2/image/create_example.png index 2c28ea4f..060e687f 100644 Binary files a/app/documentation/example/mikroe_mic2/image/create_example.png and b/app/documentation/example/mikroe_mic2/image/create_example.png differ diff --git a/app/documentation/example/mikroe_mic2/image/install_float.png b/app/documentation/example/mikroe_mic2/image/install_float.png deleted file mode 100644 index e6b6e9c1..00000000 Binary files a/app/documentation/example/mikroe_mic2/image/install_float.png and /dev/null differ diff --git a/app/documentation/example/mikroe_microsd/README.md b/app/documentation/example/mikroe_microsd/README.md index fa4a7bfa..38339d2b 100644 --- a/app/documentation/example/mikroe_microsd/README.md +++ b/app/documentation/example/mikroe_microsd/README.md @@ -14,24 +14,31 @@ The microSD Click communicates with the target microcontroller over SPI interfac - [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [A microSD Click board](https://www.mikroe.com/microsd-click) - A microSD card, e.g. [microSD card 32 GB with adapter](https://www.mikroe.com/microsd-32gb) -**NOTE:** -Tested boards for working with this example: +## Connections Required ## + +**Note:** A pull-up resistor (e.g., 100k) should be placed on the MISO. + +- If the BGM220P Explorer Kit is used: -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4108A | [BG22 Bluetooth SoC Explorer Kit - BG22-EK4108A](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | + The microSD Click board can be easily clicked into its place. During the assembly, be sure that the 45-degree corner of the board fits the 45-degree white line of the Explorer Kit. -## Hardware Connection ## + ![board](image/board.png) -The microSD Click board can be easily clicked into its place. During the assembly, be sure that the 45-degree corner of the board fits the 45-degree white line of the Explorer Kit. +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/board.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | microSD Click Board | + | -------------| ------------- | -------------------- | ------------------- | + | Card Detection | GPIO_46 | P24 | CD | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -39,39 +46,45 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter microsd. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **microsd**. 2. Click **Create** button on the **Third Party Hardware Drivers - microSD Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) + + ![create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create a "Platform - Empty C Project" project for the "BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A" using Simplicity Studio v5. Use the default project settings. Be sure to connect and select the BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A Board from the "Debug Adapters" on the left before creating a project. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_microsd/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - - Open the .slcp file in the project - - - Select the *SOFTWARE COMPONENTS* tab + - Open the .slcp file in the project. + - Select the SOFTWARE COMPONENTS tab. + - Install the following components: - - Install the following components: + **If the BGM220P Explorer Kit is used:** - - **[Third Party Hardware Drivers] → [Storage] → [microSD - microSD Click (Mikroe)]** - - **[Third Party Hardware Drivers] → [Storage] → [FatFS - Generic FAT Filesystem]** - - **[Services] → [IO Stream] → [IO Stream: USART]** → with the default instance name: **vcom** + - **[Third Party Hardware Drivers] → [Storage] → [microSD - microSD Click (Mikroe)]** + - **[Third Party Hardware Drivers] → [Storage] → [FatFS - Generic FAT Filesystem]** + - **[Services] → [IO Stream] → [IO Stream: USART]** → with the default instance name: **vcom** + - **[Application] → [Utility] → [Log]** + - **[Application] → [Utility] → [Assert]** - - **[Application] → [Utility] → [Log]** - - **[Application] → [Utility] → [Assert]** + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - **[Application] → [Utility] → [Assert]** + - **[Third Party Hardware Drivers] → [Storage] → [microSD - microSD Click (Mikroe)]** + - **[Third Party Hardware Drivers] → [Storage] → [FatFS - Generic FAT Filesystem]** -> turn on *Enable if the system does not have an RTC or valid timestamp* + ![fatfs_config](image/fatfs_config.png) 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "microSD - microSD Click (Mikroe)" component. @@ -109,7 +122,7 @@ This example demonstrates the basic features of the driver as shown below: ![Flow](image/workflow.png) -Use a terminal program, such as the Console that is integrated into Simplicity Studio or a third-party tool terminal like Tera Term to receive the logs from the virtual COM port. You should expect a similar output to the one below. +Use a terminal program, such as the Console that is integrated into Simplicity Studio or a third-party tool terminal like Tera Term to receive the logs from the virtual COM port. Make sure that A pull-up resistor (e.g., 100k) is placed on the MISO. You should expect a similar output to the one below. ![testing_format](image/testing.png) diff --git a/app/documentation/example/mikroe_microsd/image/board.png b/app/documentation/example/mikroe_microsd/image/board.png index 988a14fd..6e459a28 100644 Binary files a/app/documentation/example/mikroe_microsd/image/board.png and b/app/documentation/example/mikroe_microsd/image/board.png differ diff --git a/app/documentation/example/mikroe_microsd/image/create_example.png b/app/documentation/example/mikroe_microsd/image/create_example.png index f0720fe3..949f518e 100644 Binary files a/app/documentation/example/mikroe_microsd/image/create_example.png and b/app/documentation/example/mikroe_microsd/image/create_example.png differ diff --git a/app/documentation/example/mikroe_microsd/image/fatfs_config.png b/app/documentation/example/mikroe_microsd/image/fatfs_config.png new file mode 100644 index 00000000..5cd47246 Binary files /dev/null and b/app/documentation/example/mikroe_microsd/image/fatfs_config.png differ diff --git a/app/documentation/example/mikroe_nfc2_pn7150/README.md b/app/documentation/example/mikroe_nfc2_pn7150/README.md index 24e32cc5..c1026fad 100644 --- a/app/documentation/example/mikroe_nfc2_pn7150/README.md +++ b/app/documentation/example/mikroe_nfc2_pn7150/README.md @@ -2,7 +2,7 @@ ## Summary ## -This example demonstrates the usage of NFC 2 Click board with BGM220P Explorer Kit based on I2C communication. +This example demonstrates the usage of NFC 2 Click board with Silicon Labs platform based on I2C communication. NFC 2 Click is based on the PN7150, high-performance full NFC solution with integrated firmware and I2C interface designed for contactless communication at 13.56 MHz from NXP. @@ -12,15 +12,28 @@ NFC 2 Click board can be used for the detection of NFC Tag and can be used for r - [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [An NFC 2 Click](https://www.mikroe.com/nfc-2-click) - A T2T tag ## Hardware Connection ## -The NFC 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220P Explorer Kit is used: + + The NFC 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP/Breakout Header | MIC 2 Click | + | --------------------- | ------------- | --------------------------- | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -28,16 +41,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: *nfc 2*. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: *nfc 2*. 2. Click **Create** button on the **Third Party Hardware Drivers - PN7150 - NFC 2 Click (Mikroe) - I2C** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_nfc2_pn7150/app.c` into the project root folder (overwriting the existing file). @@ -49,15 +63,24 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + **If the EFR32xG24 Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom** - [Application] → [Utility] → [Log] + - [Services] → [Timers] → [Sleep Timer] + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [PN7150 - NFC 2 Click (Mikroe) - I2C] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] - [Third Party Hardware Drivers] → [Wireless Connectivity] → [PN7150 - NFC 2 Click (Mikroe) - I2C] → use default configuration 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Hardware Drivers Extension must be enabled for the project to install "PN7150 - NFC 2 Click (Mikroe) - I2C" component. diff --git a/app/documentation/example/mikroe_nfc2_pn7150/image/create_example.png b/app/documentation/example/mikroe_nfc2_pn7150/image/create_example.png index 96cee5d7..32b82f14 100644 Binary files a/app/documentation/example/mikroe_nfc2_pn7150/image/create_example.png and b/app/documentation/example/mikroe_nfc2_pn7150/image/create_example.png differ diff --git a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/README.md b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/README.md index e06c38c2..b9c1d6a3 100644 --- a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/README.md +++ b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/README.md @@ -8,15 +8,28 @@ This example project demonstrates the interface of the NFC NCI service by using - [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [An NFC 2 Click](https://www.mikroe.com/nfc-2-click) - A T2T tag (E.g. [NFC 2 Tag Click](https://www.mikroe.com/nfc-tag-2-click)) ## Hardware Connection ## -The NFC 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220P Explorer Kit is used: + + The NFC 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP/Breakout Header | MIC 2 Click | + | --------------------- | ------------- | --------------------------- | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -24,7 +37,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: *nci*. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: *nci*. 2. Click **Create** button on the **Third Party Hardware Drivers - PN7150 - Read a T2T Tag with NCI** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. ![Create_example](image/create_example.png) @@ -33,7 +46,7 @@ You can either create a project based on an example project or start with an emp ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_nfc2_pn7150_nci_t2t_read/app.c` into the project root folder (overwriting the existing file). @@ -45,6 +58,8 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Application] → [Utility] → [Assert] @@ -55,11 +70,21 @@ You can either create a project based on an example project or start with an emp - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Common] - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Tag] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [PN7150 - NFC 2 Click (Mikroe) - I2C] → use default configuration + - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - NCI] → use default configuration + - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Common] + - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Tag] + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Hardware Drivers Extension must be enabled for the project to install any extension components. diff --git a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/create_example.png b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/create_example.png index 50eae577..51034d90 100644 Binary files a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/create_example.png and b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/create_example.png differ diff --git a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/README.md b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/README.md index 6ecda0ac..c2c98790 100644 --- a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/README.md +++ b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/README.md @@ -8,15 +8,28 @@ This example project demonstrates the interface of the NFC NCI service by using - [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [An NFC 2 Click](https://www.mikroe.com/nfc-2-click) - A T2T tag (E.g. [NFC 2 Tag Click](https://www.mikroe.com/nfc-tag-2-click)) ## Hardware Connection ## -The NFC 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220P Explorer Kit is used: + + The NFC 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP/Breakout Header | MIC 2 Click | + | --------------------- | ------------- | --------------------------- | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -24,16 +37,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: *nci*. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: *nci*. 2. Click **Create** button on the **Third Party Hardware Drivers - PN7150 - Write to a T2T Tag with NCI** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_nfc2_pn7150_nci_t2t_write/app.c` into the project root folder (overwriting the existing file). @@ -45,6 +59,8 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Application] → [Utility] → [Assert] @@ -56,11 +72,22 @@ You can either create a project based on an example project or start with an emp - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Tag] - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - NDEF] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [PN7150 - NFC 2 Click (Mikroe) - I2C] → use default configuration + - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - NCI] → use default configuration + - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Common] + - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - Tag] + - [Third Party Hardware Drivers] → [Services] → [NFC] → [NFC - NDEF] + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Hardware Drivers Extension must be enabled for the project to install any extension components. diff --git a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/create_example.png b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/create_example.png index 7594dab6..a4e6c5d0 100644 Binary files a/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/create_example.png and b/app/documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/create_example.png differ diff --git a/app/documentation/example/mikroe_nfctag2_nt3h2111/README.md b/app/documentation/example/mikroe_nfctag2_nt3h2111/README.md index 58a22ce2..2440157e 100644 --- a/app/documentation/example/mikroe_nfctag2_nt3h2111/README.md +++ b/app/documentation/example/mikroe_nfctag2_nt3h2111/README.md @@ -9,14 +9,26 @@ NT3H2111 is an NFC Forum Type 2 Tag (T2T) compliant tag IC with an I2C interface ## Required Hardware ## - [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) - +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [An NFC Tag 2 Click](https://www.mikroe.com/nfc-tag-2-click) ## Hardware Connection ## -The Accel 5 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- **If the BGM220P Explorer Kit board is used:** + + The Mikroe NFC Tag 2 Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the BGM220P Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -![board](image/hardware_connection.png) + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | The Mikroe NFC Tag 2 Click board | + | -------------| ------------- | ------------------ | -------------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Field Detection | GPIO_46 | P24 | FD | ## Setup ## @@ -24,18 +36,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: *nfc tag*. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "nfc tag". + +2. Click **Create** button on the project **Third Party Hardware Drivers - NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C**. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -2. Click **Create** button on the **Third Party Hardware Drivers - NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file app/example/mikroe_nfctag2_nt3h2111/app.c into the project root folder (overwriting existing file). +2. Copy the file `app/example/mikroe_nfctag2_nt3h2111/app.c` into the project root folder (overwriting existing file). 3. Install the software components: @@ -45,17 +58,25 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit board is used:** + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → mikroe instance + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] - [Third Party Hardware Drivers] → [Wireless Connectivity] → [NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C] → use default configuration 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third-party Hardware Drivers Extension must be enabled for the project to install "NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C" component. +- Third-party Hardware Drivers Extension must be enabled for the project to install "NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C" component ## How It Works ## @@ -75,27 +96,21 @@ You can either create a project based on an example project or start with an emp `mikroe_nt3h2111.c`: implements the top-level APIs for application. -- Initialization API: Initialize I2C communication and FD interrupt. -- memory block R/W APIs: read/write a memory block, given memory address. -- specific register read/write APIs: specific register read/write to get and set settings for NT3H2x11. - -`mikroe_nt3h2111_i2c.c`: implements NT3H2x11 specific I2C APIs, called by `mikroe_nt3h2111.c`. - -- Initialization API: initialize I2C communication. -- I2C read/write APIs: read/write a memory block via I2C, given memory address. -- I2C read/write register APIs: read/write a register via I2C, given block memory address and register address. +- Initialization API: Initialize I2C communication and FD interrupt +- memory block R/W APIs: read/write a memory block, given memory address +- specific register read/write APIs: specific register read/write to get and set settings for NT3H2x11 +- I2C read/write APIs: read/write a memory block via I2C, given memory address +- I2C read/write register APIs: read/write a register via I2C, given block memory address and register address ### Testing ### -Application would first call `nt3h2111_init` to initialize needed peripherals(I2C, GPIO FD). Then use register read/write APIs to adjust the settings on the NT3H2111. The example will call any function based on the character it receives over the serial connection. - -You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like TeraTerm to receive the data from the USB. A screenshot of the console output is shown in the figure below. +On your PC open a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. Note that your board uses the default baud rate of 115200. Application would first call `nt3h2111_init` to initialize needed peripherals(I2C, GPIO FD). Then use register read/write APIs to adjust the settings on the NT3H2111. The example will call any function based on the character it receives over the serial connection.A screenshot of the console output is shown in the image below. ![usb_debug](image/log.png "USB Debug Output Data") **Note**: After an NDEF message is written into NT3H2111 EEPROM, you can either use an NFC-enabled smartphone or use an RFID-reader module to read the data it contains. -A screenshot of an NFC-enabled smartphone that uses the *NFC Tools* application to read data from NT3H2111 as shown below. +A screenshot of an NFC-enabled smartphone that uses the *NFC Tools* application to read data from NT3H2111 is shown in the image below. ![nfc tools](image/nfc_tools.png "USB Debug Output Data") diff --git a/app/documentation/example/mikroe_nfctag2_nt3h2111/image/create_example.png b/app/documentation/example/mikroe_nfctag2_nt3h2111/image/create_example.png index 71c7b299..10895fe6 100644 Binary files a/app/documentation/example/mikroe_nfctag2_nt3h2111/image/create_example.png and b/app/documentation/example/mikroe_nfctag2_nt3h2111/image/create_example.png differ diff --git a/app/documentation/example/mikroe_obdii_stn1110/README.md b/app/documentation/example/mikroe_obdii_stn1110/README.md index acc519f9..0f4c39de 100644 --- a/app/documentation/example/mikroe_obdii_stn1110/README.md +++ b/app/documentation/example/mikroe_obdii_stn1110/README.md @@ -8,17 +8,32 @@ The OBDII Click can be used for the communication with the Electronic Control Un ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). -- [**OBDII Click** board](https://www.mikroe.com/obdii-click). -- [OBDII cable](https://www.mikroe.com/obd-ii-to-db9-cable). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) + +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [**OBDII Click** board](https://www.mikroe.com/obdii-click) + +- [OBDII cable](https://www.mikroe.com/obd-ii-to-db9-cable) ## Hardware Connection ## -The OBDII Click supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The OBDII Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. -The hardware connection is shown in the image below: + The hardware connection is shown in the image below: -![board](image/hardware_connection.png) + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | OBDII Click | + | ----------------- | ------------------------ | -------------------- | ----------- | + | UART1_RX_PIN | GPIO_6 | P19 | TX | + | UART1_TX_PIN | GPIO_7 | P20 | RX | + | RESET | GPIO_46 | P24 | RST | + | INTERRUPT | GPIO_47 | P27 | INT | ## Setup ## @@ -26,14 +41,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **obdii**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **obdii**. + 2. Click **Create** button on the **Third Party Hardware Drivers - STN1110 - OBDII Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) + +3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_obdii_stn1110/app.c` into the project root folder (overwriting existing file). @@ -45,24 +63,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: **vcom** - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **mikroe** - [Third Party Hardware Drivers] → [Interface] → [STN1110 - OBDII Click (Mikroe)] → use default configuration + - [Application] → [Utility] → [Assert] + - [Application] → [Utility] → [Log] - | Mikroe pin | BRD2703A pin | - |:----------|:------------------:| - | STN1110_RESET | PC8 | - | STN1110_INT | PB1 | + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** - [Application] → [Utility] → [Assert] - - [Application] → [Utility] → [Log] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Interface] → [STN1110 - OBDII Click (Mikroe)] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [UART] → disable "UART1 DMA" 4. Build and flash this example to the board. **Note :** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "STN1110 - OBDII Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_oledc_ssd1351/README.md b/app/documentation/example/mikroe_oledc_ssd1351/README.md index f1295475..85472237 100644 --- a/app/documentation/example/mikroe_oledc_ssd1351/README.md +++ b/app/documentation/example/mikroe_oledc_ssd1351/README.md @@ -8,30 +8,32 @@ OLED C click is equipped with a 96x96 high-color OLED display. It can display up ## Required Hardware ## -**Silabs Development Kits** - - [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) - -**External Hardware** - +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [OLED C Click](https://www.mikroe.com/oled-c-click) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## + +- **If the EFR32xG24 Explorer Kit is used**: -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A ](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | + The OLEDC Click board supports MikroBus, so it can connect easily to the MikroBus header of EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: -## Hardware Connection ## + ![board](image/hardware_connection.png "Hardware connection") -The OLEDC Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -The hardware connection is shown in the image below: + The hardware connection is shown in the table below: -![board](image/hardware_connection.png "Hardware connection") + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | OLEDC SSD1351 Board | + | -------------------------| ------------- | -------------------- | ------------------- | + | OLEDC_DC | GPIO_46 | P24 | DC | + | OLEDC_RST | GPIO_47 | P26 | RST | + | OLEDC_EN | GPIO_48 | P28 | EN | + | OLEDC_RW | GPIO_49 | P30 | RW | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -39,16 +41,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter *oledc*. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "ssd1351". + +2. Click **Create** button on the example **Third Party Hardware Drivers - SSD1351 - OLED C Click (Mikroe)** + + ![Create_example](image/create_example.png) -2. Click **Create** button on the **Third Party Hardware Drivers - SSD1351 - OLED C Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + Example project creation dialog pops up -> click Create and Finish and Project should be generated. 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_oledc_ssd1351/app.c` into the project root folder (overwriting the existing file). @@ -60,17 +65,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Services] → [Timers] → [Sleep Timer] - [Application] → [Utility] → [Log] - [Application] → [Utility] → [Assert] - - [Third Party Hardware Drivers] → [Display & LED] → [SSD1351 - OLED C Click (Mikroe) - SPI] + - [Third Party Hardware Drivers] → [Display & LED] → [SSD1351 - OLED C Click (Mikroe) - SPI] → use default configuration + - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Display & LED] → [SSD1351 - OLED C Click (Mikroe) - SPI] → use default configuration - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension has already be installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **SSD1351 - OLED C Click (Mikroe) - SPI** component. diff --git a/app/documentation/example/mikroe_oledc_ssd1351/image/create_example.png b/app/documentation/example/mikroe_oledc_ssd1351/image/create_example.png index a455a26b..ff330884 100644 Binary files a/app/documentation/example/mikroe_oledc_ssd1351/image/create_example.png and b/app/documentation/example/mikroe_oledc_ssd1351/image/create_example.png differ diff --git a/app/documentation/example/mikroe_oledw_ssd1306/README.md b/app/documentation/example/mikroe_oledw_ssd1306/README.md index 1dbbc996..78a50b74 100644 --- a/app/documentation/example/mikroe_oledw_ssd1306/README.md +++ b/app/documentation/example/mikroe_oledw_ssd1306/README.md @@ -18,7 +18,7 @@ MikroE OLED W Click is based on the MI9639BO-W OLED module which has a size of 1 - If the BGM220P Explorer Kit is used: - The OLEDW Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + The OLEDW Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: @@ -28,11 +28,11 @@ MikroE OLED W Click is based on the MI9639BO-W OLED module which has a size of 1 | Description | BRD4338A GPIO | BRD4002 Breakout Pad | OLED W click | | -------------| ------------------------ | -------------------- | ------------------ | - | DATA/COMMAND | GPIO_47 | P26 | D/C | | RESET | GPIO_46 | P24 | RST | - | CS | GPIO_49 \| GSPI_MST1_CS0 | P30 | CS | - | CLK | GPIO_25 \| GSPI_MST1_CLK | P25 | SCK | - | MOSI | GPIO_25 \| GSPI_MST1_MOSI| P29 | SDI | + | DATA/COMMAND | GPIO_47 | P26 | D/C | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -42,15 +42,9 @@ You can either create a project based on an example project or start with an emp 1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *oledw*. -2. Click **Create** button on the project: - - - **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe)** example if the BGM220P Explorer Kit is used. - ![Create_example](image/create_example_1.png) - - - **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used. - ![Create_example](image/create_example_2.png) +2. Click **Create** button on the **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - Example project creation dialog pops up -> click Create and Finish and Project should be generated. + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. @@ -84,7 +78,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "SSD1306 - OLED W Click (Mikroe) - SPI" component. diff --git a/app/documentation/example/mikroe_oledw_ssd1306/image/create_example.png b/app/documentation/example/mikroe_oledw_ssd1306/image/create_example.png new file mode 100644 index 00000000..bc77f1b1 Binary files /dev/null and b/app/documentation/example/mikroe_oledw_ssd1306/image/create_example.png differ diff --git a/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png b/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png deleted file mode 100644 index 61494a7f..00000000 Binary files a/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png and /dev/null differ diff --git a/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png b/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png deleted file mode 100644 index 61494a7f..00000000 Binary files a/app/documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png and /dev/null differ diff --git a/app/documentation/example/mikroe_oledw_ssd1306_glib/README.md b/app/documentation/example/mikroe_oledw_ssd1306_glib/README.md index 849bef9b..fe998eb7 100644 --- a/app/documentation/example/mikroe_oledw_ssd1306_glib/README.md +++ b/app/documentation/example/mikroe_oledw_ssd1306_glib/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project shows the implementation of the OLED driver using a **Mikroe OLED W Click** with **BGM220 Explorer Kit** based on I2C communication. +This project shows the driver implementation of the OLED driver, using Graphics Library (GLIB) with Silicon Labs Platform. MikroE OLED W Click is based on the MI9639BO-W OLED module which has a size of 19.3x7.8 mm and resolution of 96x39 pixels. This white light monochrome, passive matrix OLED display is from Multi-Inno Technology. The MI9639BO-W display features an SSD1306 device that is a 128x64 pixel, dot-matrix OLED/PLED segment/common driver with a controller. It can be used for applications where bright and crisp white text or icons are needed. @@ -14,17 +14,29 @@ For more information about the SSD1306 controller, see the [specification page]( - [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [**Mikroe OLED W Click** board based on SSD1306 IC](https://www.mikroe.com/oled-w-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [**Mikroe OLED W Click** board based on SSD1306 IC](https://www.mikroe.com/oled-w-click) ## Hardware Connection ## -You simply connect a *Mikroe OLED W Click board* to a *BGM220 Explorer Kit* board using a Qwiic cable. +- If the BGM220P Explorer Kit is used: + + The OLEDW Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: -**Note:** There are several jumpers on *Mikroe OLED W Click board* that can be changed to facilitate several different functions. The first of which is the ADDR jumper. The ADDR jumper can be used to change the I2C address of the board. The default jumper is open by default, pulling the address pin high and giving us an I2C address of 0X3D. Closing this jumper will ground the address pin, giving us an I2C address of 0X3C. + ![board](image/hardware_connection.png "Hardware connection") -The second of which is the I2C pull-up jumper. If multiple boards are connected to the I2C bus, the equivalent resistance goes down, increasing your pull up strength. If multiple boards are connected on the same bus, make sure only one board has the pull-up resistors connected. +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![hardware_connection](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | OLED W click | + | -------------------------| ------------- | -------------------- | ------------------ | + | DATA/COMMAND | GPIO_47 | P26 | D/C | + | RESET | GPIO_46 | P24 | RST | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -32,36 +44,47 @@ To test this application, you should connect the BMG220 Explorer Kit Board to th ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "mikroe", "oledw". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *oledw*. -2. Click **Create** button on the **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe) with GLIB** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) +2. Click **Create** button on the **Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create a "Platform - Empty C Example" project for the "BGM220 Explorer Kit Board" using Simplicity Studio 5. Use the default project settings. Be sure to connect and select the BGM220 Explorer Kit Board from the "Debug Adapters" on the left before creating a project. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_oledw_ssd1306_glib/app.c` into the project root folder (overwriting existing file). 3. Install the software components: + - Open the .slcp file in the project. - Select the SOFTWARE COMPONENTS tab. - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - - [Platform] → [Driver]→ [Button] → [Simple Button] → default instance name: **btn0**. - - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - OLED W Click (Mikroe) - SPI] → use default config + - [Platform] → [Driver]→ [Button] → [Simple Button] → default instance name: **btn0** + - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - OLED W Click (Mikroe) - SPI] → use default configuration + - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Hardware] → [Button] → [btn0] + - [Third Party Hardware Drivers] → [Display & LED] → [SSD1306 - OLED W Click (Mikroe) - SPI] → use default configuration - [Third Party Hardware Drivers] → [Services] → [GLIB - OLED Graphics Library] -4. Build and flash the project to your device. +4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "SSD1306 - OLED W Click (Mikroe) - SPI" component. diff --git a/app/documentation/example/mikroe_oledw_ssd1306_glib/image/create_example.png b/app/documentation/example/mikroe_oledw_ssd1306_glib/image/create_example.png index 2de500a5..cb09a174 100644 Binary files a/app/documentation/example/mikroe_oledw_ssd1306_glib/image/create_example.png and b/app/documentation/example/mikroe_oledw_ssd1306_glib/image/create_example.png differ diff --git a/app/documentation/example/mikroe_oledw_ssd1306_glib/image/testing_result.gif b/app/documentation/example/mikroe_oledw_ssd1306_glib/image/testing_result.gif index 1c8e71c6..a0be4ddf 100644 Binary files a/app/documentation/example/mikroe_oledw_ssd1306_glib/image/testing_result.gif and b/app/documentation/example/mikroe_oledw_ssd1306_glib/image/testing_result.gif differ diff --git a/app/documentation/example/mikroe_ozone2_mq131/README.md b/app/documentation/example/mikroe_ozone2_mq131/README.md index 192c6995..b3a4f091 100644 --- a/app/documentation/example/mikroe_ozone2_mq131/README.md +++ b/app/documentation/example/mikroe_ozone2_mq131/README.md @@ -10,25 +10,30 @@ The analog output of the sensor is sampled by a high-resolution 22-bit A/D conve ## Required Hardware ## -- [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview). -- [**Mikroe Ozone 2 click** board based on MQ131 gas sensor](https://www.mikroe.com/ozone-2-click). +- [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) -**NOTE:** -Tested boards for working with this example: +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [**Mikroe Ozone 2 click** board based on MQ131 gas sensor](https://www.mikroe.com/ozone-2-click) ## Hardware Connection ## -The Ozone 2 click supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220P Explorer Kit is used: -The hardware connection is shown in the image below: + The Ozone 2 click supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. -![hardware_connection](images/hardware_connection.png) + The hardware connection is shown in the image below: + + ![hardware_connection](images/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP/ Breakout Pad | Ozone 2 Click Board | + | ----------------------| ---------------| --------------------------| --------------------| + | Positive analog input | ULP_GPIO_1 | P16 | AN | + | CS | GPIO_46 | P24 | CS | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | ## Setup ## @@ -36,13 +41,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **mq131**. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"mq131"**. + 2. Click **Create** button on the **Third Party Hardware Drivers - MQ131 - Ozone 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](images/create_example.png) + + ![Create_example](images/create_example.png) + +3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Bluetooth Module Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_ozone2_mq131/app.c` into the project root folder (overwriting existing file). @@ -54,23 +63,28 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: **vcom** - [Application] → [Utility] → [Log] - - [Platform] → [Driver] → [SPI] → [SPIDRV] → default instance name: **mikroe** → You need to change the SPI master chip select (CS) control scheme to "CS controlled by application" - ![spidrv_config](images/spidrv_config.png) - - [Third Party Hardware Drivers] → [Sensors] → [MQ131 - Ozone 2 Click (Mikroe)] → You may select the ADC module to use in a component configuration as the image shown below - - Internal ADC: Use EFR32 MCU ADC - - External ADC: Use MCP3551 ADC on the Ozone 2 click board - ![mg131_config](images/mq131_config.png) + - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe] → change the configuration for [SPI master chip select (CS) control scheme] to "CS controlled by the application" and select the CS pin to None as below: + ![spidrv_config](images/spidrv_config.png) + - [Third Party Hardware Drivers] → [Sensors] → [MQ131 - Ozone 2 Click (Mikroe)] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration + - [Third Party Hardware Drivers] → [Sensors] → [MQ131 - Ozone 2 Click (Mikroe)] → use default configuration 4. Build and flash this example to the board. **Note :** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "MQ131 - Ozone 2 Click (Mikroe)" component. +- Third-party Drivers Extension must be enabled for the project to install "MQ131 - Ozone 2 Click (Mikroe)" component. ## How It Works ## diff --git a/app/documentation/example/mikroe_ozone2_mq131/images/create_example.png b/app/documentation/example/mikroe_ozone2_mq131/images/create_example.png index 49fd5e10..54d01a3a 100644 Binary files a/app/documentation/example/mikroe_ozone2_mq131/images/create_example.png and b/app/documentation/example/mikroe_ozone2_mq131/images/create_example.png differ diff --git a/app/documentation/example/mikroe_ozone2_mq131/images/log.png b/app/documentation/example/mikroe_ozone2_mq131/images/log.png index d0863649..6755135f 100644 Binary files a/app/documentation/example/mikroe_ozone2_mq131/images/log.png and b/app/documentation/example/mikroe_ozone2_mq131/images/log.png differ diff --git a/app/documentation/example/mikroe_ozone2_mq131/images/mq131_config.png b/app/documentation/example/mikroe_ozone2_mq131/images/mq131_config.png deleted file mode 100644 index 2b768f40..00000000 Binary files a/app/documentation/example/mikroe_ozone2_mq131/images/mq131_config.png and /dev/null differ diff --git a/app/documentation/example/mikroe_ozone2_mq131/images/spidrv_config.png b/app/documentation/example/mikroe_ozone2_mq131/images/spidrv_config.png index 2a0ff270..febf8543 100644 Binary files a/app/documentation/example/mikroe_ozone2_mq131/images/spidrv_config.png and b/app/documentation/example/mikroe_ozone2_mq131/images/spidrv_config.png differ diff --git a/app/documentation/example/mikroe_pcr_xm125/README.md b/app/documentation/example/mikroe_pcr_xm125/README.md new file mode 100644 index 00000000..81ed338e --- /dev/null +++ b/app/documentation/example/mikroe_pcr_xm125/README.md @@ -0,0 +1,100 @@ +# XM125 - PCR Click (Mikroe) # + +## Summary ## + +This example project showcases the integration of the MikroE PCR Click board driver with the Silicon Labs Platform. + +PCR Click is a compact add-on board that allows you to use a pulsed coherent radar (PCR) in your application. This board features the XM125, the Entry+ PCR module from Acconeer. The XM125 uses an Acconeer A121 pulsed coherent radar system based on a patented PCR technology with picosecond time resolution. The click board makes the perfect solution for developing high-precision people presence detection with the capability to recognize movement within configurable zones, motion detection, parking space occupancy detection, etc. + +This example demonstrates the use of the PCR Click board by reading the distance between the click board and the object. The distance feature could be used to develop the high-precision people presence detection feature on smart devices. + +## Required Hardware ## + +- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) + +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [MikroE PCR Click](https://www.mikroe.com/pcr-click) + +## Hardware Connection ## + +- If the EFR32xG24 Explorer Kit is used: + + The PCR Click board supports MikroBus, so it can connect easily to Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout/ EXP Header | Temp&Hum 9 Click | + | ---------------| ------------- | ------------------ | ------------------ | + | RESET | GPIO_46 | P24 | RST | + | Module Wake Up | GPIO_47 | P26 | WUP | + | Interrupt | GPIO_48 | P28 | INT | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + +## Setup ## + +You can either create a project based on an example project or start with an empty example project. + +### Create a project based on an example project ### + +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *pcr*. + +2. Click the **Create** button on the **Third Party Hardware Drivers - XM125 - PCR Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![create_example](image/create_example.png) + +3. Build and flash this example to the board. + +### Start with an empty example project ### + +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. + +2. Copy the `app/example/mikroe_pcr_xm125/app.c` file into the project root folder (overwriting the existing file) + +3. Install the software components: + + - Open the *.slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. + + - Install the following components: + + **If the EFR32xG24 Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Services] → [Timers] → [Sleep Timer] + - [Third Party Hardware Drivers] → [Sensors] → [XM125 - PCR Click (Mikroe) - I2C] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [XM125 - PCR Click (Mikroe) - I2C] → use default configuration + +4. Build and flash this example to the board. + +**Note:** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). + +- SDK Extension must be enabled for the project to install the "XM125 - PCR Click (Mikroe) - I2C" component. + +## How It Works # + +This example demonstrates the use of the PCR Click board by reading the distance between the click board and the object. By changing your distance in front of the sensor, you can see the change in the value of the distance with high accuracy. + +You can launch Console, which is integrated into Simplicity Studio or you can use a third-party terminal tool like Tera Term to receive the data. Data is coming from the UART COM port. A screenshot of the console output is shown in the figure below. +![console_log](image/console_log.png) + +## Report Bugs & Get Support ## + +To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. + +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. \ No newline at end of file diff --git a/app/documentation/example/mikroe_pcr_xm125/image/console_log.png b/app/documentation/example/mikroe_pcr_xm125/image/console_log.png new file mode 100644 index 00000000..1ea37ca6 Binary files /dev/null and b/app/documentation/example/mikroe_pcr_xm125/image/console_log.png differ diff --git a/app/documentation/example/mikroe_pcr_xm125/image/create_example.png b/app/documentation/example/mikroe_pcr_xm125/image/create_example.png new file mode 100644 index 00000000..ab1ab744 Binary files /dev/null and b/app/documentation/example/mikroe_pcr_xm125/image/create_example.png differ diff --git a/app/documentation/example/mikroe_pcr_xm125/image/hardware_connection.png b/app/documentation/example/mikroe_pcr_xm125/image/hardware_connection.png new file mode 100644 index 00000000..5da7a35a Binary files /dev/null and b/app/documentation/example/mikroe_pcr_xm125/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_ph2/README.md b/app/documentation/example/mikroe_ph2/README.md new file mode 100644 index 00000000..f1396aed --- /dev/null +++ b/app/documentation/example/mikroe_ph2/README.md @@ -0,0 +1,110 @@ +# PH 2 Click (Mikroe) # + +## Summary ## + +This project shows the driver implementing a PH sensor with the Silicon Labs Platform. + +The PH 2 Click is a compact add-on board used to determine the alkalinity or acidity of a sample. This board features the MCP607, a low-bias current Op Amp from Microchip, performing level shifting and high-input impedance buffering in a single-supply pH-electrode circuit. This board measures hydrogen ion activity and produces an electrical potential/voltage, which can be further processed in analog or digital form. In addition to LED signaling, which is under the complete control of the user, there is also the possibility of temperature compensation by connecting an additional thermometer to the board. This Click board™ is suitable for measuring pH in various applications, including water treatment, chemical processing, medical instrumentation, and environmental test systems. + +![ph2_click](image/ph2_click.png) + +## Required Hardware ## + +- [EFR32xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [PH 2 Click board](https://www.mikroe.com/ph-2-click?srsltid=AfmBOopFxaAypm1QlxPr7ruNB82Cmh6q9HFOFmqI4PDr2ZD2F683cKg3) + +## Hardware Connection ## + +- **If the EFR32xG24 Explorer Kit is used**: + + The PH 2 Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | PH 2 Click board | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Status Signal 1 | GPIO_46 | P24 | ST1 | + | Status Signal 2 | GPIO_47 | P26 | ST2 | + | Thermometer Data | GPIO_48 | P28 | DQ | + +## Setup ## + +You can either create a project based on an example project or start with an empty example project. + +### Create a project based on an example project ### + +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *"ph 2"*. + +2. Click **Create** button on the **Third Party Hardware Drivers - PH 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) + +3. Build and flash this example to the board. + +### Start with an empty example project ### + +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. + +2. Copy the file `app/example/mikroe_ph2/app.c` into the project root folder (overwriting the existing file). + +3. Install the software components: + + - Open the .slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. + + - Install the following components: + + - **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Third Party Hardware Drivers] → [Sensors] → [PH 2 Click (Mikroe)] + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration + - [Application] → [Utility] → [Assert] + - [Third Party Hardware Drivers] → [Sensors] → [PH 2 Click (Mikroe)] + +4. Install "Printf float" + + - Open Properties of the project + - Select C/C++ Build > Settings > Tool Settings > GNU ARM C Linker > General > Check "Printf float" + +5. Build and flash this example to the board. + +**Note:** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide) + +- Third-party Drivers Extension must be enabled for the project to install "PH 2 Click (Mikroe)" component + +## How It Works ## + +After you flash the code to your board and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that your board uses the default baud rate of 115200. + +The main program first performs an offset calibration. It requires the user to disconnect the BNC connector, and then "short-circuit" it. After that, the user must adjust the offset potentiometer until the STAT LEDs stop blinking. If the STAT1 LED blinks, the user must turn clockwise otherwise if the STAT2 LED blinks, turn counter-clockwise. + +Next, the main program will perform a PH calibration. It requires the user to connect the BNC connector back to the PH 2 Click board. After that, the user must place the probe into PH neutral substance for mid-point calibration (pure water). When the calibration process is done, the program will continue to read the PH value and display it to the console. + +There is a periodic timer in the code, which determines the sampling intervals; the default sensor sampling rate is 1000 ms. If you need more frequent sampling, it is possible to change the corresponding timer value of the `app.c` file. + +In the image below you can see an example of how the output is displayed. + +![logging_screen](image/log.png) + +## Report Bugs & Get Support ## + +To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. + +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/mikroe_ph2/image/create_example.png b/app/documentation/example/mikroe_ph2/image/create_example.png new file mode 100644 index 00000000..ff95f849 Binary files /dev/null and b/app/documentation/example/mikroe_ph2/image/create_example.png differ diff --git a/app/documentation/example/mikroe_ph2/image/hardware_connection.png b/app/documentation/example/mikroe_ph2/image/hardware_connection.png new file mode 100644 index 00000000..e6824521 Binary files /dev/null and b/app/documentation/example/mikroe_ph2/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_ph2/image/log.png b/app/documentation/example/mikroe_ph2/image/log.png new file mode 100644 index 00000000..c3946046 Binary files /dev/null and b/app/documentation/example/mikroe_ph2/image/log.png differ diff --git a/app/documentation/example/mikroe_ph2/image/ph2_click.png b/app/documentation/example/mikroe_ph2/image/ph2_click.png new file mode 100644 index 00000000..b78a2dba Binary files /dev/null and b/app/documentation/example/mikroe_ph2/image/ph2_click.png differ diff --git a/app/documentation/example/mikroe_pir_pl_n823_01/README.md b/app/documentation/example/mikroe_pir_pl_n823_01/README.md index d55ae766..149631c7 100644 --- a/app/documentation/example/mikroe_pir_pl_n823_01/README.md +++ b/app/documentation/example/mikroe_pir_pl_n823_01/README.md @@ -8,29 +8,30 @@ The PIR sensor is a kind of thermal sensor that is able to detect the movement o This example reads a voltage when exposed to infrared radiation by ADC and converts it to a scaled value in millivolts (mV). - ## Required Hardware ## - [EFR32xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [Mikroe PIR Click](https://www.mikroe.com/pir-click) board based on a PL-N8230-01 infrared sensor -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- If the EFR32xG24 Explorer Kit is used: -## Hardware Connection ## + The PIR Click board supports MikroBus, so it can connect easily to Explorer Kit via MikroBus header. Assure that the 45-degree corner of the Click board matches the 45-degree white line of the Explorer Kit. -The PIR Click supports MikroBus; therefore, it can easily connect to the MikroBus header of the EFR32xG24 Explorer Kit. Make sure that the 45-degree corner of the PIR Click matches the 45-degree white line of the Explorer Kit. + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![hardware_connection](image/hardware_connection.png) -![hardware_connection](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | PIR Click | + | -------------| ------------- | ------------------ | -----------| + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -38,45 +39,49 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **pir**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *pir*. 2. Click **Create** button on the **Third Party Hardware Drivers - PL-N823-01 - PIR Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](image/create_project.png) + + ![Create_example](image/create_project.png) + +3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_pir_pl_n823_01/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - [Services] → [Timers] → [Sleep Timer] + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom** - - [Application] → [Utility] → [Log] + - [Third Party Hardware Drivers] → [Sensors] → [PL-N823-01 - PIR Click (Mikroe)] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] - [Third Party Hardware Drivers] → [Sensors] → [PL-N823-01 - PIR Click (Mikroe)] → use default configuration 4. Install **printf float** - Open Properties of the project. - - Select C/C++ Build → Settings → Tool Settings → GNU ARM C Linker → General. Check Printf float. - ![install_float](image/install_float.png) 5. Build and flash this example to the board. **Note :** -- Make sure that the SDK Extension has already been installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "PL-N823-01 - PIR Click (Mikroe)" component. Selecting this component will also include the "I2CSPM" component. @@ -98,4 +103,4 @@ You can launch Console, which is integrated into Simplicity Studio or you can us To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. -Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. \ No newline at end of file +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/mikroe_pir_pl_n823_01/image/console_log.png b/app/documentation/example/mikroe_pir_pl_n823_01/image/console_log.png index 329b835e..4b73da42 100644 Binary files a/app/documentation/example/mikroe_pir_pl_n823_01/image/console_log.png and b/app/documentation/example/mikroe_pir_pl_n823_01/image/console_log.png differ diff --git a/app/documentation/example/mikroe_pir_pl_n823_01/image/create_project.png b/app/documentation/example/mikroe_pir_pl_n823_01/image/create_project.png index 170e6d3b..38ac6581 100644 Binary files a/app/documentation/example/mikroe_pir_pl_n823_01/image/create_project.png and b/app/documentation/example/mikroe_pir_pl_n823_01/image/create_project.png differ diff --git a/app/documentation/example/mikroe_pir_pl_n823_01/image/install_float.png b/app/documentation/example/mikroe_pir_pl_n823_01/image/install_float.png deleted file mode 100644 index e6b6e9c1..00000000 Binary files a/app/documentation/example/mikroe_pir_pl_n823_01/image/install_float.png and /dev/null differ diff --git a/app/documentation/example/mikroe_pressure3_dps310/README.md b/app/documentation/example/mikroe_pressure3_dps310/README.md index 2a201333..ddfb3f7b 100644 --- a/app/documentation/example/mikroe_pressure3_dps310/README.md +++ b/app/documentation/example/mikroe_pressure3_dps310/README.md @@ -2,30 +2,45 @@ ## Summary ## -This project shows the implementation of a barometer-sensor driver using Pressure 3 Click (DPS310) from Mikroe integrated with BGM220 Explorer Kit. +This project shows the implementation of a barometer-sensor driver using Pressure 3 Click (DPS310) from Mikroe integrated with the Silicon Labs platform. ## Required Hardware ## - [**BRD4314A-BGM220** BGM220 Bluetooth Module Explorer Kit (BRD4314A-BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) -- [**Pressure 3 Click** board](https://www.mikroe.com/pressure-3-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A ](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [**Pressure 3 Click** board](https://www.mikroe.com/pressure-3-click) ## Hardware Connection ## -The Pressure 3 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220P Explorer Kit is used: + + The Pressure 3 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png "BGM220 Explorer Kit Board and Pressure 3 Click Board") + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + The hardware connection is shown in the table below: -The hardware connection is shown in the image below: + - If the I2C interface is used: -![board](image/hardware_connection.png "BGM220 Explorer Kit Board and Pressure 3 Click Board") + | Description | BRD4338A GPIO | BRD4002 EXP Header | Pressure 3 Click | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + + - If the SPI interface is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Pressure 3 click | + | -------------| ------------------------ | -------------------- | ------------------ | + | CS | GPIO_46 | P24 | CS | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | ## Setup ## @@ -33,7 +48,7 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter 'dps310'. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by 'dps310'. 2. Click **Create** button on the example: @@ -48,26 +63,37 @@ You can either create a project based on an example project or start with an emp ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_pressure3_dps310/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - [Application] → [Utility] → [Log] - - If using the SPI interface: - - [Third Party Hardware Drivers] → [Sensors] → [DPS310 - Mikroe Pressure 3 Click (SPI)] - - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe] → change the configuration for [SPI master chip select (CS) control scheme] to "CS controlled by the application" - - If using the I2C interface: - - [Third Party Hardware Drivers] → [Sensors] → [DPS310 - Mikroe Pressure 3 Click (I2C)] + - If the SPI interface is used: + - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe] → change the configuration for [SPI master chip select (CS) control scheme] to "CS controlled by the application", select the CS pin to None as below: + ![spi config](image/spi_config.png) + - [Third Party Hardware Drivers] → [Sensors] → [DPS310 - Pressure 3 Click (Mikroe) - SPI] → select the CS pin to PC03 as below: + ![pressure 3 config](image/pressure3_config.png) + - If the I2C interface is used: + - [Third Party Hardware Drivers] → [Sensors] → [DPS310 - Pressure 3 Click (Mikroe) - I2C] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - If the SPI interface is used: + - [Third Party Hardware Drivers] → [Sensors] → [DPS310 - Pressure 3 Click (Mikroe) - SPI] → use default configuration + - If the I2C interface is used: + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [DPS310 - Pressure 3 Click (Mikroe) - I2C] 4. Install printf float @@ -81,7 +107,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the Third Party Hardware Drivers extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). ## How It Works ## diff --git a/app/documentation/example/mikroe_pressure3_dps310/image/create_example.png b/app/documentation/example/mikroe_pressure3_dps310/image/create_example.png index e4fe118b..e59f273b 100644 Binary files a/app/documentation/example/mikroe_pressure3_dps310/image/create_example.png and b/app/documentation/example/mikroe_pressure3_dps310/image/create_example.png differ diff --git a/app/documentation/example/mikroe_pressure3_dps310/image/log.png b/app/documentation/example/mikroe_pressure3_dps310/image/log.png index 83563017..156f2ea3 100644 Binary files a/app/documentation/example/mikroe_pressure3_dps310/image/log.png and b/app/documentation/example/mikroe_pressure3_dps310/image/log.png differ diff --git a/app/documentation/example/mikroe_pressure3_dps310/image/pressure3_config.png b/app/documentation/example/mikroe_pressure3_dps310/image/pressure3_config.png new file mode 100644 index 00000000..3fdf60d4 Binary files /dev/null and b/app/documentation/example/mikroe_pressure3_dps310/image/pressure3_config.png differ diff --git a/app/documentation/example/mikroe_pressure3_dps310/image/spi_config.png b/app/documentation/example/mikroe_pressure3_dps310/image/spi_config.png new file mode 100644 index 00000000..febf8543 Binary files /dev/null and b/app/documentation/example/mikroe_pressure3_dps310/image/spi_config.png differ diff --git a/app/documentation/example/mikroe_pwm_driver_si8711cc/README.md b/app/documentation/example/mikroe_pwm_driver_si8711cc/README.md index 6e6f4d30..0739900d 100644 --- a/app/documentation/example/mikroe_pwm_driver_si8711cc/README.md +++ b/app/documentation/example/mikroe_pwm_driver_si8711cc/README.md @@ -2,9 +2,9 @@ ## Summary ## -This project shows the implementation of an "PWM Driver Click" driver using Si8711CC one-channel isolator from Silicon Lab with EFR32xG24 Explorer Kit. +This project shows the implementation of an "PWM Driver Click" driver using Si8711CC one-channel isolator from Silicon Labs. -If you need to control DC motors with loads up to 10A, PWM driver click is the perfect solution, thanks to the Silicon Lab Si8711CC one-channel isolator. It communicates with the target MCU over PWM pin, and runs on a 5V power supply. It can be used in a wide variety of ways, from controlling light intensity to serving as an ON/OFF switch to control DC load circuits. +If you need to control DC motors with loads up to 10A, PWM driver click is the perfect solution, thanks to the Silicon Labs Si8711CC one-channel isolator. It communicates with the target MCU over PWM pin, and runs on a 5V power supply. It can be used in a wide variety of ways, from controlling light intensity to serving as an ON/OFF switch to control DC load circuits. The Si87xx isolators are pin-compatible, one-channel, drop-in replacements for popular optocouplers with data rates up to 15 Mbps. These devices isolate highspeed digital signals and offer performance, reliability, and flexibility advantages not available with optocoupler solutions. The Si87xx series is based on proprietary CMOS isolation technology for low-power and high-speed operation and are resistant to the wear-out effects found in optocouplers that degrade performance with increasing temperature, forward current, and device age. As a result, the Si87xx series offer longer service life and dramatically higher reliability compared to optocouplers. Ordering options include open collector output with and without integrated pull-up resistor and output enable options. @@ -12,26 +12,25 @@ The click contains a P-channel DMP3010LK3 MOSFET transistor. When the click is u ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [PWM Driver Click board based on Si8711CC one-channel isolator from Silicon Lab](https://www.mikroe.com/pwm-driver-click) -- [**PWM Driver Click** board based on Si8711CC one-channel isolator from Silicon Lab](https://www.mikroe.com/pwm-driver-click). +## Hardware Connection ## -**NOTE:** -Tested boards for working with this example: +- **If EFR32xG24 Explorer Kit is used:** -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A ](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22 Bluetooth SoC Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | + The PWM Driver Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: -## Hardware Connection ## + ![board_1](image/hardware_connection.png "BRD2703A xG24 Explorer Kit Board and PWM Driver Click Board") -The PWM Driver Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -![board_1](image/hardware_connection_1.png "BRD2703A xG24 Explorer Kit Board and PWM Driver Click Board") + The hardware connection is shown in the table below: -![board_2](image/hardware_connection_2.png "BRD2703A xG24 Explorer Kit Board and PWM Driver Click Board") + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | PWM Driver Click board | + | -------------| ------------- | -------------------- | ---------------------------| + | PWM_H | GPIO_7 | P20 | PWM | ## Setup ## @@ -39,16 +38,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter 'si8711cc'. +1. From the Launcher Home, add the your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "si8711cc" -2. Click **Create** button on the **Third Party Hardware Drivers - Si8711CC - PWM Driver Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) +2. Click **Create** button on the **Third Party Hardware Drivers - Si8711CC - PWM Driver Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated -3. Build and flash this example to the board. + ![Create_example](image/create_example.png) + +3. Build and flash this example to the board ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_pwm_driver_si8711cc/app.c` into the project root folder (overwriting the existing file). @@ -60,22 +60,30 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Third-Party Hardware Drivers] → [Motor Control] → [Si8711CC - PWM Driver Click (Mikroe)] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [PWM] → [channel_0] → use default configuration + - [Third-Party Hardware Drivers] → [Motor Control] → [Si8711CC - PWM Driver Click (Mikroe)] + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - -- Third-party Hardware Drivers Extension must be enabled for the project to install "Si8711CC - PWM Driver Click (Mikroe)" component. +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide) +- Third-party Hardware Drivers Extension must be enabled for the project to install "Si8711CC - PWM Driver Click (Mikroe)" component ## How It Works ## -- You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. In this example, we build a simple application that generates a PWM signal with frequency = 1000Hz, and duty level = 10% at startup. This duty level will be increased by 10% each 2000ms. If the duty level >= 100% then the duty level will be set to 10%. +- Use a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like PuTTY to receive the logs from the virtual COM port. Note that your board uses the default baud rate of 115200. In this example, we build a simple application that generates a PWM signal with frequency = 1000Hz, and duty level = 10% at startup. This duty level will be increased by 10% each 2000ms. If the duty level >= 100% then the duty level will be set to 10%. + - A screenshot of the console output is shown in the figure below: ![usb_debug](image/log.png "USB Debug Output Data") diff --git a/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection.png b/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection.png new file mode 100644 index 00000000..0e9fe674 Binary files /dev/null and b/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_1.png b/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_1.png deleted file mode 100644 index 287f7987..00000000 Binary files a/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_1.png and /dev/null differ diff --git a/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_2.png b/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_2.png deleted file mode 100644 index 71d98895..00000000 Binary files a/app/documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_2.png and /dev/null differ diff --git a/app/documentation/example/mikroe_radar_mm5d91_00/README.md b/app/documentation/example/mikroe_radar_mm5d91_00/README.md index 7b6d7bdc..ca920b9b 100644 --- a/app/documentation/example/mikroe_radar_mm5d91_00/README.md +++ b/app/documentation/example/mikroe_radar_mm5d91_00/README.md @@ -2,8 +2,7 @@ ## Summary ## -This project shows the implementation of Radar-sensor driver using MM5D91-00 - with EFR32xG24 Explorer Kit based on UART communication. +This project shows the implementation of Radar-sensor driver using MM5D91-00 with Silicon Labs platform based on UART communication. Radar Click as its foundation uses the MM5D91-00 presence detection sensor module with an integrated mmWave technology from Jorjin Technologies Inc. It is capable of counting the number of people who passed an entrance or entered a room. It simplifies the implementation of mmWave sensors in the band of 61.0 to 61.5 GHz range. The board includes an ARM Cortex-M4F-based processor system with 1Tx 3Rx antenna and an onboard regulator. The device is beneficial for various presence sensing applications, ranging from offices and homes to commercial buildings and infrastructures. @@ -12,13 +11,28 @@ The device is beneficial for various presence sensing applications, ranging from - [EFR32xG24 Explorer Kit (BRD2703A-EFR32xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [Radar Click board based on MM5D91-00 sensors](https://www.mikroe.com/radar-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [Radar Click board based on MM5D91-00 sensors](https://www.mikroe.com/radar-click) ## Hardware Connection ## -The Radar Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The Radar Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + + ![board](image/hardware_connection.png "EFR32xG24 Explorer Kit Board and Radar Click Board") -![board](image/hardware_connection.png "EFR32xG24 Explorer Kit Board and Radar Click Board") +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Radar click | + | ----------------- | ------------------------ | -------------------- | ----------- | + | UART1_RX_PIN | GPIO_6 | P19 | TX | + | UART1_TX_PIN | GPIO_7 | P20 | RX | + | RESET | GPIO_46 | P24 | RST | + | General Purpose 0 | GPIO_47 | P26 | GP0 | + | General Purpose 1 | GPIO_48 | P28 | GP1 | + | General Purpose 2 | GPIO_49 | P30 | GP2 | ## Setup ## @@ -26,16 +40,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "MM5D91-00". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *radar*. 2. Click **Create** button on the **Third Party Hardware Drivers - MM5D91-00 - Radar Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_radar_mm5d91_00/app.c` into the project root folder (overwriting the existing file). @@ -47,24 +62,30 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: mikroe - [Application] → [Utility] → [Log] - [Third Party Hardware Drivers] → [Sensors] → [MM5D91-00 - Radar Click (Mikroe)] → use default configuration + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [MM5D91-00 - Radar Click (Mikroe)] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [UART] → disable "UART1 DMA" + 4. Enable printf float support - Open Properties of the project. - Select C/C++ Build > Settings > Tool Settings > GNU ARM C Linker > General > Check "Printf float". - ![printf_float](image/printf_float.png) - 5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "MM5D91-00 - Radar Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_radar_mm5d91_00/image/create_example.png b/app/documentation/example/mikroe_radar_mm5d91_00/image/create_example.png index 61a6ac6f..ab88b8d7 100644 Binary files a/app/documentation/example/mikroe_radar_mm5d91_00/image/create_example.png and b/app/documentation/example/mikroe_radar_mm5d91_00/image/create_example.png differ diff --git a/app/documentation/example/mikroe_radar_mm5d91_00/image/log.png b/app/documentation/example/mikroe_radar_mm5d91_00/image/log.png index 0d6c557f..366b368b 100644 Binary files a/app/documentation/example/mikroe_radar_mm5d91_00/image/log.png and b/app/documentation/example/mikroe_radar_mm5d91_00/image/log.png differ diff --git a/app/documentation/example/mikroe_radar_mm5d91_00/image/printf_float.png b/app/documentation/example/mikroe_radar_mm5d91_00/image/printf_float.png deleted file mode 100644 index e6b6e9c1..00000000 Binary files a/app/documentation/example/mikroe_radar_mm5d91_00/image/printf_float.png and /dev/null differ diff --git a/app/documentation/example/mikroe_relay2_lca717/README.md b/app/documentation/example/mikroe_relay2_lca717/README.md index a9b7fc7e..ed3e2b1e 100644 --- a/app/documentation/example/mikroe_relay2_lca717/README.md +++ b/app/documentation/example/mikroe_relay2_lca717/README.md @@ -10,13 +10,24 @@ Relay 2 click is a dual relay click board™, equipped with two single-pole soli - [A BGM220P Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) + - [A MikroE Relay 2 Click board.](https://www.mikroe.com/relay-2-click) ## Hardware Connection ## -The Relay 2 Click board can just be "clicked" into its place. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the BGM220P Explorer Kit is used: + + The Relay 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | MikroE Relay 2 Click board | + | -------------| ------------- | ------------------ | ---------------------------- | + | Relay 1 | GPIO_46 | P24 | RL1 | + | Relay 2 | GPIO_47 | P26 | RL2 | ## Setup ## @@ -24,16 +35,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **relay**. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"relay"**. 2. Click **Create** button on the **Third Party Hardware Drivers - LCA717 - Relay 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_relay2_lca717/app.c` into the project root folder (overwriting the existing file). @@ -45,17 +57,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Third Party Hardware Drivers] → [Miscellaneous] → [LCA717 - Relay 2 Click (Mikroe)] → use default configuration. - ![config](image/configuration.png) + + ![config](image/configuration.png) + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Miscellaneous] → [LCA717 - Relay 2 Click (Mikroe)] → use default configuration. + + ![config](image/configuration_si91x.png) 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "LCA717 - Relay 2 Click (Mikroe)" component. +- Third-party Drivers Extension must be enabled for the project to install "LCA717 - Relay 2 Click (Mikroe)" component. ## How It Works ## diff --git a/app/documentation/example/mikroe_relay2_lca717/image/configuration.png b/app/documentation/example/mikroe_relay2_lca717/image/configuration.png index ea82ba3b..5db7dada 100644 Binary files a/app/documentation/example/mikroe_relay2_lca717/image/configuration.png and b/app/documentation/example/mikroe_relay2_lca717/image/configuration.png differ diff --git a/app/documentation/example/mikroe_relay2_lca717/image/configuration_si91x.png b/app/documentation/example/mikroe_relay2_lca717/image/configuration_si91x.png new file mode 100644 index 00000000..31cb5f19 Binary files /dev/null and b/app/documentation/example/mikroe_relay2_lca717/image/configuration_si91x.png differ diff --git a/app/documentation/example/mikroe_relay2_lca717/image/create_example.png b/app/documentation/example/mikroe_relay2_lca717/image/create_example.png index 2f673dbd..56bd372a 100644 Binary files a/app/documentation/example/mikroe_relay2_lca717/image/create_example.png and b/app/documentation/example/mikroe_relay2_lca717/image/create_example.png differ diff --git a/app/documentation/example/mikroe_relay2_lca717/image/hardware_connection.png b/app/documentation/example/mikroe_relay2_lca717/image/hardware_connection.png index fd8ff015..ba89f9d1 100644 Binary files a/app/documentation/example/mikroe_relay2_lca717/image/hardware_connection.png and b/app/documentation/example/mikroe_relay2_lca717/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_rf_meter_ad8318/README.md b/app/documentation/example/mikroe_rf_meter_ad8318/README.md index f1920132..e457e155 100644 --- a/app/documentation/example/mikroe_rf_meter_ad8318/README.md +++ b/app/documentation/example/mikroe_rf_meter_ad8318/README.md @@ -10,26 +10,27 @@ This example can be used for testing equipment that includes RF transmitters or ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [EFR32xG24-EK2703A EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [Mikroe RF Meter Click board based on AD8318](https://www.mikroe.com/rf-meter-click-click) -- [**Mikroe RF Meter Click** board based on AD8318](https://www.mikroe.com/rf-meter-click-click). +## Hardware Connection ## -**NOTE:** -Tested boards for working with this example: +- **If EFR32xG24 Explorer Kit is used:** -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit ](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220-EK4314A - BGM220 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | + The RF Meter Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: -## Hardware Connection ## + ![hardware_connection](image/hardware_connection.png) -The RF Meter Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -The hardware connection is shown in the image below: + The hardware connection is shown in the table below: -![hardware_connection](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | The RF Meter Click board | + | -------------| ------------- | -------------------- | ---------------------------| + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -37,14 +38,15 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter **"ad8318"**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "ad8318". 2. Click **Create** button on the **Third Party Hardware Drivers - AD8318 - RF Meter Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](image/create_example.png) + + ![create_project](image/create_example.png) ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_rf_meter_ad8318/app.c` into the project root folder (overwriting existing file). @@ -56,23 +58,28 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: **vcom** - [Application] → [Utility] → [Log] - [Third Party Hardware Drivers] → [Sensors] → [AD8318 - RF Meter Click (Mikroe)] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [AD8318 - RF Meter Click (Mikroe)] + 4. Install printf float - Open Properties of the Project. - - Select C/C++ Build → Settings → Tool Settings → GNU ARM C Linker → General. Check Printf float. - ![install_float](image/install_float.png) 5. Build and flash this example to the board. **Note :** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension has already be installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install the " AD8318 - RF Meter Click (Mikroe)" component. @@ -86,7 +93,7 @@ You can either create a project based on an example project or start with an emp This example uses for measuring radio frequency power, and convert it to decibels per milliwatt value (dBm). This value is used to define signal strength in wires and cables at radio frequencies. -You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like TeraTerm to receive the data from the USB. A screenshot of the console output is shown in the figure below. +You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like TeraTerm to receive the data from the USB. Note that your board uses the default baud rate of 115200. A screenshot of the console output is shown in the figure below. ![console_log](image/console_log.png) @@ -94,4 +101,4 @@ You can launch Console that's integrated into Simplicity Studio or use a third-p To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. -Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. \ No newline at end of file +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/mikroe_rf_meter_ad8318/image/console_log.png b/app/documentation/example/mikroe_rf_meter_ad8318/image/console_log.png index 96d89854..887958e9 100644 Binary files a/app/documentation/example/mikroe_rf_meter_ad8318/image/console_log.png and b/app/documentation/example/mikroe_rf_meter_ad8318/image/console_log.png differ diff --git a/app/documentation/example/mikroe_rf_meter_ad8318/image/create_example.png b/app/documentation/example/mikroe_rf_meter_ad8318/image/create_example.png index 5dce0e77..c2e07d78 100644 Binary files a/app/documentation/example/mikroe_rf_meter_ad8318/image/create_example.png and b/app/documentation/example/mikroe_rf_meter_ad8318/image/create_example.png differ diff --git a/app/documentation/example/mikroe_rf_meter_ad8318/image/install_float.png b/app/documentation/example/mikroe_rf_meter_ad8318/image/install_float.png deleted file mode 100644 index e6b6e9c1..00000000 Binary files a/app/documentation/example/mikroe_rf_meter_ad8318/image/install_float.png and /dev/null differ diff --git a/app/documentation/example/mikroe_rng/README.md b/app/documentation/example/mikroe_rng/README.md index e43799a3..9a5c7b11 100644 --- a/app/documentation/example/mikroe_rng/README.md +++ b/app/documentation/example/mikroe_rng/README.md @@ -6,18 +6,6 @@ This project shows the driver implementation of a random number generator (RNG) RNG Click (random number generator) is a device that generates a sequence of numbers or symbols that cannot be reasonably predicted better than by a random chance. This Click board™ is true hardware random-number generator (HRNG), which generate genuinely random numbers. Random number generators have applications in gambling, statistical sampling, computer simulation, cryptography, completely randomized design, and various other areas. -RNG Click is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket. - -![rng_click](image/rng_click.png) - -In computing, a hardware random number generator (HRNG) or true random number generator (TRNG) is a device that generates random numbers from a physical process, rather than by means of an algorithm. Such devices are often based on microscopic phenomena that generate low-level, statistically random "noise" signals, which is the case in this Click board™. That process is, in theory, completely unpredictable, and the theory's assertions of unpredictability are subject to experimental test. This is in contrast to the paradigm of pseudo-random number generation, which is commonly implemented by the software. - -![rng_click_details](image/rng_click_details.png) - -The heart of the RNG click is the avalanche noise generated from an internal diode of the transistor Q1 (BC846B). Avalanche breakdown is a phenomenon that can occur in both insulating and semiconducting materials. It is a form of electric current multiplication that can allow very large currents within materials which are otherwise good insulators. The avalanche process occurs when carriers in the transition region are accelerated by the electric field to energies sufficient to create mobile or free electron-hole pairs via collisions with bound electrons. In order to achieve that, RNG click has also boost converter onboard, which is based on TPS61041, from Texas Instruments, and it creates the +18V power supply for the job. - -The noise signal, created by the transistors Q1 and Q2 is then amplified with Q3, voltage-limited using the Zener diode and digitalized using the NC7S14M5X inverter, from Fairchild Semiconductor. After that, the string of random ones and zeros is achieved, which is brought to the ADS1115 - 16 bit sigma-delta ADC, from Texas Instruments. The potentiometer P1 is used to set as near as possible distribution of ones and zeros, which is indicated by the LD2 and LD3 LED diodes. The potentiometer P1 should be set in a way that the LD2 and LD3 diodes illuminate as equally as possible. That way, when the single-shot measurement is performed using the ADS1115, over the I2C protocol, the true, 16-bit random number is obtained. - This Click Board™ uses I2C communication interface. It is designed to be operated only with 3.3V logic levels. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 5V. ![rng_driver_layer](image/driver_layer.png) @@ -26,24 +14,26 @@ This Click Board™ uses I2C communication interface. It is designed to be opera - [**XG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [**RNG Click**](https://www.mikroe.com/rng-click) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- If the EFR32xG24 Explorer Kit is used: -## Hardware Connection ## + The RNG Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. -The RNG Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | RNG Click | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -51,18 +41,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "rng". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "rng". 2. Click **Create** button on the **Third Party Hardware Drivers - RNG Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file 'app/example/mikroe_rng/app.c' into the project root folder (overwriting the existing file). +2. Copy the file `app/example/mikroe_rng/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: @@ -72,22 +63,42 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Third Party Hardware Drivers] → [Miscellaneous] → [RNG Click (Mikroe)] -4. Build and flash this example to the board. + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Miscellaneous] → [RNG Click (Mikroe)] + +4. Install printf float + + - Open Properties of the project. + + - Select C/C++ Build > Settings > Tool Settings >GNU ARM C Linker > General. Check Printf float. + +5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Drivers Extension must be enabled for the project to install "RNG Click (Mikroe)" component. ## How It Works ## -After you flashed the code to the Explorer Kit and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the EFR32xG24 Explorer Kit board uses the default baud rate of 115200. +### Driver Layer Diagram ### + +![logging_screen](image/driver_layer.png) + +### Testing ### + +After you flashed the code to your board and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the Silicon Labs's board uses the default baud rate of 115200. In the below image, you can see an example of how the output is displayed. The main program reads the raw ADC value from the sensor. diff --git a/app/documentation/example/mikroe_rng/image/create_example.png b/app/documentation/example/mikroe_rng/image/create_example.png index 734ec4a8..b9466af5 100644 Binary files a/app/documentation/example/mikroe_rng/image/create_example.png and b/app/documentation/example/mikroe_rng/image/create_example.png differ diff --git a/app/documentation/example/mikroe_rng/image/rng_click.png b/app/documentation/example/mikroe_rng/image/rng_click.png deleted file mode 100644 index 03909397..00000000 Binary files a/app/documentation/example/mikroe_rng/image/rng_click.png and /dev/null differ diff --git a/app/documentation/example/mikroe_rng/image/rng_click_details.png b/app/documentation/example/mikroe_rng/image/rng_click_details.png deleted file mode 100644 index 3a72db02..00000000 Binary files a/app/documentation/example/mikroe_rng/image/rng_click_details.png and /dev/null differ diff --git a/app/documentation/example/mikroe_rtc10_ds3231m/README.md b/app/documentation/example/mikroe_rtc10_ds3231m/README.md index 076c9bce..a91f8e34 100644 --- a/app/documentation/example/mikroe_rtc10_ds3231m/README.md +++ b/app/documentation/example/mikroe_rtc10_ds3231m/README.md @@ -10,26 +10,31 @@ This example can be used to demonstrate the capability of maintaining timekeepin ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [**Mikroe RTC 10 Click**](https://www.mikroe.com/rtc-10-click) board is based on the DS3231M. +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220-EK4314A - BGM220P Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [**Mikroe RTC 10 Click**](https://www.mikroe.com/rtc-10-click) board is based on the DS3231M ## Hardware Connection ## -The RTC Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The RTC Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + + ![hardware_connection](image/hardware_connection.png) -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![hardware_connection](image/hardware_connection.png) + The hardware connection is shown in the table below: + + | Description | BRD4338 | BRD4002 Breakout | Mikroe RTC 10 Click | + | ----------------------| -----------| -----------------| ---------------------| + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Reset Out | GPIO_46 | P24 | RST | + | Analog ECG signal OUT | GPIO_47 | P26 | AN | + | Interrupt OUT | GPIO_48 | P28 | INT | ## Setup ## @@ -37,31 +42,38 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter **"rtc"**. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *rtc*. 2. Click **Create** button on the **Third Party Hardware Drivers - DS3231M - RTC10 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](image/create_project.png) + + ![create_example](image/create_project.png) + +3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the app.c file (located in the `app/example/mikroe_rtc10_ds3231m` folder) into the project root folder (overwriting existing file). 3. Install the software components: - - Open the .slcp file in the project. + - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. + - Select the SOFTWARE COMPONENTS tab. - - Install the following components: + - Install the following components: - - [Services] → [Timers] → [Sleep Timer] + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom** - - [Application] → [Utility] → [Log] + - [Third Party Hardware Drivers] → [Clock & Timing] → [DS3231M - RTC 10 Click (Mikroe)] → use default configuration + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] - [Third Party Hardware Drivers] → [Clock & Timing] → [DS3231M - RTC 10 Click (Mikroe)] → use default configuration 4. Install printf float @@ -74,9 +86,11 @@ You can either create a project based on an example project or start with an emp 5. Build and flash this example to the board. -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +**Note**: + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install the "DS3231M - RTC 10 Click (Mikroe)" component. Selecting this component will also include the "I2CSPM" component with "mikroe" instance. +- Third-party Drivers Extension must be enabled for the project to install the **DS3231M - RTC 10 Click (Mikroe)** component. ## How It Works ## diff --git a/app/documentation/example/mikroe_rtc10_ds3231m/image/create_project.png b/app/documentation/example/mikroe_rtc10_ds3231m/image/create_project.png index 03490209..377e5f8c 100644 Binary files a/app/documentation/example/mikroe_rtc10_ds3231m/image/create_project.png and b/app/documentation/example/mikroe_rtc10_ds3231m/image/create_project.png differ diff --git a/app/documentation/example/mikroe_servo_pca9685/README.md b/app/documentation/example/mikroe_servo_pca9685/README.md index de3a9174..f14da945 100644 --- a/app/documentation/example/mikroe_servo_pca9685/README.md +++ b/app/documentation/example/mikroe_servo_pca9685/README.md @@ -10,28 +10,31 @@ This example can be used to demonstrate the capability of controlling the servo ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [**Mikroe Servo Click**](https://www.mikroe.com/servo-click) board is based on the PCA9685. +- [**Mikroe Servo Click**](https://www.mikroe.com/servo-click) board is based on the PCA9685 -- Servo Motor GS-90. +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220-EK4314A - BGM220P Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- Servo Motor GS-90 ## Hardware Connection ## -The Servo Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The MIC 2 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![board](image/hardware_connection.png) -![hardware_connection](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP/Breakout Header | MIC 2 Click | + | --------------------- | ------------- | --------------------------- | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Output Enable | GPIO_46 | P24 | OE | ## Setup ## @@ -39,16 +42,16 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter **"servo"**. +1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"servo"**. 2. Click **Create** button on the **Third Party Hardware Drivers - PCA9685 - Servo Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. ![create_project](image/create_project.png) ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file `app/example/mikroe_servo_pca9685/app.c` (overwriting existing file), into the project root folder. +2. Copy the file `app/example/mikroe_servo_pca9685/app.c` into the project root folder (overwriting existing file). 3. Install the software components: @@ -58,19 +61,26 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom** - - [Application] → [Utility] → [Log] - + - [Platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: mikroe - [Third Party Hardware Drivers] → [Sensors] → [PCA9685 - Servo Click (Mikroe)] → use default configuration + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [PCA9685 - Servo Click (Mikroe)] → use the default configuration 4. Build and flash this example to the board. -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +**Note:** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install the "PCA9685 - Servo Click (Mikroe)" component. Selecting this component will also include the "I2CSPM" component with "mikroe" instance. +- SDK Extension must be enabled for the project to install the "PCA9685 - Servo Click (Mikroe)" component. Selecting this component will also include the "I2CSPM" component with instance "mikroe". ## How It Works ## diff --git a/app/documentation/example/mikroe_servo_pca9685/image/console_log.png b/app/documentation/example/mikroe_servo_pca9685/image/console_log.png index 785dc1f1..f9fecda7 100644 Binary files a/app/documentation/example/mikroe_servo_pca9685/image/console_log.png and b/app/documentation/example/mikroe_servo_pca9685/image/console_log.png differ diff --git a/app/documentation/example/mikroe_servo_pca9685/image/create_project.png b/app/documentation/example/mikroe_servo_pca9685/image/create_project.png index 8575e76c..581ab014 100644 Binary files a/app/documentation/example/mikroe_servo_pca9685/image/create_project.png and b/app/documentation/example/mikroe_servo_pca9685/image/create_project.png differ diff --git a/app/documentation/example/mikroe_servo_pca9685/image/hardware_connection.png b/app/documentation/example/mikroe_servo_pca9685/image/hardware_connection.png index 402700c8..024b6594 100644 Binary files a/app/documentation/example/mikroe_servo_pca9685/image/hardware_connection.png and b/app/documentation/example/mikroe_servo_pca9685/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_smoke2_adpd188bi/README.md b/app/documentation/example/mikroe_smoke2_adpd188bi/README.md index 8cac4f1b..dcd42912 100644 --- a/app/documentation/example/mikroe_smoke2_adpd188bi/README.md +++ b/app/documentation/example/mikroe_smoke2_adpd188bi/README.md @@ -1,37 +1,36 @@ -# ADPD188BI Smoke 2 Click (Mikroe) # +# ADPD188BI - Smoke 2 Click (Mikroe) # ## Summary ## +This project shows the driver implementation of the Smoke 2 Click module, which implements the ADPD188BI IC with the Silicon Labs Platform. + Smoke 2 Click is based on the ADPD188BI, a complete photometric system for smoke detection using optical dual-wavelength technology from Analog Devices. The module combines the dual photodetector with two separate LEDs and a mixed-signal photometric front-end ASIC, and prevents light from going directly from the LED to the photodiode without first entering the smoke detection chamber. The dual-wavelength combination in a scattering measurement, a 470nm blue LED and an 850nm IR LED, allows particle size discrimination between different types of smoke, dust, or steam. The core circuitry stimulates the LEDs and measures the corresponding optical return signals. This integrated solution enables low power and reduces false smoke alarms in harsh environments due to dust, steam, and other nuisance sources. ![Intro_1](image/smoke2_click_details.png) -The smoke chamber 28800X is designed to be used with the ADPD188BI and minimize background response while controlling the environment around the ADPD188BI module by limiting dust accumulation and keeping out insects. The ADPD188BI registers a positive signal due to light scattering from the smoke chamber. Although the smoke chamber minimizes this positive signal, there is a nonzero response in the absence of smoke. When using a smoke chamber, this background response must be accounted for if you want to accurately measure the level of particles present in the smoke chamber. - -The ADPD188BI operates in one of the following three modes: Standby, Program, or Normal Sampling Mode. Standby Mode is a power-saving mode in which data collection does not occur, while the Program Mode configures and program registers. During regular operation, the ADPD188BI pulses light and collects data, and in this mode, power consumption depends on the pulse count and data rate. Besides, the ADPD188BI also requires a supply voltage of 1.8V to work regularly. Therefore, a small regulating LDO, the ADP160 from Analog Devices, provides a 1.8V out of 3.3V mikroBUS™ rail, or optionally, from a battery power source. - -Smoke 2 Click provides the possibility of using both I2C and SPI serial interfaces, although only one is allowed at any given time in the actual application. All internal registers of the ADPD188BI are accessed through the selected communications interface. I2C supports Fast mode with data transfer of 400 kbps, while SPI interface support frequency up to 10MHz. This selection can be performed by positioning SMD jumpers labeled as COMM SEL to an appropriate position. Note that all the jumpers must be lined to the same side, or else the Click board™ may become unresponsive. - ## Required Hardware ## - [**XG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [**Smoke 2 Click**](https://www.mikroe.com/smoke-2-click) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- **If the EFR32xG24 Explorer Kit is used**: -## Hardware Connection ## + The Smoke 2 Click board supports MikroBus, so it can connect easily to MikroBus header of EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. The hardware connection is shown in the image below: -The Smoke 2 Click board supports MikroBus, so it can connect easily to MikroBus header of EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. The hardware connection is shown in the image below: + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + | Description | BRD4338A GPIO | BRD4002 Breakout | Smoke 2 Click Board | + | ------------ | ------------- | ------------------ | ------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | GPIO_INT | GPIO_46 | P24 | INT | ## Setup ## @@ -39,17 +38,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "smoke". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by **"smoke"**. + +2. Click on the **Create** button on the **Third Party Hardware Drivers - Smoke 2 Click (Mikroe) - I2C** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) -2. Click **Create** button on the **Third Party Hardware Drivers - Smoke 2 Click (Mikroe) - I2C** example if user want to uses with I2C interface or **Third Party Hardware Drivers - Smoke 2 Click (Mikroe) - SPI** example if user want to uses with SPI interface. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file 'app/example/mikroe_smoke2_adpd188bi/app.c' into the project root folder (overwriting the existing file). +2. Copy the file `app/example/mikroe_smoke2_adpd188bi/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: @@ -59,18 +60,27 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] → [Sensors] → [ADPD188BI - Smoke 2 Click (Mikroe) - I2C] or [ADPD188BI - Smoke 2 Click (Mikroe) - SPI] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: **mikroe** + - [Third Party Hardware Drivers] → [Sensors] → [ADPD188BI - Smoke 2 Click (Mikroe) - I2C] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [ADPD188BI - Smoke 2 Click (Mikroe) - I2C] + - If using the I2C interface: [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third-party Drivers Extension must be enabled for the project to install "ADPD188BI - Smoke 2 Click (Mikroe) - I2C" or "ADPD188BI - Smoke 2 Click (Mikroe) - SPI" component. +- Third-party Drivers Extension must be enabled for the project to install "ADPD188BI - Smoke 2 Click (Mikroe) - I2C" component. ## How It Works ## diff --git a/app/documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png b/app/documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png index ddd854a9..fd05c1e9 100644 Binary files a/app/documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png and b/app/documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png differ diff --git a/app/documentation/example/mikroe_smoke2_adpd188bi/image/hardware_connection.png b/app/documentation/example/mikroe_smoke2_adpd188bi/image/hardware_connection.png index 8e7a2227..3837264d 100644 Binary files a/app/documentation/example/mikroe_smoke2_adpd188bi/image/hardware_connection.png and b/app/documentation/example/mikroe_smoke2_adpd188bi/image/hardware_connection.png differ diff --git a/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_1.png b/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_1.png index edeba754..f587a84e 100644 Binary files a/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_1.png and b/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_1.png differ diff --git a/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_2.png b/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_2.png index c4afb18f..7094d1dd 100644 Binary files a/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_2.png and b/app/documentation/example/mikroe_smoke2_adpd188bi/image/log_2.png differ diff --git a/app/documentation/example/mikroe_stepper2_a4988/README.md b/app/documentation/example/mikroe_stepper2_a4988/README.md index 11f6f36a..b854667f 100644 --- a/app/documentation/example/mikroe_stepper2_a4988/README.md +++ b/app/documentation/example/mikroe_stepper2_a4988/README.md @@ -12,13 +12,6 @@ Stepper 2 click is a complete solution for driving bipolar stepper motors with f - [**Stepper 2 Click** board based on A4988 IC](https://www.mikroe.com/stepper-2-click) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | - ## Hardware Connection ## The Stepper 2 Click Board™ supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. In this example, we use a 28BYJ-48 12V stepper motor, so the +12V power supply and GND are connected to the Stepper 2 Click Board™. Also, four control signals for the stepper motor are connected to pins 1A, 1B, 2A, and 2B respectively. The hardware connection is shown in the image below: diff --git a/app/documentation/example/mikroe_stepper_a3967/README.md b/app/documentation/example/mikroe_stepper_a3967/README.md index 60121b89..0322f8aa 100644 --- a/app/documentation/example/mikroe_stepper_a3967/README.md +++ b/app/documentation/example/mikroe_stepper_a3967/README.md @@ -8,29 +8,30 @@ Stepper click is a complete solution for driving bipolar stepper motors with ful ## Required Hardware ## -### Silabs Development Kits ### - - [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -### External Hardware ### +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) - [Stepper Click](https://www.mikroe.com/stepper-click) - [Step Motor 5v](https://www.mikroe.com/step-motor-5v) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- If the EFR32xG24 Explorer Kit is used: -## Hardware Connection ## + The Stepper Click board supports MikroBus. Therefore, it can connect easily to the MikroBus header of the Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. In this example, we use a 28BYJ-48 5V stepper motor, so the +5V power supply and GND are connected to the Stepper Click Board™. Also, four control signals for the stepper motor are connected to pins 1A, 1B, 2A, and 2B respectively. + + ![board](image/hardware_connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -The Stepper Click Board™ supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white line of the Silicon Labs Explorer Kit. In this example, we use a 28BYJ-48 5V stepper motor, so the +5V power supply and GND are connected to the Stepper Click Board™. Also, four control signals for the stepper motor are connected to pins 1A, 1B, 2A, and 2B respectively. The hardware connection is shown in the image below: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Stepper Click | + | ----------------| ------------- | -------------------- | ---------------------------- | + | Step size bit 1 | GPIO_48 | P28 | MS1 | + | Step size bit 2 | GPIO_49 | P30 | MS2 | + | Direction | GPIO_47 | P26 | DIR | + | Step trigger | GPIO_46 | P24 | STP | ## Setup ## @@ -38,16 +39,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter "stepper". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "stepper". 2. Click **Create** button on the **Third Party Hardware Drivers - A3967 - Stepper Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_stepper_a3967/app.c` into the project root folder (overwriting existing file). @@ -58,16 +60,22 @@ You can either create a project based on an example project or start with an emp - Select the SOFTWARE COMPONENTS tab. - Install the following components: + + **If the EFR32xG24 Explorer Kit is used:** - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Third-Party Hardware Drivers] → [Motor Control] → [A3967 - Stepper Click (Mikroe)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Third-Party Hardware Drivers] → [Motor Control] → [A3967 - Stepper Click (Mikroe)] + 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third-party Drivers Extension must be enabled for the project to install "A3967 - Stepper Click (Mikroe)" component. +- Third-party Drivers Extension must be enabled for the project to install **"A3967 - Stepper Click (Mikroe)"** component. ## How It Works ## diff --git a/app/documentation/example/mikroe_stepper_a3967/image/create_example.png b/app/documentation/example/mikroe_stepper_a3967/image/create_example.png index 959c5cc1..8971bcf0 100644 Binary files a/app/documentation/example/mikroe_stepper_a3967/image/create_example.png and b/app/documentation/example/mikroe_stepper_a3967/image/create_example.png differ diff --git a/app/documentation/example/mikroe_stretch/README.md b/app/documentation/example/mikroe_stretch/README.md index 705f17a7..b0ccc094 100644 --- a/app/documentation/example/mikroe_stretch/README.md +++ b/app/documentation/example/mikroe_stretch/README.md @@ -8,35 +8,41 @@ Stretch Click is a compact add-on board for measuring stretch forces with conduc ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [Mikroe Stretch Click](https://www.mikroe.com/stretch-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220-EK4314A - BGM220 Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- [Mikroe Stretch Click](https://www.mikroe.com/stretch-click) ## Hardware Connection ## -The Stretch Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The Stretch Click board supports MikroBus, so it can connect easily to Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![hardware_connection](image/hardware_connection.png) -![hardware_connection](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Stretch Click | + | ----------------------| ---------------| ---------------------| -------------------- | + | Positive analog input | ULP_GPIO_1 | P16 | OUT | + | Negative analog input | ULP_GPIO_7 | EXP_HEADER-15 to GND | -- | + | LED control | GPIO_46 | P24 | PWM | ## Setup ## You can either create a project based on an example project or start with an empty example project. -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter **"stretch"**. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *stretch*. 2. Click **Create** button on the **Third Party Hardware Drivers - Stretch Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_project](image/create_example.png) + + ![Create_example](image/create_example.png) + +3. Build and flash this example to the board. ### Start with an empty example project ### @@ -52,16 +58,24 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: **vcom** - [Application] → [Utility] → [Log] - [Services] → [Timers] → [Sleep Timer] - - [Third Party Hardware Drivers] → [Sensors] → [Stretch Click (Mikroe)] → use the default configuration. + - [Third Party Hardware Drivers] → [Sensors] → [Stretch Click (Mikroe)] → use the default configuration. + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] → [channel_1] → use default configuration + - [Third Party Hardware Drivers] → [Sensors] → [Stretch Click (Mikroe)] 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install the "Stretch Click (Mikroe)" component. Selecting this component will also include "IADC" component. @@ -71,7 +85,7 @@ You can either create a project based on an example project or start with an emp ![software_layer](image/software_layer.png) -**Software Component** +### Software Component ### ![software_componet](image/software_component.png) @@ -79,13 +93,11 @@ You can either create a project based on an example project or start with an emp This example reads the ADC value. With ADC value, you can get stretch of the cord. -You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like TeraTerm to receive the data from the USB. A screenshot of the console output is shown in the figure below. +After the sensor is initialed successfully, the application reads the analog signal every 500 milliseconds. Right after getting this value, it will be converted to a Decibel value. -![console_log](image/console_log.png) - -This example uses the IADC0 to read the analog signal. After the sensor is initialed successfully, the application reads the analog signal every 500 milliseconds. Right after getting this value, it will be converted to a Decibel value. +To test the functionality, you can change the length of the Rubber Cord which be connected between two Alligator Clamps. The ADC value will be reduce when the length of the cord shorter and vice versa. If the ADC value lower than 500 (you can change this value on file `app/example/mikroe_stretch/app.c`), LED on Stretch click board will be turn on. Then you will see the ADC value change on the console in Simplicity Studio or other third-party terminal tools. A screenshot of the console output is shown in the figure below. -To test the functionality, you can change the length of the Rubber Cord which be connected between two Alligator Clamps. The ADC value will be reduce when the length of the cord shorter and vice versa. If the ADC value lower than 500 (you can change this value on file `app/example/mikroe_stretch/app.c`), LED on Stretch click board will be turn on. Then you will see the ADC value change on the console in Simplicity Studio or other third-party terminal tools. +![console_log](image/console_log.png) ## Report Bugs & Get Support ## diff --git a/app/documentation/example/mikroe_stretch/image/console_log.png b/app/documentation/example/mikroe_stretch/image/console_log.png index 2edf4877..24394d83 100644 Binary files a/app/documentation/example/mikroe_stretch/image/console_log.png and b/app/documentation/example/mikroe_stretch/image/console_log.png differ diff --git a/app/documentation/example/mikroe_stretch/image/create_example.png b/app/documentation/example/mikroe_stretch/image/create_example.png index 54c742da..56e7c015 100644 Binary files a/app/documentation/example/mikroe_stretch/image/create_example.png and b/app/documentation/example/mikroe_stretch/image/create_example.png differ diff --git a/app/documentation/example/mikroe_temphum15_sht40/README.md b/app/documentation/example/mikroe_temphum15_sht40/README.md index 1fed4904..167a9968 100644 --- a/app/documentation/example/mikroe_temphum15_sht40/README.md +++ b/app/documentation/example/mikroe_temphum15_sht40/README.md @@ -10,22 +10,26 @@ Temp-Hum 15 click is a smart temperature and humidity sensing Click Board™, pa - [**BGM220-EK4314A** BGM220 Bluetooth Module Explorer Kit (BRD4314A BGM220 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [**Temp&Hum 15 Click** board based on SHT40 sensor](https://www.mikroe.com/temphum-15-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | +- [**Temp&Hum 15 Click** board based on SHT40 sensor](https://www.mikroe.com/temphum-15-click) ## Hardware Connection ## -The Temp&Hum 15 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the 45-degree corner of the Click Board™ matches the 45-degree white-line of the Silicon Labs Explorer Kit. +- If the BGM220P Explorer Kit is used: + + The Temp&Hum 15 Click board supports MikroBus, so it can connect easily to Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | Temp&Hum 9 Click | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -33,16 +37,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter sht40. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *sht40*. 2. Click **Create** button on the **Third Party Hardware Drivers - SHT40 - Temp&Hump 15 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_temphum15_sht40/app.c` into the project root folder (overwriting the existing file). @@ -54,34 +59,39 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Third Party Hardware Drivers] → [Sensors] → [SHT40 - Temp&Hump 15 Click (Mikroe)] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [SHT40 - Temp&Hump 15 Click (Mikroe)] + 4. Install printf float - Open Properties of the Project. - - Select C/C++ Build > Settings > Tool Settings >GNU ARM C Linker > General. Check Printf float. - ![float](image/float.png) - 5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Drivers Extension must be enabled for the project to install "SHT40 - Temp&Hump 15 Click (Mikroe)" component. ## How It Works ## -After you flashed the code to the Explorer Kit and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the BGM220P board uses the default baud rate of 115200. +After you flashed the code to your board and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the board uses the default baud rate of 115200. In the below image, you can see an example of how the output is displayed. The application returns the measured temperature and humidity values automatically. -There is a timer in the code, which determines the sampling intervals; the default sensor sampling rate is 1 second. If you need more frequent sampling, it is possible to change the corresponding timer value of the app.c file. +There is a timer in the code, which determines the sampling intervals; the default sensor sampling rate is 1 second. If you need more frequent sampling, it is possible to change the corresponding timer value of the `app.c` file. ![logging_screen](image/log.png) diff --git a/app/documentation/example/mikroe_temphum15_sht40/image/create_example.png b/app/documentation/example/mikroe_temphum15_sht40/image/create_example.png index cd66b07a..1cc2ceec 100644 Binary files a/app/documentation/example/mikroe_temphum15_sht40/image/create_example.png and b/app/documentation/example/mikroe_temphum15_sht40/image/create_example.png differ diff --git a/app/documentation/example/mikroe_temphum15_sht40/image/float.png b/app/documentation/example/mikroe_temphum15_sht40/image/float.png deleted file mode 100644 index e6b6e9c1..00000000 Binary files a/app/documentation/example/mikroe_temphum15_sht40/image/float.png and /dev/null differ diff --git a/app/documentation/example/mikroe_temphum15_sht40/image/log.png b/app/documentation/example/mikroe_temphum15_sht40/image/log.png index 39cdb4e8..f1204160 100644 Binary files a/app/documentation/example/mikroe_temphum15_sht40/image/log.png and b/app/documentation/example/mikroe_temphum15_sht40/image/log.png differ diff --git a/app/documentation/example/mikroe_temphum9_shtc3/README.md b/app/documentation/example/mikroe_temphum9_shtc3/README.md index 8fe1e7d7..3a31e9cb 100644 --- a/app/documentation/example/mikroe_temphum9_shtc3/README.md +++ b/app/documentation/example/mikroe_temphum9_shtc3/README.md @@ -12,13 +12,13 @@ Temp-Hum 9 click is a smart temperature and humidity sensing click board™, pac - Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -- [**Temp&Hum 9 Click** board based on SHTC3 sensor](https://www.mikroe.com/temphum-9-click). +- [**Temp&Hum 9 Click** board based on SHTC3 sensor](https://www.mikroe.com/temphum-9-click) ## Hardware Connection ## - If the BGM220P Explorer Kit is used: - The Temp&Hum 9 Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + The Temp&Hum 9 Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: @@ -39,15 +39,9 @@ You can either create a project based on an example project or start with an emp 1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *shtc3*. -2. Click **Create** button on the project: +2. Click **Create** button on the **Third Party Hardware Drivers - SHTC3 - Temp&Hump 9 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - - **Third Party Hardware Drivers - SHTC3 - Temp&Hump 9 Click (Mikroe)** example if the BGM220P Explorer Kit is used. - ![Create_example](image/create_example_1.png) - - - **Third Party Hardware Drivers - SHTC3 - Temp&Hump 9 Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used. - ![Create_example](image/create_example_2.png) - - Example project creation dialog pops up -> click Create and Finish and Project should be generated. + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. @@ -90,7 +84,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "SHTC3 - Temp&Hump 9 Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_temphum9_shtc3/image/create_example.png b/app/documentation/example/mikroe_temphum9_shtc3/image/create_example.png new file mode 100644 index 00000000..19d133bc Binary files /dev/null and b/app/documentation/example/mikroe_temphum9_shtc3/image/create_example.png differ diff --git a/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png b/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png deleted file mode 100644 index 3c5811f0..00000000 Binary files a/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png and /dev/null differ diff --git a/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png b/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png deleted file mode 100644 index 75be4a06..00000000 Binary files a/app/documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png and /dev/null differ diff --git a/app/documentation/example/mikroe_temphum9_shtc3/image/log.png b/app/documentation/example/mikroe_temphum9_shtc3/image/log.png index 24fb76e6..294d5623 100644 Binary files a/app/documentation/example/mikroe_temphum9_shtc3/image/log.png and b/app/documentation/example/mikroe_temphum9_shtc3/image/log.png differ diff --git a/app/documentation/example/mikroe_thunder_as3935/README.md b/app/documentation/example/mikroe_thunder_as3935/README.md index b98d8654..07caef43 100644 --- a/app/documentation/example/mikroe_thunder_as3935/README.md +++ b/app/documentation/example/mikroe_thunder_as3935/README.md @@ -10,15 +10,29 @@ Thunder Click is a compact add-on board that detects the presence and proximity - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [Thunder Click](https://www.mikroe.com/thunder-click) ## Hardware Connection ## -The Thunder Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The Thunder Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. + + The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) -The hardware connection is shown in the image below: +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | Thunder Click | + | ------------------------ | ------------- | ------------------ | ----------------- | + | IRQ | GPIO_46 | P24 | IRQ | + | CS | GPIO_47 | P26 | CS | + | RTE_SSI_MASTER_SCK_PIN | GPIO_25 | P25 | SCK | + | RTE_SSI_MASTER_MOSI_PIN | GPIO_26 | P27 | SDI | + | RTE_SSI_MASTER_MISO_PIN | GPIO_27 | P29 | SDO | ## Setup ## @@ -26,16 +40,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter thunder. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *thunder*. -2. Click **Create** button on the **Third Party Hardware Drivers - Thunder Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) +2. Click **Create** button on the **Third Party Hardware Drivers - AS3935 - Thunder Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_thunder_as3935/app.c` into the project root folder (overwriting the existing file). @@ -47,25 +62,31 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] → [Sensors] → [AS3935 - Thunder Click (Mikroe)] + - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe] → change the configuration for [SPI master chip select (CS) control scheme] to "CS controlled by the application", select the CS pin to None as below: + ![spi config](image/spi_config.png) + - [Third Party Hardware Drivers] → [Sensors] → [AS3935 - Thunder Click (Mikroe)] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** -4. Modify the SPIDRV configuration of Mikroe instance as below. - ![mikroe spi config](image/mikroe_spi_config.png) + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [AS3935 - Thunder Click (Mikroe)] → use default config -5. Build and flash this example to the board. +4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Drivers Extension must be enabled for the project to install "Thunder Click (Mikroe)" component. ## How It Works ## -After you flashed the code to the Explorer Kit and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the EFR32xG24 Explorer Kit board uses the default baud rate of 115200. +After you flashed the code to the Explorer Kit and powered the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. In the below image, you can see an example of how the output is displayed. The application returns the energy and the distance of the storm if lighting is detected. Otherwise, it will display "noise" or "disturber" if one of them is detected. diff --git a/app/documentation/example/mikroe_thunder_as3935/image/create_example.png b/app/documentation/example/mikroe_thunder_as3935/image/create_example.png index 481762b6..9d240548 100644 Binary files a/app/documentation/example/mikroe_thunder_as3935/image/create_example.png and b/app/documentation/example/mikroe_thunder_as3935/image/create_example.png differ diff --git a/app/documentation/example/mikroe_thunder_as3935/image/mikroe_spi_config.png b/app/documentation/example/mikroe_thunder_as3935/image/mikroe_spi_config.png deleted file mode 100644 index ab57d703..00000000 Binary files a/app/documentation/example/mikroe_thunder_as3935/image/mikroe_spi_config.png and /dev/null differ diff --git a/app/documentation/example/mikroe_thunder_as3935/image/result.png b/app/documentation/example/mikroe_thunder_as3935/image/result.png index 242c316b..07bb8e19 100644 Binary files a/app/documentation/example/mikroe_thunder_as3935/image/result.png and b/app/documentation/example/mikroe_thunder_as3935/image/result.png differ diff --git a/app/documentation/example/mikroe_thunder_as3935/image/spi_config.png b/app/documentation/example/mikroe_thunder_as3935/image/spi_config.png new file mode 100644 index 00000000..febf8543 Binary files /dev/null and b/app/documentation/example/mikroe_thunder_as3935/image/spi_config.png differ diff --git a/app/documentation/example/mikroe_turbidity_tsd10/README.md b/app/documentation/example/mikroe_turbidity_tsd10/README.md index 9d1f643d..5bbd5be7 100644 --- a/app/documentation/example/mikroe_turbidity_tsd10/README.md +++ b/app/documentation/example/mikroe_turbidity_tsd10/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project shows the implementation of a Turbidity driver using Turbidity Click and TSD10 sensor with an EFR32xG24 explorer kit. +This project shows the implementation of a Turbidity driver using Turbidity Click and TSD10 sensor with the Silicon Labs Platform. Turbidity Click Bundle: This bundle gives you everything you need to take high-accuracy turbidity measurements. It allows users to combine Turbidity Sensor with Turbidity Click via an additional 3-wire Male to Male Cable - 15 cm to measure the relative clarity of any liquid. Turbidity Click allows users to upgrade their projects with a sensor that senses the cloudiness or haziness of a fluid caused by large numbers of individual particles invisible to the naked eye. @@ -10,23 +10,35 @@ The sensor can be used in various domains. For example, with the washing machine ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit (BRD2703A xG24 Explorer Kit Board)](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) -- [**Turbidity Click** board carries MCP3221 Low-Power 12-Bit A/D Converter](https://www.mikroe.com/turbidity-click). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -- [**Turbidity Sensor - TSD10**](https://www.mikroe.com/tsd-10-turbidity-sensor). +- [**Turbidity Click** board carries MCP3221 Low-Power 12-Bit A/D Converter](https://www.mikroe.com/turbidity-click) -- [**3-wire Male to Male Cable - 15 cm**](https://www.mikroe.com/3-wire-male-to-male-cable-15-cm). +- [**Turbidity Sensor - TSD10**](https://www.mikroe.com/tsd-10-turbidity-sensor) + +- [**3-wire Male to Male Cable - 15 cm**](https://www.mikroe.com/3-wire-male-to-male-cable-15-cm) ## Hardware Connection ## -The Turbidity Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. The Turbidity Click features one 1x3 2.5mm connector suitable for connecting a Turbidity sensor via an additional 3-wire Male to Male Cable - 15 cm. +- If the EFR32xG24 Explorer Kit is used: + + The Turbidity Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + The Turbidity Click features one 1x3 2.5mm connector suitable for connecting a Turbidity sensor via an additional 3-wire Male to Male Cable - 15 cm. + + ![hardware_connection](image/hardware_connection.png "BRD2703A xG24 Explorer Kit Board and Turbidity Click Board") -![hardware_connection](image/hardware_connection.png "BRD2703A xG24 Explorer Kit Board and Turbidity Click Board") + The hardware connection will look like the figure below: -The hardware connection will look like the figure below: + ![real_hardware_connection](image/hardware_connection1.png) -![real_hardware_connection](image/hardware_connection1.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | Turbidity Click | + | -------------| ------------- | ------------------ | ---------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -34,16 +46,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter 'turbidity'. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter 'turbidity'. 2. Click **Create** button on the **Third Party Hardware Drivers - TSD-10 - Turbidity Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_turbidity_tsd10/app.c` into the project root folder (overwriting the existing file). @@ -55,11 +68,17 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the EFR32xG24 Explorer Kit is used:** - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - [Third-Party Hardware Drivers] → [Sensor] → [TSD-10 - Turbidity Click (Mikroe)] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [TSD-10 - Turbidity Click (Mikroe)] + 4. Install printf float - Open Properties of the project. @@ -71,7 +90,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - Third-party Hardware Drivers Extension must be enabled for the project to install the "TSD-10 - Turbidity Click (Mikroe)" component. @@ -85,7 +104,7 @@ You can either create a project based on an example project or start with an emp The application monitors and displays Nephelometric Turbidity Units (NTU). Results are being sent to the USART Terminal. -- The Turbidity sensor measures the amount of transmitted light to determine the turbidity of water. XG24 Explorer kit will read the NTU value. With NTU value in a range of 0 to 4000 corresponds with the turbidity level of water (for example, 0 NTU means water is clean, and NTU is 3000 which means water is cloudy). +- The Turbidity sensor measures the amount of transmitted light to determine the turbidity of water. Program will read the NTU value. NTU value in a range of 0 to 4000 corresponds with the turbidity level of water (for example, 0 NTU means water is clean, and NTU is 3000 which means water is cloudy). - You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. A screenshot of the console output is shown in the figure below: diff --git a/app/documentation/example/mikroe_turbidity_tsd10/image/create_example.png b/app/documentation/example/mikroe_turbidity_tsd10/image/create_example.png index 9d4a04cd..64fde924 100644 Binary files a/app/documentation/example/mikroe_turbidity_tsd10/image/create_example.png and b/app/documentation/example/mikroe_turbidity_tsd10/image/create_example.png differ diff --git a/app/documentation/example/mikroe_turbidity_tsd10/image/log.png b/app/documentation/example/mikroe_turbidity_tsd10/image/log.png index da0ba9d6..533f5db8 100644 Binary files a/app/documentation/example/mikroe_turbidity_tsd10/image/log.png and b/app/documentation/example/mikroe_turbidity_tsd10/image/log.png differ diff --git a/app/documentation/example/mikroe_utm7segr_max6969/README.md b/app/documentation/example/mikroe_utm7segr_max6969/README.md index 3930ab82..47eb9233 100644 --- a/app/documentation/example/mikroe_utm7segr_max6969/README.md +++ b/app/documentation/example/mikroe_utm7segr_max6969/README.md @@ -2,23 +2,33 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the MAX6969 constant-current LED driver via APIs of GSDK. - -UT-M 7-SEG R click carries two SMD ultra-thin LED 7-SEG displays and the MAX6969 constant-current LED driver from Analog Devices. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over SPI interface. +This project aims to show the hardware driver that is used to interface with the MAX6969 constant-current LED driver. UT-M 7-SEG R Click carries two SMD ultra-thin LED 7-SEG displays and the MAX6969 constant-current LED driver from Analog Devices. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over SPI interface. ## Required Hardware ## -- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit). - -- [UT-M 7-SEG R Click](https://www.mikroe.com/ut-m-7-seg-r-click). +- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [UT-M 7-SEG R Click](https://www.mikroe.com/ut-m-7-seg-r-click) ## Hardware Connection ## -The UT-M 7-SEG R Click board supports MikroBus, so it can connect easily to BGM220P Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- **If the BGM220P Explorer Kit is used:** + + The UT-M 7-SEG R Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit via MikroBus header. Assure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png "Hardware connection") + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -The hardware connection is shown in the image below: + The hardware connection is shown in the table below: -![board](image/hardware_connection.png "Hardware connection") + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | UT-M 7-SEG R Click board | + | -------------| ------------- | -------------------- | ---------------------------| + | PWM_H | GPIO_7 | P20 | PWM | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | LE | ## Setup ## @@ -26,16 +36,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter max6969 +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "max6969" 2. Click **Create** button on the **Third Party Hardware Drivers - MAX6969 - UT-M 7-SEG R Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_utm7segr_max6969/app.c` into the project root folder (overwriting the existing file). @@ -47,14 +58,26 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Services] → [Timers] → [Sleep Timer]** - - **[Third Party Hardware Drivers] → [Display & LED] → [MAX6969 - UT-M 7-SEG R Click (Mikroe)]** + **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: EUSART] with the default instance name: **vcom** + - [Services] → [Timers] → [Sleep Timer] + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Third Party Hardware Drivers] → [Display & LED] → [MAX6969 - UT-M 7-SEG R Click (Mikroe)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [PWM] → [channel_0] → use default configuration + - [Third Party Hardware Drivers] → [Display & LED] → [MAX6969 - UT-M 7-SEG R Click (Mikroe)] 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "MAX6969 - UT-M 7-SEG R Click (Mikroe)" component. @@ -62,7 +85,7 @@ You can either create a project based on an example project or start with an emp This example demonstrates some of the available features of the 7-Segment LED module. After initialization, the application draws numbers from 0 to 99 on the screen. -![image_test](image/image_test.png) +![test](image/image_test.png) ## Report Bugs & Get Support ## diff --git a/app/documentation/example/mikroe_uv_ml8511a/README.md b/app/documentation/example/mikroe_uv_ml8511a/README.md index 21871a6e..8a2600ea 100644 --- a/app/documentation/example/mikroe_uv_ml8511a/README.md +++ b/app/documentation/example/mikroe_uv_ml8511a/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the UV Click driver from Mikroe via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the UV Click driver from Mikroe using the Silicon Labs platform. UV Click is a compact add-on board that alerts users of excessive ultraviolet radiation levels. This board features the ML8511A, an ultraviolet light sensor suitable for acquiring UV intensity indoors or outdoors from Rohm Semiconductor. The ML8511A is equipped with an internal amplifier converting photocurrent to voltage depending on the UV intensity working with a wavelength between 280-390nm. It outputs an analog voltage linearly related to the measured UV intensity (mW/cm2), which can be later processed in analog or digital form. Also, the power consumption can be reduced using the available power management mode. This UV Click board is suitable for various applications, such as determining exposure to ultraviolet radiation in a laboratory or environmental settings, weather stations, industrial manufacturing, and many more. @@ -10,15 +10,27 @@ UV Click is a compact add-on board that alerts users of excessive ultraviolet ra - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) + - [UV CLICK](https://www.mikroe.com/uv-click) ## Hardware Connection ## -The UV Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. +- If the EFR32xG24 Explorer Kit is used: + + The UV Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. -The hardware connection is shown in the image below: + ![hardware_connection](image/hardware_connection.png) -![hardware_connection](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | UV Click Board | + | ------------- | -------------- | -------------------- | ------------------- | + | Analog Signal | ULP_GPIO_1 | P16 | AN | + | Enable | GPIO_46 | P24 | EN | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | CS | ## Setup ## @@ -26,16 +38,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **UV**. +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **UV**. 2. Click **Create** button on the **Third Party Hardware Drivers - ML8511A - UV Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_uv_ml8511a/app.c` into the project root folder (overwriting the existing file). @@ -47,10 +60,19 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Services] → [Timers] → [Sleep Timer]** - - **[Services] → [IO Stream] → [IO Stream: EUSART]** → default instance name: vcom + **If the EFR32xG24 Explorer Kit is used:** + + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: EUSART]** → default instance name: vcom - [Application] → [Utility] → [Log] - - **[Third Party Hardware Drivers] → [Sensors] → [ML8511A - UV Click (Mikroe)]** + - [Platform] → [Driver] → [SPI] → [SPIDRV] → default instance name: **mikroe** + - [Third Party Hardware Drivers] → [Sensors] → [ML8511A - UV Click (Mikroe)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [Third Party Hardware Drivers] → [Sensors] → [ML8511A - UV Click (Mikroe)] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [ADC] default instance name: channel_1 4. Install printf float @@ -62,9 +84,9 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third-party drivers extension must be enabled for the project to install "ML8511A - UV Click (Mikroe)" component. +- Third-party Drivers Extension must be enabled for the project to install "ML8511A - UV Click (Mikroe)" component. ## How It Works ## diff --git a/app/documentation/example/mikroe_uwb2_dwm3000/README.md b/app/documentation/example/mikroe_uwb2_dwm3000/README.md index ab7cc9d9..a135840a 100644 --- a/app/documentation/example/mikroe_uwb2_dwm3000/README.md +++ b/app/documentation/example/mikroe_uwb2_dwm3000/README.md @@ -9,23 +9,29 @@ UWB 2 Click board™ is an Ultra-Wideband transceiver. It features the DWM3000, ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) - +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [UWB 2 Click board™](https://www.mikroe.com/uwb-2-click) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220-EK4314A - BGM220P Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | +- **If the EFR32xG24 Explorer Kit is used**: + + The DWM3000 - UWB 2 Click board™ supports MikroBus. Therefore, it can connect easily to the MikroBus header of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: -## Hardware Connection ## + ![board](image/hardware_connection.png) -The DWM3000 - UWB 2 Click board™ supports MikroBus. Therefore, it can connect easily to the MikroBus header of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | UWB 2 Click Board | + | -------------| ------------- | -------------------- | ------------------- | + | DWM3000_INT | GPIO_46 | P24 | INT | + | DWM3000_RST | GPIO_47 | P26 | RST | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | + | RTE_GSPI_MASTER_CS0_PIN | GPIO_28 | P31 | LE | ## Setup ## @@ -33,19 +39,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "uwb 2". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "dwm300". -2. Click **Create** button on the **Third Party Hardware Drivers - DWM3000 - UWB 2 Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. +2. Click **Create** button on the project **Third Party Hardware Drivers - DWM3000 - UWB 2 Click (Mikroe)**. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) + ![create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy all of the files in the "app/example/mikroe_uwb2_dwm3000/app_files" folder into the project root folder (overwriting the existing file). +2. Copy all of the files in the `app/example/mikroe_uwb2_dwm3000/app_files` folder into the project root folder (overwriting the existing file). 3. Install the software components: @@ -55,50 +61,56 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Services] → [IO Stream] → [IO Stream: EUSART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Application] → [Utility] → [Assert]** - - **[Services] → [Timers] → [Sleep Timer]** - - **[Third Party Hardware Drivers] → [Wireless Connectivity] → [DWM3000 - UWB 2 Click (Mikroe)]** → use default configuration + - **If the EFR32xG24 Explorer Kit is used**: + + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [DWM3000 - UWB 2 Click (Mikroe)] → use default configuration + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [DWM3000 - UWB 2 Click (Mikroe)] → use default configuration 4. Editing the Linker File: - - From the project root folder, open "autogen/linkerfile.ld" file and copy the following section to the autogenerated linker: - ``` - .dw_drivers ALIGN(4): - { - __dw_drivers_start = . ; - KEEP(*(.dw_drivers*)) - __dw_drivers_end = . ; - } > FLASH - ``` - The final "linkerfile.ld" file after editing is shown in the image below: - - ![linker](image/custom_linker.png) + - From the project root folder, open **"autogen/linkerfile.ld"** (if using EFR32xG24 Explorer Kit ) or **"autogen/linkerfile_SoC.ld"** (if using SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit) file and copy the following section to the autogenerated linker: + + ```C + .dw_drivers ALIGN(4): + { + __dw_drivers_start = . ; + KEEP(*(.dw_drivers*)) + __dw_drivers_end = . ; + } > FLASH + ``` + + - The final linker file after editing is shown in the image below: + + ![linker](image/custom_linker.png) 5. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension has already been installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "DWM3000 - UWB 2 Click (Mikroe)" component. +- SDK Extension must be enabled for the project to install the "DWM3000 - UWB 2 Click (Mikroe)" component. ## How It Works # -After you flash the code to the Explorer Kit and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the EFR32xG24 Explorer Kit board uses the default baud rate of 115200. +After you flash the code to the your board and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that your board uses the default baud rate of 115200. First, the user must have two boards to run this demo example, one for the Transmitter, and one for Receiver. The user can decide whether to use the device in Transmitter (Tx) or Receiver (Rx) mode by macro "DEMO_APP_TRANSMITTER" in the "app.c" file. -In Tx mode, the main program initializes the driver, reads some information and checks communication with the dwm3000 device. After that, it transmits a packet message periodically. There is a periodic timer in the code, which determines the transmitting intervals; the default transmitting intervals rate is 2000 ms. If you need more frequent transmitting, it is possible to change the value of the macro "TRANSMITTING_INTERVAL_MSEC" in the "app.c" file. The screenshot of the console is shown in the image below: +- In Tx mode, the main program initializes the driver, reads some information and checks communication with the dwm3000 device. After that, it transmits a packet message periodically. There is a periodic timer in the code, which determines the transmitting intervals; the default transmitting intervals rate is 2000 ms. If you need more frequent transmitting, it is possible to change the value of the macro "TRANSMITTING_INTERVAL_MSEC" in the "app.c" file. The screenshot of the console is shown in the image below: -![transmit](image/tx_log.png) + ![transmit](image/tx_log.png) -In Rx mode, the main program initializes the driver, reads some information and checks communication with the dwm3000 device. After that, the device enters receiver mode, and it prints each received packet. The screenshot of the console is shown in the image below: +- In Rx mode, the main program initializes the driver, reads some information and checks communication with the dwm3000 device. After that, the device enters receiver mode, and it prints each received packet. The screenshot of the console is shown in the image below: -![receive](image/rx_log.png) + ![receive](image/rx_log.png) ## Report Bugs & Get Support ## To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. -Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. \ No newline at end of file +Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. diff --git a/app/documentation/example/mikroe_uwb2_dwm3000/image/create_example.png b/app/documentation/example/mikroe_uwb2_dwm3000/image/create_example.png index 03e0c076..8454909d 100644 Binary files a/app/documentation/example/mikroe_uwb2_dwm3000/image/create_example.png and b/app/documentation/example/mikroe_uwb2_dwm3000/image/create_example.png differ diff --git a/app/documentation/example/mikroe_uwb_dwm1000/README.md b/app/documentation/example/mikroe_uwb_dwm1000/README.md index 8817c4a6..c6a7ad58 100644 --- a/app/documentation/example/mikroe_uwb_dwm1000/README.md +++ b/app/documentation/example/mikroe_uwb_dwm1000/README.md @@ -11,20 +11,33 @@ It features a frequency range from 3.5GHz to 6.5GHz, a very precise location of ## Required Hardware ## - [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) - -- [UWB Click](https://www.mikroe.com/uwb-click) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- 2 x [UWB Click](https://www.mikroe.com/uwb-click), one is for TX and one is for RX ## Hardware Connection ## -The DWM1000 - UWB Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit. +- **If the EFR32xG24 Explorer Kit is used**: + + The DWM1000 - UWB Click board supports MikroBus; therefore, it can easily connect to the MikroBus socket of the EFR32xG24 Explorer Kit. Be sure that the 45-degree corner of the board matches the 45-degree white line of the Explorer Kit.The hardware connection is shown in the image below: + + ![board](image/hardware_connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -The hardware connection is shown in the image below: + The hardware connection is shown in the table below: -![board](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | DWM1000 - UWB Click board | + | -------------| ------------- | -------------------- | ---------------------------| + | GPIO | GPIO_46 | P24 | RST | + | GPIO | GPIO_47 | P26 | INT | + | CS | GPIO_48 | P28 | CS | + | RTE_GSPI_MASTER_CLK_PIN | GPIO_25 | P25 | SCK | + | RTE_GSPI_MASTER_MISO_PIN | GPIO_26 | P27 | SDO | + | RTE_GSPI_MASTER_MOSI_PIN | GPIO_27 | P29 | SDI | ### Driver Layer Diagram ### -The driver of the DWM1000 - UWB Click board builds upon more than one level of software. On the first layer, there are the SPIDRV and GPIO drivers from Silabs, which focus on interfacing with the xG24 motherboard. On top of that, there are multiple layers of drivers, which either work as an interfacing layer between the Click board and the motherboard or control the DWM1000 UWB module. Here you can see the high-level overview of the software layers: +The driver of the DWM1000 - UWB Click board builds upon more than one level of software. On the first layer, there are the SPIDRV and GPIO drivers from Silabs, which focus on interfacing with the motherboard. On top of that, there are multiple layers of drivers, which either work as an interfacing layer between the Click board and the motherboard or control the DWM1000 UWB module. Here you can see the high-level overview of the software layers: ![logging_screen](image/sw_layer.png) @@ -34,17 +47,19 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by uwb. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "dwm1000". -2. Click **Create** button on the **Third Party Hardware Drivers - DWM1000 - UWB Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. +2. Click **Create** button on the example **Third Party Hardware Drivers - DWM1000 - UWB Click (Mikroe)** -![create_example](image/create_example.png) + ![create_example](image/create_example.png) + + Example project creation dialog pops up -> click Create and Finish and Project should be generated. 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/mikroe_uwb_dwm1000/app.c` into the project root folder (overwriting the existing file). @@ -56,25 +71,30 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - **[Services] → [IO Stream] → [IO Stream: EUSART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Application] → [Utility] → [Assert]** - - **[Platform] → [Driver] → [Button] → [Simple Button]** → use default instance name: btn0 - - For using the SPI interface - - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe] → change the configuration for [SPI master chip select (CS) control scheme] to "CS controlled by the application", use the default instance name "mikroe" - - **[Third Party Hardware Drivers] → [Wireless Connectivity] → [DWM1000 - UWB Click (Mikroe)]** → use default configuration. + **If the EFR32xG24 Explorer Kit is used** + + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Platform] → [Driver] → [Button] → [Simple Button] → use default instance name: btn0 + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [DWM1000 - UWB Click (Mikroe)] → use default configuration. + - [Platform] → [Driver] → [SPI] → [SPIDRV] → [mikroe] → change the configuration for [SPI master chip select (CS) control scheme] to "CS controlled by the application" + + **Third Party Hardware Drivers - DWM1000 - UWB Click (Mikroe) - Si91x** - ![config](image/uwb_config.png) + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Hardware] → [Button] → [btn0] → [Button Interrupt Configuration] → "Fall Edge Interrupt" + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [DWM1000 - UWB Click (Mikroe)] → use default configuration. 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension has already been installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension has already be installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "DWM1000 - UWB Click (Mikroe)" component. +- SDK Extension must be enabled for the project to install "DWM1000 - UWB Click (Mikroe)" component -- Make sure that the SPI CS Control scheme is set to "CS controlled by the application", otherwise the driver is not able to communicate with the module properly. +- Make sure that the SPI CS Control scheme is set to "CS controlled by the application", otherwise the driver is not able to communicate with the module properly ## How It Works ## diff --git a/app/documentation/example/mikroe_uwb_dwm1000/image/create_example.png b/app/documentation/example/mikroe_uwb_dwm1000/image/create_example.png index 6e8d2203..8a7983e5 100644 Binary files a/app/documentation/example/mikroe_uwb_dwm1000/image/create_example.png and b/app/documentation/example/mikroe_uwb_dwm1000/image/create_example.png differ diff --git a/app/documentation/example/mikroe_uwb_dwm1000/image/uwb_config.png b/app/documentation/example/mikroe_uwb_dwm1000/image/uwb_config.png deleted file mode 100644 index 4896c551..00000000 Binary files a/app/documentation/example/mikroe_uwb_dwm1000/image/uwb_config.png and /dev/null differ diff --git a/app/documentation/example/mikroe_water_detect/README.md b/app/documentation/example/mikroe_water_detect/README.md index 25938c2b..0ee2a97a 100644 --- a/app/documentation/example/mikroe_water_detect/README.md +++ b/app/documentation/example/mikroe_water_detect/README.md @@ -20,7 +20,7 @@ This device can be used as a household flood alarm sensor, or rain detector for - If the EFR32xG24 Explorer Kit is used: - The Water Detect Click board supports MikroBus, so it can connect easily to EFR32xG24 Explorer Kit's MikroBus header. Be sure that the board's 45-degree corner matches the Explorer Kit's 45-degree white line. + The Water Detect Click board supports MikroBus, so it can connect easily to the Explorer Kit via MikroBus header. Assure that the 45-degree corner of Click board matches the 45-degree white line of the Explorer Kit. The hardware connection is shown in the image below: @@ -40,14 +40,9 @@ You can either create a project based on an example project or start with an emp 1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *water* -2. Click **Create** button on the project: +2. Click **Create** button on the **Third Party Hardware Drivers - Water Detect Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - - **Third Party Hardware Drivers - Water Detect Click (Mikroe)** example if the EFR32xG24 Explorer Kit is used. - ![Create_example](image/create_example_1.png) - - **Third Party Hardware Drivers - Water Detect Click (Mikroe) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used. - ![Create_example](image/create_example_2.png) - - Example project creation dialog pops up -> click Create and Finish and Project should be generated. + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. @@ -81,7 +76,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "Water Detect Click (Mikroe)" component. diff --git a/app/documentation/example/mikroe_water_detect/image/create_example.png b/app/documentation/example/mikroe_water_detect/image/create_example.png new file mode 100644 index 00000000..e07783a8 Binary files /dev/null and b/app/documentation/example/mikroe_water_detect/image/create_example.png differ diff --git a/app/documentation/example/mikroe_water_detect/image/create_example_1.png b/app/documentation/example/mikroe_water_detect/image/create_example_1.png deleted file mode 100644 index 442515b9..00000000 Binary files a/app/documentation/example/mikroe_water_detect/image/create_example_1.png and /dev/null differ diff --git a/app/documentation/example/mikroe_water_detect/image/create_example_2.png b/app/documentation/example/mikroe_water_detect/image/create_example_2.png deleted file mode 100644 index 44586b82..00000000 Binary files a/app/documentation/example/mikroe_water_detect/image/create_example_2.png and /dev/null differ diff --git a/app/documentation/example/silabs_ir_generate/README.md b/app/documentation/example/silabs_ir_generate/README.md index 5b31eb4b..8cedd027 100644 --- a/app/documentation/example/silabs_ir_generate/README.md +++ b/app/documentation/example/silabs_ir_generate/README.md @@ -9,14 +9,6 @@ This project shows the implementation of IR generator driver using WSTK kit. IR - [EFR32xG21 Wireless Gecko Starter Kit](https://www.silabs.com/development-tools/wireless/efr32xg21-wireless-starter-kit?tab=overview) - [IR Led](https://www.robomart.com/ir-led-3mm) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD4180A | [SiLabs EFR32xG21 Radio Board BRD4180A](https://www.silabs.com/development-tools/wireless) | -| BRD4182A | [SiLabs EFR32xG22 Radio Board BRD4182A](https://www.silabs.com/development-tools/wireless/slwrb4182a-efr32xg22-wireless-gecko-radio-board) | - ## Hardware Connection ## The hardware connection is shown in the image below: diff --git a/app/documentation/example/silabs_lin_bus/README.md b/app/documentation/example/silabs_lin_bus/README.md index c073f108..b5675bb8 100644 --- a/app/documentation/example/silabs_lin_bus/README.md +++ b/app/documentation/example/silabs_lin_bus/README.md @@ -11,13 +11,6 @@ A key point was to not disturb the Bluetooth LE communication due to its time-cr - 3 x [EFR32MG22 2.4 GHz 6 dBm Radio Board BRD4182A](https://www.silabs.com/documents/public/user-guides/ug430-brd4182a-user-guide.pdf) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| --- | --- | -| BRD4182A | [EFR32MG22 2.4 GHz 6 dBm Radio Board BRD4182A](https://www.silabs.com/documents/public/user-guides/ug430-brd4182a-user-guide.pdf) | - ## Connections Required ## The testing environment consists of a master device and two slave devices. Connections are made through the expansion header. All the LIN_TX and LIN_RX pins should be connected together on every devices, connected to the single-wire bus, and at least pulled up by a 5-10K resistor to 3.3V. An external USB-to-serial converter is required to access the console. For more detail please refer to the ["Pin assignments](#pin-assignments) and ["Testing environment"](#testing-environment) section. diff --git a/app/documentation/example/silabs_pir_ira_s210st01/README.md b/app/documentation/example/silabs_pir_ira_s210st01/README.md deleted file mode 100644 index 48772c63..00000000 --- a/app/documentation/example/silabs_pir_ira_s210st01/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# PIRA-S210ST01 - PIR Sensor (Silabs) # - -## Summary ## - -This project shows the implementation of PIR sensor driver using the PIR sensor on the occupancy sensor EXP board. - -The target application of the PIR sensor would be smart lighting or alarm systems in home automation. Whenever a certain motion of the human body is detected, the system will either turn on the light or the alarm. - -## Required Hardware ## - -- [EFR32MG12 2.4 GHz 10 dBm Radio Board BRD4162A](https://www.silabs.com/documents/public/reference-manuals/brd4162a-rm.pdf) -- Wireless Starter Kit Mainboard (BRD4001A) -- Occupancy Sensor EXP board (BRD8030A) - -The driver should work with minimal porting on other series 1 EFM/EFR devices and with other -PIR sensors having similar designs as the one on the Occupancy Sensor EXP board. - -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD4162A | [EFR32MG12 2.4 GHz 10 dBm Radio Board BRD4162A](https://www.silabs.com/documents/public/reference-manuals/brd4162a-rm.pdf) | -| BRD4161A | [EFR32MG12 2.4 GHz 19 dBm Radio Board BRD4161A](https://www.silabs.com/documents/public/reference-manuals/brd4161a-rm.pdf) | - -## Hardware Connection ## - -Connect the occupancy sensor EXP board to the WSTK board through the expansion header. - -![hardware_connection](image/hardware_connection.png) - -## Setup ## - -You can either create a project based on an example project or start with an empty example project. - -### Create a project based on an example project ### - -1. From the Launcher Home, add the BRD4162A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter s210st01. - -2. Click **Create** button on the **Third Party Hardware Drivers - IRA-S210ST01 - PIR sensor (Silabs)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) - -3. Build and flash this example to the board. - -### Start with an empty example project ### - -1. Create a "Platform - Empty C Project" project for the "EFR32MG12 Radio Board (BRD4162A)" using Simplicity Studio v5. Use the default project settings. Be sure to connect and select the "EFR32MG12 Radio Board (BRD4162A)" from the "Debug Adapters" on the left before creating a project. - -2. Copy the file `app/example/silabs_pir_ira_s210st01/app.c` into the project root folder (overwriting the existing file). - -3. Install the software components: - - - Open the .slcp file in the project. - - Select the *SOFTWARE COMPONENTS* tab. - - Install the following components: - - **[Third Party Hardware Drivers] → [Sensor] → [IRA-S210ST01 - PIR Sensor (Silabs)]**. - - **[Platform] → [Driver] → [LED] → [Simple LED]** component with the default instance name: **led0**. - -## How It Works ## - -Whenever motion is detected, the LED0 on the WSTK Mainboard will be turned on. If no motion is detected for 4 seconds, the LED0 will be turned off. - -### API Documentation ### - -![api](image/api.png) - -Based on the operation, the PIR sensor driver API can be broken into 4 categories: - -- Initialization. - - pir_init() function will power up the PIR sensor and initialize all peripherals required to perform the measurement - - pir_configure() function is not currently implemented yet. The PIR sensor we used is an analog sensor which doesn't have internal registers to program. -- Running the Motion Detection - - pir_start() and pir_stop() functions are used to start/stop ADC measurements. - - pir_detect_motion() is a simple algorithm that tells if motion is detected. It also adaptively updates the ADC threshold to trigger interrupts. -- Callbacks - - pir_adc_irq_callback() function is called in ADC IRQ. It's up to the application layer to decide how to set up flags/events to call the motion detection algorithm. - - pir_motion_detection_callback() function is called in the motion detection algorithm to notify the application layer whenever motion on/off is detected. -- Debug Utilities - - The application layer can provide a buffer for the PIR driver to save PIR samples to a sample queue for debugging purpose. - -### Peripherals Usage ### - -![peripherals](image/peripherals.png) - -The figure above shows an overview of all peripherals used in the PIR sensor driver. - -- Yellow blocks are external hardware components. -- Green blocks are peripherals that can operate in EM2. - - 3 GPIOs, PRS, CRYTIMER(32Hz) and ADC are MUST have. - - OPAMP can be either external or internal. - - LETIMER is optional for processing/debugging samples. -- Motion detection can only run in EM0 as shown in the blue block. - -### Software Workflow ### - -![workflow](image/workflow.png) - -After initialization, users can call `pir_start()` function to start ADC measurements (32Hz). If an ADC interrupt is received, MCU will be wakened up to buffer ADC samples and call the `pir_adc_irq_callback()` function. Users should run the motion detection algorithm on the latest ADC sample to detect motions. - -## Report Bugs & Get Support ## - -To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. - -Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. \ No newline at end of file diff --git a/app/documentation/example/silabs_pir_ira_s210st01/image/api.png b/app/documentation/example/silabs_pir_ira_s210st01/image/api.png deleted file mode 100644 index 97629b39..00000000 Binary files a/app/documentation/example/silabs_pir_ira_s210st01/image/api.png and /dev/null differ diff --git a/app/documentation/example/silabs_pir_ira_s210st01/image/create_example.png b/app/documentation/example/silabs_pir_ira_s210st01/image/create_example.png deleted file mode 100644 index 9d70f1c6..00000000 Binary files a/app/documentation/example/silabs_pir_ira_s210st01/image/create_example.png and /dev/null differ diff --git a/app/documentation/example/silabs_pir_ira_s210st01/image/hardware_connection.png b/app/documentation/example/silabs_pir_ira_s210st01/image/hardware_connection.png deleted file mode 100644 index bc84ea60..00000000 Binary files a/app/documentation/example/silabs_pir_ira_s210st01/image/hardware_connection.png and /dev/null differ diff --git a/app/documentation/example/silabs_pir_ira_s210st01/image/peripherals.png b/app/documentation/example/silabs_pir_ira_s210st01/image/peripherals.png deleted file mode 100644 index 22cdaf72..00000000 Binary files a/app/documentation/example/silabs_pir_ira_s210st01/image/peripherals.png and /dev/null differ diff --git a/app/documentation/example/silabs_pir_ira_s210st01/image/workflow.png b/app/documentation/example/silabs_pir_ira_s210st01/image/workflow.png deleted file mode 100644 index 426043f2..00000000 Binary files a/app/documentation/example/silabs_pir_ira_s210st01/image/workflow.png and /dev/null differ diff --git a/app/documentation/example/silabs_triac/README.md b/app/documentation/example/silabs_triac/README.md deleted file mode 100644 index b3830973..00000000 --- a/app/documentation/example/silabs_triac/README.md +++ /dev/null @@ -1,488 +0,0 @@ -# Triac Driver (Silabs) # - -## Overview ## - -Triac Driver (TRIACDRV) is a hardware device driver for Series 1 EFM32 and EFR32 -devices that uses an appropriate voltage level representation of the -AC line voltage in order to fire a timed pulse to drive the gate on a -triac. - -By using the PRS to connect one of the device's analog comparators -(ACMP) with one of its timers (TIMERs), the triac gate enables the pulse can -be fired automatically and with zero CPU intervention. In addition to -initializing the necessary hardware, the driver includes functions to -get and set the duty cycle (between 0 and 100% in 1% increments) and -to monitor the half-wave duty cycle periods as a kind of calibration to -account for some level of potential variation in the incoming DC -waveform due to poor line conditions. - -## Required Hardware ## - -- [A EFM32 Tiny Gecko TG11 Starter Kit](https://www.silabs.com/development-tools/mcu/32-bit/efm32tg11-starter-kit?tab=overview) - -- An oscilloscope can be used to observe both this stimulus and the gate enable pulse output generated by the driver. - -## Hardware Connection ## - -Using a jumper wire, connect expansion header pins 3 (PC0, the ACMP input) and 12 (PC14, the 60 Hz stimulus). Attach oscilloscope probes to expansion header pins 10 (PC8) and 12 to observe the gate enable pulse output relative to the 60 Hz input. - -## Setup ## - -You can either create a project based on an example project or start with an empty example project. - -### Create a project based on an example project ### - -1. From the Launcher Home, add the BRD2102A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter: triac. - -2. Click **Create** button on the **TThird Party Hardware Drivers - Triac Driver (Silabs)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) - -3. Build and flash this example to the board. - -### Start with an empty example project ### - -1. Create a "Platform - Empty C Project" project for the "EFM32 Tiny Gecko TG11 Starter Kit (BRD2102A)" using Simplicity Studio v5. -2. Copy the *app/example/silabs_triac/app.c* file into the project root folder (overwriting existing). - -3. Install the software components: - - - Open the .slcp file in the project. - - - Select the SOFTWARE COMPONENTS tab. - - - Install the following components: - - - [Platform] → [Peripheral] → [LETIMER]. - - [Platform] → [Driver] → [Button] → [Simple Button] → [btn0, btn1]. - - [Third Party Hardware Drivers] → [Miscellaneous] → [Triac Driver (Silabs)] → use default configuration - -4. Build and flash the project to your device. - -**Note:** - -- Make sure the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/platform_hardware_drivers_sdk_extensions/blob/master/README.md). - -- SDK Extension must be enabled for the project to install "Triac Driver (Silabs)" component. - -## Device Resource Requirements ## - -As mentioned above, TRIACDRV uses the PRS to link one ACMP with one -TIMER to generate the gate enable pulse. The specific requirements are -as follows: - -**1. ACMP** - -The input voltage, which is some user-conditioned representation of the -AC line voltage (what this specifically means is discussed later), must -be between 0 volts and the lesser of AVDD or IOVDD because the ACMP is -supplied by AVDD, and the input signal is routed using the APORT. - -This permits the widest possible input range because Series 1 devices -require that AVDD ≥ IOVDD and that VREGVDD = AVDD on devices with the -DCDC. It does, however, mean that the representation of the AC line must -be between 0 volts and IOVDD in systems where IOVDD < AVDD (e.g. when -IOVDD = 1.8V to interface with digital peripherals and GPIO on -high-performance processors that do not support some kind of 3 volts -nominal I/O rail). - -Selection of the APORT channel routed to the ACMP positive input and the -zero-crossing threshold voltage is up to the user and handled as part -of initializing the driver. - -**2. TIMER** - -TRIACDRV requires a single 16-bit TIMER of which it uses capture/compare -(CC) channels 0, 1, and 2. For all practical purposes, CC channel 3 should -be considered unavailable to end-user code as TRIACDRV must retain control -of the TIMER counter and its initialization. - -Use of the WTIMER is currently unsupported. - -**3. PRS** - -TRIACDRV requires three PRS channels. The zero-crossing detection output -from the ACMP is routed to the selected TIMER using one PRS channel. TIMER -channels CC1 and CC2 are ANDed together using two adjacent PRS channels to -create the triac gate enable pulse. When the AND option is used with a pair -of PRS channels, channel N and is ANDed together with channel N + 1 such -that channel N is the resulting output. - -Consequently, specifying PRS channel N for the TIMER means that channel -N + 1 is also used and that the port, pin, and location specified for the -output must be one of the available locations for PRS channel N (PRS_CHn). - -**4. Pins** - -As noted above, the user-conditioned representation of the AC line voltage -is input on one ACMP pin via the APORT. Refer to Analog Port (APORT) Client -Maps in section 5 of the datasheet to see the APORT inputs available for a -given ACMP. - -One pin is required for the gate to enable pulse output. It must be a GPIO -pin for which the PRS_CH alternate function corresponds to the selected -PRS channel chosen for the TIMER. For example, if PRS channel 8 is chosen -for the TIMER, then the pin chosen as an output must have PRS_CH8 as an -alternate function. - -**5. Energy Modes** - -Because the TIMER counter must run in order to output gate enable pulses -in response to zero-crossing events, TRIACDRV is restricted to running in -EM0 or EM1. To enter EM2 (or lower), application software should first set -the output duty cycle to 0% by calling triacdrv_set_duty_cycle(). Upon -returning to EM0, there is no need to re-initialize the driver; the output -can be re-enabled simply by setting the duty cycle to a non-zero value. - -## API ## - -![TRIACDRV Block Diagram](image/triacdrv_diagram.png) - -### Overview ### - -TRIACDRV works on the premise that… - -* the AC line voltage appears to be a symmetrical waveform consisting of -two half waves demarcated by zero-crossings and that -* the TIMER which measures this waveform is operating many times faster -(e.g. somewhere in the single-digit MHz range) - -…such that any asymmetry in the duration of the two half waves is -effectively invisible to the human eye for dimming purposes when the net -effective difference is relatively small. - -By using the PRS to connect the ACMP output with the TIMER start-reload -input, TRIACDRV is able to continually start and reload the counter in -response to zero-crossing events. Capture/compare channel 0 (CC0) of the -selected timer captures the time of this reload event, which is the -duration of the half-wave. - -During initialization and in response to calling the TRIACDRV_Calibrate() -function, the driver captures this half-wave duration and saves both the -largest and smallest values observed. TRIACDRV_SetDutyCycle() uses this -information to determine the positioning of the gate enable output pulse. - -For example, if the duty cycle is set to 30%, the rising edge is of the -output pulse is positioned at 30% of the smallest count value observed; -the falling edge is positioned at this count plus the user-specified -pulse duration later. When 0% duty cycle is specified, the output pulse -is positioned to start after the maximum half wave count such that the -counter reload-start occurs before the pulse can ever be generated. - -As mentioned above, the rising and falling edges of the output pulse -are positioned with respect to the half-wave duration and the specified -duty cycle. TIMER channel CC1 is used for the pulse rising edge and, if -it were output to a pin, would initially be low. Conversely, TIMER -channel CC2 is used for the falling edge and would be initially high if -output to a pin. - -To combine these two signals into the desired output pulse, CC1 and CC2 -are assigned to user-specified PRS channel N and N + 1, respectively. -This sequential assignment is mandatory because the PRS has the ability -to perform some limited logic operations on two adjacent channels. -Specifically, the PRS has the ability to AND a given channel with the -next higher-numbered channel (ANDNEXT), and this is used here to AND -CC1 (rising edge), which goes from low to high, with CC2 (falling edge), -which goes from high to low. The resulting pulse is driven on the -user-selected PRS_CH pin associated with channel N. - -### Using the TRIACDRV ### - -Use of TRIACDRV is modeled after emlib components. An initialization -function takes a pointer to an initialization structure that specifies -the fixed configuration parameters for the driver. Other functions -adjust the behavior of the driver once it is running. - -A project using TRIACDRV must #include triacdrv.h in source files that -call the driver's functions. - -#### Data Structures #### - - typedef struct - { - // ACMP used for zero crossing detection - ACMP_TypeDef *acmp; - - // APORT ACMP input channel - ACMP_Channel_TypeDef acmpInput; - - // PRS channel used to link ACMP and TIMER - uint32_t acmpPrsChannel; - - // TIMER used for half-wave measurement and output generation - TIMER_TypeDef *timer; - - /* - * Base PRS channel used for gate enable output pulse. Two - * adjacent channels (N and N + 1) are ANDed together to form - * the output pulse. - */ - uint32_t timerPrsBaseChannel; - - /* - * Output port, pin, and location for timerPrsBaseChannel. This - * must be one of the PRS_CH pin options for the PRS channel - * selected, e.g. if PRS channel 4 is selected as the - * timerPrsBaseChannel on EFM32TG11, then the pin options are PC8 - * and PF1. - */ - GPIO_Port_TypeDef timerPrsOutputPort; - uint32_t timerPrsOutputPin; - uint32_t timerPrsOutputLoc; - - // Input waveform type - TRIACDRV_InputWave_Typedef inputWave; - - // Threshold voltage for zero-crossing in mV - uint32_t zeroThreshold; - - // AVDD supply voltage in mV - uint32_t avdd; - - // Gate enable pulse width in microseconds - uint32_t pulseWidth; - - // Triac initially on? - bool initOn; - } TRIACDRV_Init_TypeDef; - -TRIACDRV_Init_TypeDef is the initialization structure passed to the -TRIACDRV_Init() function. The members have self-explanatory names -and, unless explicitly disabled, are bounds-checked during -initialization. - -#### Enumerations #### - - typedef enum - { - triacInputRectifiedSine, // Rectified sine wave (no negative half wave) input - triacInputOffsetSine, // Offset sine wave with zero-crossing at 50% - } TRIACDRV_InputWave_Typedef; - -Allowable input waveforms are a rectified sine wave or an offset sine -wave that oscillates between ground and AVDD (or IOVDD) and has a -midpoint at half the specified analog input voltage. - -#### Macros #### - - #define TRIACDRV_MAX_CAL_COUNT 60 - - #define TRIACDRV_MAX_ENABLE_PULSE_WIDTH 200 - - #define TRIACDRV_MIN_ZERO_THRESHOLD 5 - #define TRIACDRV_MAX_ZERO_THRESHOLD 500 - - #define TRIACDRV_MIN_AVDD 1800 - #define TRIACDRV_MAX_AVDD 3800 - - #define TRIACDRV_MIN_TIMER_FREQUENCY 1000000 - -These macros specify the bounds-checked ranges for parameters that are -specified or otherwise controlled (the TIMER clock frequency) by the -user. - -#### Functions #### - - sl_status_t triacdrv_init(const TRIACDRV_Init_TypeDef *init) - -triacdrv_init() takes a pointer to the initialization structure -described above. Unless explicitly disabled at compile time, it -bounds-checks the hardware resources assigned to the driver, as well as -the user-specified parameters that govern the input and output signals. -It can return the following possible status codes: - -**1. SL_STATUS_OK** - -Denotes successful driver initialization. - -**2. SL_STATUS_INVALID_RANGE** - -One or more of the zeroThreshold, avdd, or pulseWidth initialization -structure members is out of range. It can also mean that the selected -TIMER clock is less than 1 MHz (TRIACDRV_MIN_TIMER_FREQUENCY in -triacdrv.h), which means that the HFPERCLK has been prescaled to less -than 1 MHz on a Series 1 device. - -**3. SL_STATUS_INVALID_CONFIGURATION** - -One of the user-specified hardware parameters is invalid. This can mean -that the selected ACMP or TIMER does not exist on the chip against which -the project is being built (e.g. specifying ACMP2 on EFM32TG11, which has -only ACMP0 and ACMP1). - -It can also indicate a similar problem with the selection of PRS channels -(e.g. one of the selected channels does not exist on the device, including -one of the two adjacent channels required to generate the output pulse). - -Finally, there can be a problem with output selection. This can be a -non-existent I/O port or pin or a possibly non-existent location for -the PRS_CH alternate function. Note that the bounds-checking for the -latter is not absolute. Alternate functions are not always contiguously -defined (e.g. PRS_CH4 has only locations 0 and 2 on EFM32TG11). - - sl_status_t triacdrv_set_duty_cycle(uint32_t duty) - -Sets the duty cycle (positioning) of the gate enable pulse to an integer -value between 0 (off) and 100% (always on). The following status codes -can be returned: - -**1. SL_STATUS_NOT_INITIALIZED** - -Returned if TRIACDRV_Init() has not been called and returned -SL_STATUS_OK. - -**2. SL_STATUS_INVALID_RANGE** - -Returned if a duty cycle greater than 100% is specified. - - uint32_t triacdrv_get_duty_cycle(void) - -Returns the previously set duty cycle or 0 if TRIACDRV has not been -successfully initialized. - - sl_status_t triacdrv_calibrate(uint32_t count) - -triacdrv_calibrate() takes up to TRIACDRV_MAX_CAL_COUNT measurments of -the measures the half-wave count and saves the largest and smallest -values found. This allows the driver to attempt to more accurately -place the gate enable pulse in the event that there is some asymmetry -in the AC waveform due to poor line conditions. The following status -codes can be returned: - -**1. SL_STATUS_NOT_INITIALIZED** - -Returned if TRIACDRV_Init() has not been called and returned -SL_STATUS_OK. - -**2. SL_STATUS_INVALID_RANGE** - -Returned if called with a half-wave count greater than -TRIACDRV_MAX_CAL_COUNT. - -## How It Works ## - -The demonstration project is in app.c file which shows how to initialize and -invoke TRIACDRV. Code flow is as follows: - -1. Both the LFXO and HFXO are initialized, and the HFXO is selected as -the source of the HFCLOCK. This permits the TIMER used by TRIACDRV to -run with a fast and accurate reference clock. - -2. GPIO pins connected to push buttons 0 and 1 are configured as inputs -with active pull-ups, and their associated interrupts are enabled. -Additionally, the pin used to output the 60 Hz LETIMER square -wave stimulus is set to use the lowest available slew rate setting. - -3. The LETIMER is configured to output a 60 Hz square wave with 50% -duty cycle to be used as stimulus for the rectified sine wave input -configuration. - -4. The default TRIACDRV initialization structure is modified to use the -specific hardware resources available on the EFM32TG11 Starter Kit and -to use the maximum supported output enable pulse width so that it is -visible on an oscilloscope when displayed along with the input -stimulus waveform. - -5. triacdrv_init() is called and halts if SL_STATUS_OK is not returned. - -6. The output duty cycle is set to 25% and the driver is allowed to -calibrate over 60 half-waves. - -7. At this point, the device enters EM1 and waits for an interrupt in -response to button 0 or 1 being pressed. No CPU cycles are utilized to -generate the output pulse as the PRS allows TIMER0 to do this -automatically in response to zero-crossings detected by ACMP0. - -8. When a button press is detected, the GPIO interrupt handler -decrements (button 0) or increments (button 1) the duty cycle and calls -triacdrv_set_duty_cycle() to have the driver update the output. - -9. Attach oscilloscope probes to expansion header pins 10 (PC8) and 12 -to observe the gate enable pulse output relative to the 60 Hz input. -You should expect a similar output to the one below. - - ![](image/oscilloscope_output.png) - -## Input Waveform Considerations ## - -No microcontroller of any sort, regardless of the vendor, has input pad -structures that permit it to be interfaced directly with the AC mains. -Some kind of external hardware is required to translate the positive and -negative high voltages swings into something between ground and the -microcontroller's I/O voltage supply. - -![AC Mains Voltage](image/triacdrv_ac_sine.png) - -TRIACDRV has no awareness of the external hardware that might be used to -do this. However, it does provide a means to select one of two supported -ways in which the AC waveform can be presented. - -One is as a rectified sine wave in which the voltage swings are scaled -between GND and AVDD (or IOVDD, as noted above). The expected waveform -for this option is shown below: - -![Rectified Sine Wave](image/triacdrv_rectified_sine.png) - -When using this option, the inputWave member of the initialization -structure must be set to triacInputRectifiedSine. Use this option for -other AC mains representations that present the zero-crossings as -comparator threshold transitions near GND. The 60 Hz square wave output -provided by the letimer60Hz() function in the demonstration project is -an example of this. - -The other input option is an offset sine wave, which is simply a -scaled representation of the AC mains voltage that swings between GND -and AVDD (or IOVDD). The expected waveform for this option is shown -below: - -![Offset Sine Wave](image/triacdrv_offset_sine.png) - -Ideally, the waveform midpoint should be one half AVDD (or IOVDD), but -the avdd member of the initialization structure effectively specifies -the peak input voltage seen at the pin. - -## Gate Enable Output - -The gate enable output pulse is driven on a digital I/O pin that -toggles between GND and IOVDD. - -## Disabling Hardware Resource Checking ## - -TRIACDRV can be compiled with hardware resource checking disabled at -build time. Add TRIACDRV_DISABLE_HW_RESOURCE_CHECKING to -Properties -> C/C++ Build -> Setting -> GNU ARM C Compiler -> Symbols -in Simplicity Studio or define this symbol as part of the compiler -invocation command line (e.g. -DTRIACDRV_DISABLE_HW_RESOURCE_CHECKING -in GCC or the equivalent in IAR). - -Depending on the optimization level, doing so can save up to 324 bytes -of flash space on the EFM32TG11. The savings on other devices vary -depending on the number of ACMPs and TIMERs with EFM32xG1/EFR32xG1 -devices seeing a reduction of up to 304 bytes and other devices being -in the range of 360 to 388 bytes. - -Once a TRIACDRV configuration is known to be working on its intended -target, disabling hardware resource checking is advisable in order to -recover some flash space for use elsewhere in the application. - -## Porting to Other EFM32 and EFR32 Series 1 Devices ## - -Apart from any issues of pin or alternate function availability on a -given device or board, the TRIACDRV code itself should not require -modifications. The user-provided initialization structure of type -TRIACDRV_Init_TypeDef, will, of course, need to be customized for the -target device or board. - -Note that the minimum supported AVDD on EFM32xG1 and EFR32xG1 devices is -1.85V, which is 50 mV higher than the 1.8V minimum on all other Series 1 -devices. TRIACDRV_MIN_AVDD in triacdrv.h is set to the latter value. - -TRIACDRV provides a debugging facility that might be helpful if problems -are experienced when attempting to build the driver on another target. -This mechanism consists of various internal signals that can be output to -pins specified in the triacdrv_config.h file. - -These outputs are globally enabled at build time by the TRIACDRV_DEBUG -symbol and are, in fact, enabled in the demonstration project. No actual -debug code is generated because the symbols that specify the port, pin, -and routing location for each of these signals are only defined when -their top-level enable symbol is uncommented. diff --git a/app/documentation/example/silabs_triac/image/create_example.png b/app/documentation/example/silabs_triac/image/create_example.png deleted file mode 100644 index e18e0fa5..00000000 Binary files a/app/documentation/example/silabs_triac/image/create_example.png and /dev/null differ diff --git a/app/documentation/example/silabs_triac/image/oscilloscope_output.png b/app/documentation/example/silabs_triac/image/oscilloscope_output.png deleted file mode 100644 index a1487d95..00000000 Binary files a/app/documentation/example/silabs_triac/image/oscilloscope_output.png and /dev/null differ diff --git a/app/documentation/example/silabs_triac/image/triacdrv_ac_sine.png b/app/documentation/example/silabs_triac/image/triacdrv_ac_sine.png deleted file mode 100644 index 03b34e67..00000000 Binary files a/app/documentation/example/silabs_triac/image/triacdrv_ac_sine.png and /dev/null differ diff --git a/app/documentation/example/silabs_triac/image/triacdrv_diagram.png b/app/documentation/example/silabs_triac/image/triacdrv_diagram.png deleted file mode 100644 index 02711142..00000000 Binary files a/app/documentation/example/silabs_triac/image/triacdrv_diagram.png and /dev/null differ diff --git a/app/documentation/example/silabs_triac/image/triacdrv_offset_sine.png b/app/documentation/example/silabs_triac/image/triacdrv_offset_sine.png deleted file mode 100644 index 99c571fe..00000000 Binary files a/app/documentation/example/silabs_triac/image/triacdrv_offset_sine.png and /dev/null differ diff --git a/app/documentation/example/silabs_triac/image/triacdrv_rectified_sine.png b/app/documentation/example/silabs_triac/image/triacdrv_rectified_sine.png deleted file mode 100644 index eb437cc3..00000000 Binary files a/app/documentation/example/silabs_triac/image/triacdrv_rectified_sine.png and /dev/null differ diff --git a/app/documentation/example/sparkfun_6dof_imu_bmi270/README.md b/app/documentation/example/sparkfun_6dof_imu_bmi270/README.md index 44b1235b..f2ae27f2 100644 --- a/app/documentation/example/sparkfun_6dof_imu_bmi270/README.md +++ b/app/documentation/example/sparkfun_6dof_imu_bmi270/README.md @@ -12,32 +12,22 @@ The SparkFun BMI270 6DoF IMU Breakout is a Qwiic-enabled breakout board based on - Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [SparkFun 6DoF IMU Breakout - BMI270 (Qwiic)](https://www.sparkfun.com/products/22397) -**NOTE:** -Tested boards for working with this example: - -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [xG24-EK2703A - EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220-EK4314A - BGM220P Bluetooth Module Explorer Kit](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [BG22-EK4108A - EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | -| BRD4338A | [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) | - ## Hardware Connection ## - **If the "EFR32xG24 Explorer Kit" is used**: - The SparkFun 6DoF IMU Breakout - BMI270 supports Qwiic, so it can connect easily to the Qwiic header of the EFR32xG24 Explorer Kit. The hardware connection is shown in the image below: + The SparkFun 6DoF IMU Breakout - BMI270 supports Qwiic, so it can connect easily to the Qwiic header of the EFR32xG24 Explorer Kit. The hardware connection is shown in the image below: - ![board](image/hardware_connection.png) + ![board](image/hardware_connection.png) - **If the "SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit" is used**: - The hardware connection is shown in the table below: + The hardware connection is shown in the table below: | Description | BRD4338A GPIO | BRD4002 EXP Header | BMI270 - 6DoF IMU Breakout| - | -------------| ------------- | ------------------ | ------------------ | - | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | - | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | -------------| ------------- | ------------------ | ------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -47,22 +37,17 @@ You can either create a project based on an example project or start with an emp 1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "bmi270". -2. Click on the **Create** button on the project: - - - **Third Party Hardware Drivers - BMI270 - 6DOF IMU (SparkFun)** example if the "EFR32xG24 Explorer Kit" is used - ![create_example](image/create_example.png) +2. Click **Create** button on the **Third Party Hardware Drivers - BMI270 - 6DOF IMU (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - - **Third Party Hardware Drivers - BMI270 - 6DOF IMU (SparkFun) - Si91x** example if the "SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit" is used - ![create_example_si91x](image/create_example_si91x.png) + ![Create_example](image/create_example.png) - - Example project creation dialog pops up -> click Create and Finish and Project should be generated. 3. Build and flash this example to the board. ### Start with an empty example project ### 1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy all of the files in the "app/example/silabs_6dof_imu_bmi270/app.c" folder into the project root folder (overwriting the existing file). +2. Copy all of the files in the `app/example/silabs_6dof_imu_bmi270/app.c` folder into the project root folder (overwriting the existing file). 3. Install the software components: @@ -94,7 +79,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension has already been installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install the "BMI270 - 6DOF IMU Breakout (Sparkfun)" component. diff --git a/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png b/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png deleted file mode 100644 index f37c5f10..00000000 Binary files a/app/documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png and /dev/null differ diff --git a/app/documentation/example/sparkfun_accelerometer_mma8452q/README.md b/app/documentation/example/sparkfun_accelerometer_mma8452q/README.md index 5635eb38..ad9fecd1 100644 --- a/app/documentation/example/sparkfun_accelerometer_mma8452q/README.md +++ b/app/documentation/example/sparkfun_accelerometer_mma8452q/README.md @@ -2,29 +2,39 @@ ## Summary ## -The MMA8452Q is a smart, low-power, three-axis, capacitive, micromachined accelerometer with 12 bits of resolution. This accelerometer is packed with embedded functions with flexible user programmable options, configurable to two interrupt pins. Embedded interrupt functions allow for overall power savings relieving the host processor from continuously polling data. +The MMA8452Q is a smart, low-power, three-axis, capacitive, micromachined accelerometer with 12 bits of resolution. This accelerometer is packed with embedded functions with flexible user-programmable options, configurable to two interrupt pins. Embedded interrupt functions allow for overall power savings relieving the host processor from continuously polling data. -The MMA8452Q has user-selectable full scales of ±2g/±4g/±8g with high-pass filter filtered data as well as non-filtered data available in real-time. The device can be configured to generate inertial wakeup interrupt signals from any combination of the configurable embedded functions allowing the MMA8452Q to monitor events and remain in a low power mode during periods of inactivity. Typically this sensor can be used for e-compass applications, real-time orientation detection, motion detection for portable product power saving. By coupling the accelerometer to the wireless connectivity of the Silicon Labs chips, the collected data can be easily transferred from this sensor to various type of data centers or other end-devices. +The MMA8452Q has user-selectable full scales of ±2g/±4g/±8g with high-pass filter filtered data as well as non-filtered data available in real-time. The device can be configured to generate inertial wakeup interrupt signals from any combination of the configurable embedded functions allowing the MMA8452Q to monitor events and remain in a low power mode during periods of inactivity. Typically this sensor can be used for e-compass applications, real-time orientation detection, and motion detection for portable product power saving. By coupling the accelerometer to the wireless connectivity of the Silicon Labs chips, the collected data can be easily transferred from this sensor to various types of data centers or other end devices. The goal is to provide a hardware driver that supports the basic accelerometer measurement readout, along with configuration for the various embedded functionality and interrupt generation. Interfaces should be intuitive and easy to integrate with our wireless stacks, focusing on BLE. ## Required Hardware ## -- [A BGM220P Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) - +- [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [SparkFun Triple Axis Accelerometer Breakout - MMA8452Q (Qwiic)](https://www.sparkfun.com/products/14587) ## Hardware Connection ## -An MMA8452Q sensor board can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. +- **If the BGM220P Explorer Kit is used**: + + An MMA8452Q sensor board can connect with your board easily via a Qwiic connector. It includes a JST-PH 4-pin connector that provides two I2C wires (SDA and SCL), 3v3, and GND. You can use [the JST PH to JST SH (qwiic) Cable](https://www.adafruit.com/product/4424) to connect to your board. + + The hardware connection is shown in the image below: + ![hardware_connection](image/hardware_connection.png) -![hardware_connection](image/hardware_connection.png) +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: -**Note:** There are several jumpers on SparkFun Triple Axis Accelerometer Breakout - MMA8452Q that can be changed to facilitate several different functions. The first of which is the Address jumper. The Address jumper can be used to change the I2C address of the board. The default jumper is open by default, pulling the address pin high and giving us an I2C address of 0X1D. Closing this jumper will ground the address pin, giving us an I2C address of 0X1C. + | Description | BRD4338A GPIO | BRD4002 EXP Header | MMA8452Q sensor board | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | -The second of which is the I2C pull-up jumper. If multiple boards are connected to the I2C bus, the equivalent resistance goes down, increasing your pull-up strength. If multiple boards are connected on the same bus, make sure only one board has the pull-up resistors connected. +- **Note:** There are several jumpers on SparkFun Triple Axis Accelerometer Breakout - MMA8452Q that can be changed to facilitate several different functions. The first of which is the Address jumper. The Address jumper can be used to change the I2C address of the board. The default jumper is open by default, pulling the address pin high and giving us an I2C address of 0X1D. Closing this jumper will ground the address pin, giving us an I2C address of 0X1C. The second of which is the I2C pull-up jumper. If multiple boards are connected to the I2C bus, the equivalent resistance goes down, increasing your pull-up strength. If multiple boards are connected on the same bus, make sure only one board has the pull-up resistors connected. -![hardware_jumper](image/hardware_jumper.png) + ![hardware_jumper](image/hardware_jumper.png) ## Setup ## @@ -32,16 +42,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter MMA8452Q. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "mma8452q". 2. Click **Create** button on the **Third Party Hardware Drivers - MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) + + ![create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create a "Platform - Empty C Project" project for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. Be sure to connect and select the BGM220 Explorer Kit Board from the "Debug Adapters" on the left before creating a project. +1. Create a "Platform - Empty C Project" project for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_accelerometer_mma8452q/app.c` into the project root folder (overwriting the existing file). @@ -50,22 +61,34 @@ You can either create a project based on an example project or start with an emp 4. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - [Services] → [IO Stream] → [IO Stream: USART] with the default instance name: vcom. - - [Application] → [Utility] → [Log]. - - [Third Party Hardware Drivers] → [Sensors] → [MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun)] + **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] with the default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Sensors] → [MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** -5. Build and flash the project to your device. + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun)] + +5. Install "Printf float" + + - Open Properties of the project. + + - Select C/C++ Build > Settings > Tool Settings > GNU ARM C Linker > General > Check "Printf float". + +6. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun)" component. +- SDK Extension must be enabled for the project to install the "MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun)" component ## How It Works ## @@ -75,7 +98,7 @@ The device can be in either Standby Mode or Active Mode. Most of the settings ar Some functionality of MMA8452Q includes the following: -- Device calibration: The device interface is factory calibrated for sensitivity and zero-g offset for each axis. The trim values are stored in non-volatile memory (NVM). On power-up, the trim parameters are read from NVM and applied to the circuitry. However, the MMA8452Q allows the user to adjust the zero-g offset for each axis after power-up, changing the default offset values. The user offset adjustments are stored in six volatile registers. A calibration routine is provided as a function of the driver. You can call +- Device calibration: The device interface is factory-calibrated for sensitivity and zero-g offset for each axis. The trim values are stored in non-volatile memory (NVM). On power-up, the trim parameters are read from NVM and applied to the circuitry. However, the MMA8452Q allows the user to adjust the zero-g offset for each axis after power-up, changing the default offset values. The user offset adjustments are stored in six volatile registers. A calibration routine is provided as a function of the driver. You can call ```c sl_status_t mma8452q_auto_calibrate(void); @@ -83,7 +106,7 @@ Some functionality of MMA8452Q includes the following: This function performs calibration steps and stores new offset information internally on the MMA8452Q device. Caution should be used when performing - this function as this should be done with a device in specific (FRONT) + this function as this should be done with a device in a specific (FRONT) orientation. - 8-bit or 12-bit data: The measured acceleration data is stored in the OUT_X_MSB, OUT_X_LSB, OUT_Y_MSB, OUT_Y_LSB, OUT_Z_MSB, and OUT_Z_LSB registers as 2’s complement 12-bit numbers. The most significant 8-bits of each axis are stored in OUT_X (Y, Z)_MSB, so applications needing only 8-bit results can use these three registers and ignore OUT_X, Y, Z_LSB. To do this, the @@ -93,7 +116,7 @@ F_READ bit in CTRL_REG1 must be set. When the F_READ bit is cleared, the fast-re sl_status_t sl_mma8452q_get_acceleration(uint16_t avec[3]); ``` - This function verifies whether the driver configuration is 8-bit or 12-bit data. If this configuration is 8-bit data, this function read data registers via block read, skipping LSBs when appropriate. + This function verifies whether the driver configuration is 8-bit or 12-bit data. If this configuration is 8-bit data, this function reads data registers via block read, skipping LSBs when appropriate. - Low-power modes vs high-resolution modes: Low-power modes vs high-resolution modes The MMA8452Q can be optimized for lower power modes or higher resolution of the output data. High resolution is achieved by setting the LNOISE bit in register 0x2A. This improves the resolution but is aware that the dynamic range is limited to 4 g when this bit is set. This will affect all internal functions and reduce noise. Another method for improving the resolution of the data is by oversampling. There is a trade-off between low power and high resolution. Low power can be achieved when the oversampling rate is reduced. @@ -102,9 +125,9 @@ The MMA8452Q can be optimized for lower power modes or higher resolution of the sl_status_t mma8452q_set_mods(mma8452q_mods_t mods); ``` - This function sets the active power mode of the MMA8452Q. This mode can be normal, low noise low power, high-resolution, or low power. + This function sets the active power mode of the MMA8452Q. This mode can be normal, low noise low power, high resolution, or low power. -- Auto-wake/sleep mode: Auto-wake/sleep mode allows the system can automatically transition to a higher sample rate (higher current consumption) when needed but spends the majority of the time in the sleep mode (lower current) when the device does not require higher sampling rates. Auto-wake refers to the device being triggered by one of the interrupt functions to transition to a higher sample rate. This may also interrupt the processor to transition from a sleep mode to a higher power mode. Sleep mode occurs after the accelerometer has not detected an interrupt for longer than the user-definable time-out period. The device will transition to the specified lower sample rate. It may also alert the processor to go into a lower power mode to save on current during this period of inactivity. You can choose interrupts that can wake the device from sleep by the function below: +- Auto-wake/sleep mode: Auto-wake/sleep mode allows the system can automatically transition to a higher sample rate (higher current consumption) when needed but spends the majority of the time in the sleep mode (lower current) when the device does not require higher sampling rates. Auto-wake refers to the device being triggered by one of the interrupt functions to transition to a higher sample rate. This may also interrupt the processor's transition from a sleep mode to a higher power mode. Sleep mode occurs after the accelerometer has not detected an interrupt for longer than the user-definable time-out period. The device will transition to the specified lower sample rate. It may also alert the processor to go into a lower power mode to save on current during this period of inactivity. You can choose interrupts that can wake the device from sleep by the function below: ```c sl_status_t mma8452q_config_interrupt(mma8452q_interrupt_config_t interrupt_cfg); @@ -118,7 +141,7 @@ The MMA8452Q can be optimized for lower power modes or higher resolution of the mma8452q_aslp_config_t aslp_cfg); ``` -- Freefall and motion detection: MMA8452Q has flexible interrupt architecture for detecting either a freefall or a motion. Freefall can be enabled where the set threshold must be less than the configured threshold, or motion can be enabled where the set threshold must be greater than the threshold. You can configure the freefall/motion function settings of the MMA8452Q through the function. +- Freefall and motion detection: MMA8452Q has a flexible interrupt architecture for detecting either a freefall or a motion. Freefall can be enabled where the set threshold must be less than the configured threshold, or motion can be enabled where the set threshold must be greater than the threshold. You can configure the freefall/motion function settings of the MMA8452Q through the function. ```c sl_status_t mma8452q_config_ff_mt(mma8452q_ff_mt_config_t ff_mt_cfg); @@ -136,7 +159,7 @@ The MMA8452Q can be optimized for lower power modes or higher resolution of the sl_status_t mma8452q_config_orientation(mma8452q_orientation_config_t orient_cfg); ``` -- Pulse detection(single/double tap): The MMA8452Q has embedded single/double and directional pulse detection. This function has various customizing timers for setting the pulse time width and the latency time between pulses. There are programmable thresholds for all three axes. The pulse detection can be configured to run through the high-pass filter and also through a low-pass filter, which provides more customizing and tunable pulse-detection schemes. You can configure the pulse function settings of the MMA8452Q through the function. +- Pulse detection(single/double tap): The MMA8452Q has embedded single/double and directional pulse detection. This function has various customizing timers for setting the pulse time width and the latency time between pulses. There are programmable thresholds for all three axes. The pulse detection can be configured to run through the high-pass filter and also through a low-pass filter, which provides more customizing and tunable pulse detection schemes. You can configure the pulse function settings of the MMA8452Q through the function. ```c sl_status_t mma8452q_config_pulse(mma8452q_pulse_config_t pulse_cfg); @@ -158,7 +181,7 @@ The MMA8452Q can be optimized for lower power modes or higher resolution of the This simple test application demonstrates some of the available features of the accelerometer MMA8452Q, after initialization, the accelerometer MMA8452Q measures the value and return on the serial communication interface. -You can choose which type of test you want by uncommenting the #define. +You can choose which type of test you want by uncommenting the #define in the "app.c" file. ```c #define TEST_BASIC_READING @@ -174,25 +197,25 @@ Please follow the below steps to test the example: 2. Depending on the test mode defined in the app.c file, the code application can operate in different modes. -- If using **TEST_BASIC_READING** for testing, this example initializes the accelerometer and stream calculated x, y, z, and acceleration values from it (in g units). - -![basic reading](image/basic_reading.png "Basic Reading Result") - -- If using **TEST_RAW_DATA_READING** for testing, this example initializes the accelerometer and streams raw x, y, and z, acceleration values from it. - -![raw data reading](image/raw_data_reading.png "Raw Data Reading Result") + - If using **TEST_BASIC_READING** for testing, this example initializes the accelerometer and stream calculated x, y, z, and acceleration values from it (in g units). + + ![basic reading](image/basic_reading.png "Basic Reading Result") -- If using **TEST_ORIENTATION** for testing, this example initializes the accelerometer and streams its orientation. + - If using **TEST_RAW_DATA_READING** for testing, this example initializes the accelerometer and streams raw x, y, and z, acceleration values from it. + + ![raw data reading](image/raw_data_reading.png "Raw Data Reading Result") -![orientation reading](image/orientation_reading.png "Orientation Reading") + - If using **TEST_ORIENTATION** for testing, this example initializes the accelerometer and streams its orientation. + + ![orientation reading](image/orientation_reading.png "Orientation Reading") -- If using **TEST_READ_TAPS** for testing, this example initializes the accelerometer and print a message each time it is tape. + - If using **TEST_READ_TAPS** for testing, this example initializes the accelerometer and prints a message each time it is taped. -![tap reading](image/tap_reading.png "Tap Reading") + ![tap reading](image/tap_reading.png "Tap Reading") -- If use **TEST_FF_MT** for testing, this example initializes the accelerometer and prints a message each time it moves or freefall. The message shows which axis the sensor moves and in the positive or negative direction. + - If using **TEST_FF_MT** for testing, this example initializes the accelerometer and prints a message each time it moves or freefalls. The message shows which axis the sensor moves in the positive or negative direction. -![motion and freefall](image/motion_freefall.png "Motion and FreeFall") + ![motion and freefall](image/motion_freefall.png "Motion and FreeFall") ## Report Bugs & Get Support ## diff --git a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/api_overview.png b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/api_overview.png index 1ab78576..d53c912e 100644 Binary files a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/api_overview.png and b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/api_overview.png differ diff --git a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/create_example.png b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/create_example.png index fe9d72f7..07400d3e 100644 Binary files a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/create_example.png and b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_connection.png b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_connection.png index 9b02380e..01bf42ba 100644 Binary files a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_connection.png and b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_connection.png differ diff --git a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_jumper.png b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_jumper.png index 433f041d..dfe3a933 100644 Binary files a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_jumper.png and b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_jumper.png differ diff --git a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/power_mode.png b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/power_mode.png index 2ce5a079..ecc9f24e 100644 Binary files a/app/documentation/example/sparkfun_accelerometer_mma8452q/image/power_mode.png and b/app/documentation/example/sparkfun_accelerometer_mma8452q/image/power_mode.png differ diff --git a/app/documentation/example/sparkfun_air_quality_sgp40/README.md b/app/documentation/example/sparkfun_air_quality_sgp40/README.md index a7d9be3d..54368e9a 100644 --- a/app/documentation/example/sparkfun_air_quality_sgp40/README.md +++ b/app/documentation/example/sparkfun_air_quality_sgp40/README.md @@ -2,27 +2,37 @@ ## Summary ## -This project shows the implementation of an SGP40 that is new digital VOC (volatile organic compounds) sensor designed for easy integration into air purifiers or demand-controlled ventilation, integrated on the Air Quality Sensor. +This project shows the implementation of an SGP40 that is new digital VOC (volatile organic compounds) sensor designed for easy integration into air purifiers or demand-controlled ventilation, integrated into the Air Quality Sensor. You can use this example as a reference for creating your own indoor air quality monitoring application. You can visualize the measured volatile organic compound (VOC) level by a display or you can transfer the measurements to a data center or mobile phone, which can trigger warning messages or start air freshener devices. -## Quick Look Video +## Quick Look Video ## [![SGP 40 Quick Look Video](image/yt_thumbnail.jpg)](https://youtu.be/6eyTzxQM3K0 "Quick Look - SparkFun Air Quality Sensor SGP40 – Silicon Labs") ## Required Hardware ## -- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit). - -- [Air Quality Sensor](https://www.sparkfun.com/products/18345). +- [EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [Air Quality Sensor](https://www.sparkfun.com/products/18345) ## Hardware Connection ## -The Air Quality Sensor support Qwiic, so it can connect easily to EFR32xG24 Explorer Kit's Qwiic header. +- **If the EFR32xG24 Explorer Kit is used**: + + The Air Quality Sensor supports Qwiic, so it can connect easily to the Qwiic header of the EFR32xG24 Explorer Kit. + + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![board](image/hardware_connection.png "Hardware connection") -![board](image/hardware_connection.png "Hardware connection") +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + | Description | BRD4338A GPIO | BRD4002 EXP Header | Air Quality Sensor | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -30,37 +40,43 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter sgp40 +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "sgp40". 2. Click **Create** button on the **Third Party Hardware Drivers - SGP40 - Air Quality Sensor (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. -2. Copy the file `app/example/sparkfun_air_quality_sgp40/app.c` into the project root folder (overwriting existing file). +2. Copy the file `app/example/sparkfun_air_quality_sgp40/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - **[Services] → [Timers] → [Sleep Timer]** - - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Third Party Hardware Drivers] → [Sensors] → [SGP40 - Air Quality Sensor (Sparkfun)]** + **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Sensors] → [SGP40 - Air Quality Sensor (Sparkfun)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [SGP40 - Air Quality Sensor (Sparkfun)] 4. Build and flash this example to the board. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "SGP40 - Air Quality Sensor (Sparkfun)" component. @@ -70,15 +86,15 @@ You can launch Console that's integrated into Simplicity Studio or use a third-p - Test the sensor and start to measure -![logging_screen](image/log1.png) + ![logging_screen](image/log1.png) - After trying to put the sensor near a source of Volatile Organic Compounds (VOCs) -![logging_screen](image/log2.png) + ![logging_screen](image/log2.png) - After trying to put the sensor away a source of Volatile Organic Compounds (VOCs) -![logging_screen](image/log3.png) + ![logging_screen](image/log3.png) ## Report Bugs & Get Support ## diff --git a/app/documentation/example/sparkfun_air_quality_sgp40/image/create_example.png b/app/documentation/example/sparkfun_air_quality_sgp40/image/create_example.png index 724656c0..cbee44c9 100644 Binary files a/app/documentation/example/sparkfun_air_quality_sgp40/image/create_example.png and b/app/documentation/example/sparkfun_air_quality_sgp40/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_air_quality_sgp40/image/hardware_connection.png b/app/documentation/example/sparkfun_air_quality_sgp40/image/hardware_connection.png index a2364f2a..fe55ec30 100644 Binary files a/app/documentation/example/sparkfun_air_quality_sgp40/image/hardware_connection.png and b/app/documentation/example/sparkfun_air_quality_sgp40/image/hardware_connection.png differ diff --git a/app/documentation/example/sparkfun_distance_vl53l1x/README.md b/app/documentation/example/sparkfun_distance_vl53l1x/README.md index 3cbdc54b..a9dd6ac4 100644 --- a/app/documentation/example/sparkfun_distance_vl53l1x/README.md +++ b/app/documentation/example/sparkfun_distance_vl53l1x/README.md @@ -2,40 +2,50 @@ ## Summary ## -This project shows the integration of the ST's [VL53L1x distance sensor ultra-lite driver](https://www.st.com/en/imaging-and-photonics-solutions/vl53l1x.html#tools-software) API with GSDK. +This project shows the integration of the ST's [VL53L1x distance sensor ultra-lite driver](https://www.st.com/en/imaging-and-photonics-solutions/vl53l1x.html#tools-software) APIs using Silicon Labs platform. VL53L1X is a state-of-the-art, Time-of-Flight (ToF), laser-ranging sensor. It is the fastest miniature ToF sensor on the market with accurate ranging up to 4 m and fast ranging frequency up to 50 Hz. It is housed in a miniature and reflowable package, which integrates an SPAD receiving array from a 940 nm invisible Class1 laser emitter. It incorporates physical infrared filters and optics to achieve the best ranging performance in various ambient lighting conditions. By combining this sensor with Silicon Labs wireless technology, you can make your own applications, such as distance monitoring, people counting and so on. ## Hardware Required ## -- [BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- [BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [SparkFun Distance Sensor Breakout - 4 Meter, VL53L1X (Qwiic)](https://www.sparkfun.com/products/14722) or [MikroE LIGHTRANGER 4 Click](https://www.mikroe.com/lightranger-4-click) ## Connections Required ## A VL53L1X sensor board can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. -![connection](image/connection.png) +- If the BGM220P Explorer Kit is used: -## Setup ## + The hardware connection is shown in the image below: + + ![connection](image/connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -To test this application, you should connect the BMG220 Explorer Kit Board to the PC using a microUSB cable. + | Description | BRD4338A GPIO | BRD4002 EXP Header | Sparkfun AK9753 sensor board | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + +## Setup ## You can either create a project based on an example project or start with an empty example project. ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter: vl53l1x. +1. From the Launcher Home, add used board BRD4314A(BGM220) or BRD4338A(SiWx917) to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *vl53l1x*. 2. Click **Create** button on the **Third Party Hardware Drivers - VL53L1X - Distance Sensor (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" project for the "BGM220 Explorer Kit Board" using Simplicity Studio 5. Use the default project settings. Be sure to connect and select the BGM220 Explorer Kit Board from the "Debug Adapters" on the left before creating a project. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_distance_vl53l1x/app.c` into the project root folder (overwriting the existing file). @@ -46,17 +56,26 @@ You can either create a project based on an example project or start with an emp - Select the SOFTWARE COMPONENTS tab. - Install the following components - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → instance name: **vcom** - - [Application] → [Utility] → [Log] - - **[Third Party Hardware Drivers] → [Sensors] → [VL53L1X - Distance Sensor Breakout (Sparkfun)]** - *** + + - If the **BGM220P Explorer Kit** is used: + + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: USART] → instance name: **vcom** + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: **qwiic** + - [Third Party Hardware Drivers] → [Sensors] → [**VL53L1X - Distance Sensor Breakout (Sparkfun)**] + + - If the **SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit** is used: + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [**VL53L1X - Distance Sensor Breakout (Sparkfun)**] 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **VL53L1X - Distance Sensor Breakout (Sparkfun) - I2C** component. @@ -64,7 +83,7 @@ You can either create a project based on an example project or start with an emp ### API Overview ### -The driver is divided into three layers, a platform, a core, and an interface layer. The core layer implements the key features, the platform layer provides integration to the host microcontroller hardware-dependent codes. (In practice it integrates the I2CSPM platform service.). Above these levels, the upper layer provides an interface with standard Silabs return codes and complies with Silicon Labs coding standards. +The driver is divided into three layers, a platform, a core, and an interface layer. The core layer implements the key features, the platform layer provides integration to the host microcontroller hardware-dependent codes. (In practice it integrates the I2CSPM platform service.). Above these levels, the upper layer provides an interface with standard Silabs return codes and complies with Silicon Labs coding standards. ![software_layers](image/software_layers.png) @@ -78,7 +97,7 @@ The driver is divided into three layers, a platform, a core, and an interface la ### Testing ### -Use Putty or another program to read the serial output. The BGM220P uses by default a baudrate of 115200. You should expect a similar output to the one below. +Use Putty or another program to read the serial output. Configure right baudrate for the connection. You should expect a similar output to the one below. ![console](image/console.png) diff --git a/app/documentation/example/sparkfun_distance_vl53l1x/image/create_example.png b/app/documentation/example/sparkfun_distance_vl53l1x/image/create_example.png index 63cf147c..5c25e80c 100644 Binary files a/app/documentation/example/sparkfun_distance_vl53l1x/image/create_example.png and b/app/documentation/example/sparkfun_distance_vl53l1x/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_dosimeter_type5/README.md b/app/documentation/example/sparkfun_dosimeter_type5/README.md index 7892dd3f..85f997b9 100644 --- a/app/documentation/example/sparkfun_dosimeter_type5/README.md +++ b/app/documentation/example/sparkfun_dosimeter_type5/README.md @@ -2,7 +2,7 @@ ## Overview ## -This project aims to show the hardware driver that is used to interface with the Type5 Geiger Sensor via APIs of GSDK. +This project aims to show the hardware driver that is used to interface with the Type5 Geiger Sensor using Silicon Labs platform. The Type 5 Pocket Geiger Radiation Sensor from Radiation Watch is a highly sensitive radiation sensor designed for the embedded systems market. It is capable of detecting Gamma and Beta radiation. The sensor has a simple pulsed output that can be used with any microcontroller. It is beneficial for detecting the levels of ionizing radiation, used as a medical equipment, and as personal dosimeters. By combining this sensor with Silicon Labs wireless technology, it is possible to send the collected information to a data center or trigger a remote protection system. @@ -10,24 +10,37 @@ The Type 5 Pocket Geiger Radiation Sensor from Radiation Watch is a highly sensi ## Hardware Required ## -- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit). +- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) -- [Pocket Geiger Radiation Sensor - Type 5](https://www.sparkfun.com/products/14209). +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + +- [Pocket Geiger Radiation Sensor - Type 5](https://www.sparkfun.com/products/14209) ## Connections Required ## -Connect the Pocket Geiger Type 5 board to the BGM220 Explorer Kit through GPIO. +- If the BGM220P Explorer Kit is used: + + Connect the Pocket Geiger Type 5 board to the BGM220 Explorer Kit through GPIO. + + ![connection](image/connection.png) -![connection](image/connection.png) + By default, the binding used is as the table below: -By default, the binding used is as the table below: + | Description | BGM220 Explorer Kit pin | Pocket Geiger pin | + | ----------------------------- | ----------------------- | ----------------- | + | DC 3V~9V | 5V | +V | + | GND | GND | GND | + | Radiation-detection pulse pin | PB2 | SIG | + | Noise-detection pulse pin | PB3 | NS | -| Pocket Geiger pin | BGM220 Explorer Kit pin | Standing for | -| ------------------ | ----------------------- | ----------------------------- | -| +V | 5V | Alimentation pin (DC 3V~9V) | -| GND | GND | Ground pin | -| SIG | 2 | Radiation-detection pulse pin | -| NS | 3 | Noise-detection pulse pin | +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 Breakout Pad | Pocket Geiger pin | + | ----------------------------- | -------------- | -------------------- | ------------------- | + | DC 3V~9V | 5V | 5V | +V | + | GND | GND | GND | GND | + | Radiation-detection pulse pin | GPIO_46 | P24 | SIG | + | Noise-detection pulse pin | GPIO_47 | P26 | NS | ## Setup ## @@ -35,10 +48,11 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter radiation. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *radiation*. 2. Click **Create** button on the **Third Party Hardware Drivers - Pocket Geiger Radiation Sensor - Type 5 (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. @@ -56,9 +70,12 @@ You can either create a project based on an example project or start with an emp - Install the following components: + - **If the BGM220P Explorer Kit is used:** - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] → [Sensors] → [Pocket Geiger Radiation - Type 5 (Sparkfun)] + - [Third Party Hardware Drivers] → [Sensors] → [Pocket Geiger Radiation - Type 5 (Sparkfun)] → use default configuration + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Third Party Hardware Drivers] → [Sensors] → [Pocket Geiger Radiation - Type 5 (Sparkfun)] → use default configuration 4. Install printf float @@ -72,7 +89,7 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **Pocket Geiger Radiation - Type 5 (Sparkfun)** component. @@ -89,7 +106,7 @@ You can either create a project based on an example project or start with an emp ### Testing ### The application monitors the Pocket Geiger through interrupts, processes and allows to get back the data using a callback function. -Use Putty or other program to read the serial output. The BGM220P uses by default a baudrate of 115200. You should expect a similar output to the one below. +Use Putty or other program to read the serial output. The board uses by default a baudrate of 115200. You should expect a similar output to the one below. ![logging_screen](image/log.png) diff --git a/app/documentation/example/sparkfun_dosimeter_type5/image/create_example.png b/app/documentation/example/sparkfun_dosimeter_type5/image/create_example.png index 88166616..c92174d0 100644 Binary files a/app/documentation/example/sparkfun_dosimeter_type5/image/create_example.png and b/app/documentation/example/sparkfun_dosimeter_type5/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_dosimeter_type5/image/log.png b/app/documentation/example/sparkfun_dosimeter_type5/image/log.png index 326253d2..422b8bea 100644 Binary files a/app/documentation/example/sparkfun_dosimeter_type5/image/log.png and b/app/documentation/example/sparkfun_dosimeter_type5/image/log.png differ diff --git a/app/documentation/example/sparkfun_environmental_bme280_ccs811/README.md b/app/documentation/example/sparkfun_environmental_bme280_ccs811/README.md index 199be058..9e1ab9f6 100644 --- a/app/documentation/example/sparkfun_environmental_bme280_ccs811/README.md +++ b/app/documentation/example/sparkfun_environmental_bme280_ccs811/README.md @@ -6,10 +6,12 @@ This example project shows an example for environmental parameter collection wit The CCS811/BME280 (Qwiic) Environmental Combo Breakout works together to take care of all of your atmospheric quality sensing needs with the CCS811 and BME280 ICs. The CCS811 is an exceedingly popular sensor, providing readings for equivalent CO2 (or eCO2) in the parts per million (PPM) and total volatile organic compounds in the parts per billion (PPB). The BME280 provides humidity, temperature, and barometric pressure. It is easy to interface with them via I2C. -## Hardware Required ## +## Required Hardware ## - [EFR32xG24-EK2703A Explorer Kit Board](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [BME280 - CCS811 SparkFun Environmental Combo Breakout (Qwiic)](https://www.sparkfun.com/products/14348) or [BME280 - SparkFun Atmospheric Sensor (Qwiic)](https://www.sparkfun.com/products/15440) @@ -18,15 +20,24 @@ The CCS811/BME280 (Qwiic) Environmental Combo Breakout works together to take ca ## Connections Required ## -The Environmental Sensor support Qwiic, so it can connect easily to EFR32xG24 Explorer Kit's Qwiic header. +- If the EFR32xG24 Explorer Kit is used: + + The Environmental Sensor support Qwiic, so it can connect easily to the Qwiic header of the Explorer Kit. + + The hardware connection is shown in the image below: -The hardware connection is shown in the image below: + ![board](image/hardware_connection.png) -![board](image/hardware_connection.png) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun Environmental Sensor Combo Breakout | + | -------------| ------------- | ------------------ | ---------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | **Note:** -- If you want to conserve power, you should connect the **PB0** pin on the EFR32MG24 board to the **WAK** pin on the Environmental Combo Breakout board to change the sensor's active and sleep states. +- If you want to conserve power, you should connect **WAK** pin on the Environmental Combo Breakout board to your board to change the sensor's active and sleep states. ## Setup ## @@ -34,16 +45,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **bme280, ccs811** +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *bme280, ccs811*. + +2. Click Create button on the project **Third Party Hardware Drivers - BME280 & CCS811 - Environmental Sensor Combo Breakout (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -2. Click **Create** button on the **Third Party Hardware Drivers - BME280 & CCS811 - Environmental Sensor Combo Breakout (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32MG24 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file [app.c](https://github.com/SiliconLabs/third_party_hw_drivers_extension/tree/master/app/example/sparkfun_environmental_bme280_ccs811) (overwriting the existing file), into the project root folder. @@ -55,19 +67,29 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - [Services] → [Timers] → [Sleep Timer] - - [Third Party Hardware Drivers] → [Sensors] → [BME28 - Atmospheric Sensor (Sparkfun)] - - [Third Party Hardware Drivers] → [Sensors] → [CCS811 - Air Quality Sensor (Sparkfun)] + **If the EFR32xG24 Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Services] → [Timers] → [Sleep Timer] + - [Third Party Hardware Drivers] → [Sensors] → [BME28 - Atmospheric Sensor (Sparkfun)] + - [Third Party Hardware Drivers] → [Sensors] → [CCS811 - Air Quality Sensor (Sparkfun)] + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [BME28 - Atmospheric Sensor (Sparkfun)] + - [Third Party Hardware Drivers] → [Sensors] → [CCS811 - Air Quality Sensor (Sparkfun)] 4. Build and flash this example to the board. **Note:** -- Make sure that the **Third-party Drivers Extensions** is installed. To install the extension, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- **Third-party Drivers Extensions** must be enabled for the project to install "BME280 - Atmospheric Sensor (Sparkfun)" or "CCS811 - Air Quality Sensor (Sparkfun)" component. +- Third-party Drivers Extension must be enabled for the project to install "BME280 - Atmospheric Sensor (Sparkfun)" or "CCS811 - Air Quality Sensor (Sparkfun)" component. ## How It Works ## @@ -86,5 +108,3 @@ You can launch Console that's integrated into Simplicity Studio or use a third-p To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. - - diff --git a/app/documentation/example/sparkfun_environmental_bme280_ccs811/image/create_example.png b/app/documentation/example/sparkfun_environmental_bme280_ccs811/image/create_example.png index 51abfc91..a7960fd9 100644 Binary files a/app/documentation/example/sparkfun_environmental_bme280_ccs811/image/create_example.png and b/app/documentation/example/sparkfun_environmental_bme280_ccs811/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/README.md b/app/documentation/example/sparkfun_gnss_max_m10s/README.md index 53be8151..a1c84f63 100644 --- a/app/documentation/example/sparkfun_gnss_max_m10s/README.md +++ b/app/documentation/example/sparkfun_gnss_max_m10s/README.md @@ -26,10 +26,10 @@ The SparkFun MAX-M10S GNSS Receiver Breakout is an ultra-low-power, high perform - If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: - | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun Micro OLED Breakout | - | -------------| ------------- | ------------------ | ---------------------------- | - | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | - | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun GNSS Receiver Breakout | + | -------------| ------------- | ------------------ | ------------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -39,14 +39,9 @@ To test this application, you can either create a project based on an example pr 1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *gnss*. -2. Click **Create** button on the project: +2. Click **Create** button on the **Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - - **Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun)** example if the BGM220P Explorer Kit is used. - ![create_example](image/create_example_1.png) - - **Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used. - ![create_example](image/create_example_2.png) - - Example project creation dialog pops up -> click Create and Finish and Project should be generated. + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. @@ -85,7 +80,7 @@ To test this application, you can either create a project based on an example pr **Note:** -- Make sure that the SDK extension has already be installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "MAX-M10S - GNSS Receiver Breakout - I2C" component. diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example.png b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example.png new file mode 100644 index 00000000..5ca8bcff Binary files /dev/null and b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png deleted file mode 100644 index 5bb2b622..00000000 Binary files a/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png and /dev/null differ diff --git a/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png b/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png deleted file mode 100644 index 5b66117e..00000000 Binary files a/app/documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png and /dev/null differ diff --git a/app/documentation/example/sparkfun_hr_po_max30101_max32664/README.md b/app/documentation/example/sparkfun_hr_po_max30101_max32664/README.md index a15063be..c0a5bb68 100644 --- a/app/documentation/example/sparkfun_hr_po_max30101_max32664/README.md +++ b/app/documentation/example/sparkfun_hr_po_max30101_max32664/README.md @@ -2,34 +2,34 @@ ## Summary ## -The SparkFun Pulse Oximeter and Heart Rate Sensor is an I2C based biometric sensor, utilizing two chips from Maxim Integrated: the MAX32664 Biometric Sensor Hub and the MAX30101 Pulse Oximetry and Heart Rate Module. While the latter does all the sensing, the former is an incredibly small and fast Cortex M4 processor that handles all of the algorithmic calculations, digital filtering, pressure/position compensation, advanced R-wave detection, and automatic gain control. +This example project shows an example for health parameters collection with the SparkFun Pulse Oximeter and Heart Rate Sensor driver integration with the Silicon Labs Platform. -The MAX30101 does all the sensing by utilizing its internal LEDs to bounce light off the arteries and arterioles in your finger's subcutaneous layer and sensing how much light is absorbed with its photodetectors. This is known as photoplethysmography. This data is passed onto and analyzed by the MAX32664 which applies its algorithms to determine heart rate and blood oxygen saturation (SpO2). SpO2 results are reported as the percentage of hemoglobin that is saturated with oxygen. It also provides useful information such as the sensor's confidence in its reporting as well as a handy finger detection data point. To get the most out of the sensor we've written an driver that compatible with EFR32 MCU to make it easy to adjust all the possible configurations. +The SparkFun Pulse Oximeter and Heart Rate Sensor is an I2C based biometric sensor, utilizing two chips from Maxim Integrated: the MAX32664 and MAX30101. MAX32664 is a Biometric Sensor Hub while MAX30101 is a Pulse Oximetry and Heart Rate Module. While the latter does all the sensing, the former is an incredibly small and fast Cortex M4 processor that handles all of the algorithmic calculations, digital filtering, pressure/position compensation, advanced R-wave detection, and automatic gain control. ## Required Hardware ## -- [A EFR32xG24 Explorer Kit board.](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit) - +- [A EFR32xG24 Explorer Kit board](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [SparkFun Pulse Oximeter and Heart Rate Sensor - MAX30101 & MAX32664 (Qwiic)](https://www.sparkfun.com/products/15219) -**NOTE:** -Tested boards for working with this example: +## Hardware Connection ## + +- **If the EFR32xG24 Explorer Kit is used**: -| Board ID | Description | -| ---------------------- | ------ | -| BRD2704A | [SparkFun Thing Plus Matter - MGM240P - BRD2704A](https://www.sparkfun.com/products/20270) | -| BRD2601B | [EFR32xG24 Dev Kit - xG24-DK2601B](https://www.silabs.com/development-tools/wireless/efr32xg24-dev-kit?tab=overview) | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4108A | [BG22 Bluetooth SoC Explorer Kit - BG22-EK4108A](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | + The SparkFun Pulse Oximeter and Heart Rate Sensor board support Qwiic, so it can connect easily to the Qwiic header of the Explorer Kit. -## Hardware Connection ## + ![hardware_connection](image/hardware_connection.png) -An MAX30101 & MAX32664 sensor board can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. + **Note:** This board has two additional pins on its header: the RESET and MFIO pin. These pins are required for the board to function because they determine if the board enters data collection mode or not. -![hardware_connection](image/hardware_connection.png) +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: -**Note:** This board has two additional pins on its header: the RESET and MFIO pin. These pins are required for the board to function because they determine if the board enters data collection mode or not. + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | MAX30101 & MAX32664 sensor board | + | -------------| ------------- | ------------------ | -------------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -37,41 +37,49 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ## -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter MAX32664. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "max32664". + +2. Click **Create** button on the project **Third Party Hardware Drivers - MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun)**. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -2. Click **Create** button on the **Third Party Hardware Drivers - MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![create_example](image/create_example.png) + ![create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ## -1. Create a "Platform - Empty C Project" project for the "xG24 Explorer Kit (xG24-EK2703A)" using Simplicity Studio v5. Use the default project settings. Be sure to connect and select the xG24 Explorer Kit (xG24-EK2703A) Board from the "Debug Adapters" on the left before creating a project. +1. Create an "Empty C Project" project for your board using Simplicity Studio v5. Use the default project settings -2. Copy the file `app/example/sparkfun_hr_po_max30101_max32664/app.c` into the project root folder (overwriting existing file). +2. Copy the file `app/example/sparkfun_hr_po_max30101_max32664/app.c` into the project root folder (overwriting existing file) -3. Set the test mode in the *app.c* file. +3. Set the test mode in the *app.c* file 4. Install the software components: - - Open the .slcp file in the project. + - Open the .slcp file in the project - - Select the SOFTWARE COMPONENTS tab. + - Select the SOFTWARE COMPONENTS tab - Install the following components: - - [Services] → [IO Stream] → [IO Stream: USART] with the default instance name: vcom. - - [Services] → [Timer] → [Sleep Timer] - - [Application] → [Utility] → [Log]. + **If the EFR32xG24 Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] with the default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance - [Third Party Hardware Drivers] → [Sensors] → [MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun)] → use default configuration -5. Build and flash the project to your device. + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun)] → use default configuration + +5. Build and flash the project to your device **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/platform_hardware_drivers_sdk_extensions/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide) -- SDK Extension must be enabled for the project to install "MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun)" component. +- Third-party Hardware Drivers Extension must be enabled for the project to install "MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun)" component ## How It Works ## @@ -101,6 +109,7 @@ As shown below, the library uses a type that is unique to the SparkFun Pulse Oxi #### BioData Mode 2 #### In addition to the information above, mode 2 also gives the following two data points. + | BioData Members | Information | | --- | --- | | body.r_value | Sp02 r Value | @@ -109,6 +118,7 @@ In addition to the information above, mode 2 also gives the following two data p #### Finger Status #### Below is a reference table for the body.status member which tells you if the sensor has detected a finger or some other object that is not a finger. It relays this information with four numbers: 0-3. + | Status Number | Description | | --- | --- | | 0 | No Object Detected | @@ -117,41 +127,44 @@ Below is a reference table for the body.status member which tells you if the sen | 3 | Finger Detected | Below is a reference table for the body.exStatus member which is an expansion of the first finger status messaging. This is enabled in mode 2 and contains 8 different values. + | Status Number | Description | | --- | --- | -| 0 | Success -| 1 | Not Ready -| -1 | Object Detected -| -2 | Excessive Sensor Device Motion -| -3 | No object detected -| -4 | Pressing too hard -| -5 | Object other than finger detected -| -6 | Excessive finger motion +| 0 | Success | +| 1 | Not Ready | +| -1 | Object Detected | +| -2 | Excessive Sensor Device Motion | +| -3 | No object detected | +| -4 | Pressing too hard | +| -5 | Object other than finger detected | +| -6 | Excessive finger motion | #### Pulse Width vs. Sample Collection #### There is trade off between higher resolution (i.e. longer pulse width) and the number of samples that you can collect per second. The table below shows how the resolution and sample rate interact. -| Samples/Second | Pulse | Width | (uS) | -| --- | --- | --- | --- | -| 69 | 118 | 215 | 411 -| 50 | O | O | O | O -| 100 | O | O | O | O -| 200 | O | O | O | O -| 400 | O | O | O | -| 800 | O | O | O | -| 1000 | O | O | -| 1600 | O | -| Resolution (bits) | 15 | 16 | 17 | 18 | + +| Samples/Second | Pulse | Width | (uS) | | +| -------------- | ----- | ----- | ---- |-----| +| | 69 | 118 | 215 | 411 | +| 50 | O | O | O | O | +| 100 | O | O | O | O | +| 200 | O | O | O | O | +| 400 | O | O | O | O | +| 800 | O | O | O | | +| 1000 | O | O | | | +| 1600 | O | | | | +| 3200 | | | | | +| Resolution (bits) | 15 | 16 | 17 | 18 | ### Testing ### This example demonstrates some of the available features of the Pulse Oximeter and Heart Rate Sensor. Follow the below steps to test the example: -1. On your PC open a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. +1. On your PC open a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. Note that your board uses the default baud rate of 115200. 2. Try to put your finger on the sensor with a proper pressure (solid contact between the finger and the sensor without optical leakage and don’t press with force) and check the logs on the terminal. -![logging_screen](image/logs.png) + ![logging_screen](image/logs.png) ## Report Bugs & Get Support ## diff --git a/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/create_example.png b/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/create_example.png index b3a8fce6..23532412 100644 Binary files a/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/create_example.png and b/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/logs.png b/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/logs.png index aba242d8..a2232f93 100644 Binary files a/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/logs.png and b/app/documentation/example/sparkfun_hr_po_max30101_max32664/image/logs.png differ diff --git a/app/documentation/example/sparkfun_human_presence_ak9753/README.md b/app/documentation/example/sparkfun_human_presence_ak9753/README.md index 1238066c..86c73772 100644 --- a/app/documentation/example/sparkfun_human_presence_ak9753/README.md +++ b/app/documentation/example/sparkfun_human_presence_ak9753/README.md @@ -2,38 +2,46 @@ ## Summary ## -The AK9753 is a low-power and compact infrared-ray (IR) sensor module. It is composed of four -quantum IR sensors and an integrated circuit (IC) for characteristic compensation. The four IR sensors’ -offset and gain variations are calibrated at shipment. An integral analog-to-digital converter provides -16-bit data outputs. The AK9753 is suitable for several feet human detector by using external lens. +The AK9753 is a low-power and compact infrared-ray (IR) sensor module. It is composed of four quantum IR sensors and an integrated circuit (IC) for characteristic compensation. The four IR sensors' offset and gain variations are calibrated at shipment. An integral analog-to-digital converter provides +16-bit data outputs. The AK9753 is suitable for several-foot human detectors by using the external lens. The goal is to provide a hardware driver that supports the basic IR measurement readout, along with configuration for the various embedded functionality and interrupt generation. ## Required Hardware ## -- [A BGM220P Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) - +- [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [SparkFun Human Presence AK9753 Board (Qwiic)](https://www.sparkfun.com/products/14349) ## Hardware Connection ## -An AK9753 sensor board can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. +- **If the BGM220P Explorer Kit is used**: + + An AK9753 sensor board can be easily connected with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. The hardware connection is shown in the image below: + + ![hardware_connection](image/hardware_connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: -![hardware_connection](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | Sparkfun AK9753 sensor board | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | -**Note:** Normal Mode / Switch Mode selection is controlled by the CAD1 pin and CAD0 pin. -When CAD1 pin and CAD0 pin are set as CAD1 pin= CAD0 pin= “H”, the digital output can be used -through the I2C interface. When CAD1 pin and CAD0 pin are set as CAD1 pin= CAD0 pin= “H”, Switch Mode is selected. When Switch Mode is selected, SCL pin and SDA pin should be tied to “H”. (Do not access the AK9753 through the I2C interface in Switch Mode.) -| CAD1 | CAD0 | I2C output | Slave address |Mode | -| --------- | ---- | ---------- | ------------- | ---------- | -| L | L | Enable | 64H | Normal Mode| -| L | H | Enable | 65H | Normal Mode| -| H | L | Enable | 66H | Normal Mode| -| H | H | Disable | Prohibited | Switch Mode| +- **Note:** Normal Mode / Switch Mode selection is controlled by the CAD1 pin and CAD0 pin. When CAD1 pin and CAD0 pin are set as CAD1 pin= CAD0 pin= “H”, the digital output can be used through the I2C interface. When CAD1 pin and CAD0 pin are set as CAD1 pin= CAD0 pin= “H”, Switch Mode is selected. When Switch Mode is selected, SCL pin and SDA pin should be tied to “H”. (Do not access the AK9753 through the I2C interface in Switch Mode.) + + | CAD1 | CAD0 | I2C output | Slave address |Mode | + | --------- | ---- | ---------- | ------------- | ---------- | + | L | L | Enable | 64H | Normal Mode| + | L | H | Enable | 65H | Normal Mode| + | H | L | Enable | 66H | Normal Mode| + | H | H | Disable | Prohibited | Switch Mode| -The second of which is the I2C pull-up jumper. If multiple boards are connected to the I2C bus, the equivalent resistance goes down, increasing your pull-up strength. If multiple boards are connected on the same bus, make sure only one board has the pull-up resistors connected. +- The second of which is the I2C pull-up jumper. If multiple boards are connected to the I2C bus, the equivalent resistance goes down, increasing your pull-up strength. If multiple boards are connected on the same bus, make sure only one board has the pull-up resistors connected. -![hardware_jumper](image/hardware_jumper.png) + ![hardware_jumper](image/hardware_jumper.png) ## Setup ## @@ -41,44 +49,51 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "AK9753". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "ak9753". + +2. Click **Create** button on the **Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -2. Click **Create** button on the **Third Party Hardware Drivers - AK9753 - Human Presence Sensor (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_human_presence_ak9753/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: + + - **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Sensors] → [AK9753 - Human Presence Sensor (Sparkfun) - I2C] → use default configuration - - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Third Party Hardware Drivers] → [Sensors] → [AK9753 - Human Presence Sensor (Sparkfun) - I2C]** → use default configuration + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [AK9753 - Human Presence Sensor (Sparkfun) - I2C] → use default configuration -4. Install printf float +4. Install "printf float" - Open Properties of the project. - Select C/C++ Build > Settings > Tool Settings >GNU ARM C Linker > General. Check Printf float. - ![float](image/float.png) + ![float](image/float.png) 5. Build and flash the project to your device. **Note:** -- Make sure the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **AK9753 - Human Presence Sensor (Sparkfun) - I2C** component. @@ -104,7 +119,7 @@ You can either create a project based on an example project or start with an emp 8. EEPROM access Mode -![normal_mode](image/normal_mode.png) + ![normal_mode](image/normal_mode.png) ### Switch Mode ### @@ -113,7 +128,7 @@ You can either create a project based on an example project or start with an emp 1. Power down Mode 2. Measurement Mode -![switch_mode](image/switch_mode.png) + ![switch_mode](image/switch_mode.png) Some functionality of AK9753 includes the following: @@ -153,7 +168,7 @@ Some functionality of AK9753 includes the following: sl_status_t sparkfun_ak9753_set_hysteresis_ir24(uint8_t hysteresisValue); ``` -- Hysteresis threshold in EEPROM: Set the hysteresis of threshold level for differential output IR2-IR4 stored in sensor EEPROM. +- Hysteresis threshold in EEPROM: Set the hysteresis of a threshold level for differential output IR2-IR4 stored in sensor EEPROM. ```c sl_status_t sparkfun_ak9753_set_eeprom_hysteresis_ir24(uint8_t hysteresisValue); @@ -167,19 +182,17 @@ Some functionality of AK9753 includes the following: - Read Sensor Data/Status: specific register read to get acceleration data and status. -`sparkfun_ak9753_platform.c`: implements APIs for low level. - - Low-level functions: initialize I2C communication, read/write a memory block via I2C, given memory address, and read/write a register via I2C, given register address. ### Testing ### This simple test application demonstrates the main of the available features of the human presence AK9753 sensor, after initialization, the human presence AK9753 sensor measures the value and return on the serial communication interface. -Please follow the below step to test the example: +Please follow the below steps to test the example: - Open a terminal program on your PC, such as the Console that is integrated into Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. -![simple test result](image/simple_test_result.png "simple test result") + ![simple test result](image/simple_test_result.png "simple test result") ## Report Bugs & Get Support ## diff --git a/app/documentation/example/sparkfun_human_presence_ak9753/image/create_example.png b/app/documentation/example/sparkfun_human_presence_ak9753/image/create_example.png index fc2f34f1..f7339df3 100644 Binary files a/app/documentation/example/sparkfun_human_presence_ak9753/image/create_example.png and b/app/documentation/example/sparkfun_human_presence_ak9753/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_human_presence_ak9753/image/hardware_jumper.png b/app/documentation/example/sparkfun_human_presence_ak9753/image/hardware_jumper.png index a6af311d..faf78193 100644 Binary files a/app/documentation/example/sparkfun_human_presence_ak9753/image/hardware_jumper.png and b/app/documentation/example/sparkfun_human_presence_ak9753/image/hardware_jumper.png differ diff --git a/app/documentation/example/sparkfun_ir_array_amg88xx/README.md b/app/documentation/example/sparkfun_ir_array_amg88xx/README.md index 885d6143..efd82364 100644 --- a/app/documentation/example/sparkfun_ir_array_amg88xx/README.md +++ b/app/documentation/example/sparkfun_ir_array_amg88xx/README.md @@ -1,31 +1,33 @@ -# AMG8833 Grid-EYE Infrared Array Breakout (Sparkfun) # +# AMG8833 - Grid-EYE Infrared Array Breakout (Sparkfun) # ## Summary ## This project shows the implementation of the [Panasonic amg88xx infrared array](https://industry.panasonic.eu/components/sensors/industrial-sensors/grid-eye/amg88xx-high-performance-type/amg8833-amg8833) driver using the [EFR32xG24 Dev Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-dev-kit?tab=overview) and the [SparkFun Grid-EYE AMG8833 infrared array](https://www.sparkfun.com/products/14607). The driver includes every known functionality of the amg88xx device, such as sensor readings, power settings, interrupt setup, and more. The Grid-EYE from Panasonic is an 8x8 thermopile array. This means you have a square array of 64 pixels each capable of independent temperature detection. It’s like having thermal camera (or Predator’s vision), just in really low resolution. It's part of SparkFun's Qwiic system, so it is easier to connect to get your low-resolution infrared image. + ## Required Hardware ## - [EFR32xG24 Dev Kit (BRD2601B)](https://www.silabs.com/development-tools/wireless/efr32xg24-dev-kit?tab=overview) -- [SparkFun Grid-EYE Infrared Array Breakout - AMG8833 (Qwiic)](https://www.sparkfun.com/products/14607) -**NOTE:** -Tested boards for working with this example: +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -| Board ID | Description | -| ---------------------- | ------ | -| BRD2704A | [SparkFun Thing Plus Matter - MGM240P - BRD2704A](https://www.sparkfun.com/products/20270) | -| BRD2601B | [EFR32xG24 Dev Kit - xG24-DK2601B](https://www.silabs.com/development-tools/wireless/efr32xg24-dev-kit?tab=overview) | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4108A | [BG22 Bluetooth SoC Explorer Kit - BG22-EK4108A](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | +- [SparkFun Grid-EYE Infrared Array Breakout - AMG8833 (Qwiic)](https://www.sparkfun.com/products/14607) ## Connections Required ## -The breakout board is connected to the dev kit with a Qwiic connector +- If the EFR32xG24 Dev Kit is used: + + The breakout board is connected to the dev kit with a Qwiic connector + + ![Dev kit connection diagram](image/dev_kit.jpg) -![Dev kit connection diagram](image/dev_kit.jpg) +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | Grid-EYE Infrared Array Breakout | + | -------------| ------------- | ------------------ | ---------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -33,31 +35,62 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2601B to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "amg88xx". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *amg88xx*. + +2. Click Create button on the project **Third Party Hardware Drivers - AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -2. Click **Create** button on the **Third Party Hardware Drivers - AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" project for the EFR32xG24 Dev Kit using SimplicityStudio 5. Use the default project settings. Be sure to connect and select the EFR32xG24 Dev Kit from the "Debug Adapters" on the left before creating a project. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. -2. Copy the files `app/example/sparkfun_ir_array_amg88xx/app.c`, `app/example/sparkfun_ir_array_amg88xx/app_cli_command_table.c`, `app/example/sparkfun_ir_array_amg88xx/app_ir_array_cli_cmds.c` into the project root folder (overwriting the existing file). +2. Copy the following files into the project root folder (overwriting the existing file): + + - `app/example/sparkfun_ir_array_amg88xx/app.c` + - `app/example/sparkfun_ir_array_amg88xx/app_cli_command_table.c` + - `app/example/sparkfun_ir_array_amg88xx/app_ir_array_cli_cmds.c` 3. Install software components in the .slcp - - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - - **[Services] → [Command Line interface] → [CLI Instance(s)]** → new instance name: vcom - - **[Third Party Hardware Drivers] → [Sensors] → [AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun)]** → use default configuration + - Open the .slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. -4. Save the files, build and ready to flash or debug. + - Install the following components: + + **If the EFR32xG24 Dev Kit is used:** + + - **[Services] → [IO Stream] → [Driver] → [IO Stream: USART]** → default instance name: vcom + - **[Services] → [IO Stream] → [IO Stream: Retarget STDIO]** + - **[Services] → [Command Line interface] → [CLI Instance(s)]** → new instance name: vcom + - **[Platform] → [Driver] → [I2C] → [I2CSPM]** → new instance name: qwiic + - **[Third Party Hardware Drivers] → [Sensors] → [AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun)]** → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - **[Platform] → [Utilities] → [Atomic Operations Library]** + - **[Services] → [IO Stream] → [Driver] → [IO Stream: Si91x UART]** → default instance name: vcom + - **[Services] → [IO Stream] → [IO Stream: Retarget STDIO]** + - **[Services] → [Command Line interface] → [CLI Instance(s)]** → new instance name: vcom + - **[WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C]** → new instance name: i2c2 + - **[WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [IO Stream Si91x]** + - **[Third Party Hardware Drivers] → [Sensors] → [AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun)]** → use default configuration + +4. Build and flash the project to your device. 5. Launch a terminal or console, open the communication to your device. 6. The device communicates over CLI. If you type help, you will see a description how to control the device. +**Note:** + +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). + +- Third-party Drivers Extension must be enabled for the project to install **AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun)** component. + ## How It Works ## The following diagram presents the operation of the driver. diff --git a/app/documentation/example/sparkfun_ir_array_amg88xx/image/create_example.png b/app/documentation/example/sparkfun_ir_array_amg88xx/image/create_example.png index dd2d1bd9..edb155d8 100644 Binary files a/app/documentation/example/sparkfun_ir_array_amg88xx/image/create_example.png and b/app/documentation/example/sparkfun_ir_array_amg88xx/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_ir_array_mlx90640/README.md b/app/documentation/example/sparkfun_ir_array_mlx90640/README.md index a880421a..a99e19d1 100644 --- a/app/documentation/example/sparkfun_ir_array_mlx90640/README.md +++ b/app/documentation/example/sparkfun_ir_array_mlx90640/README.md @@ -2,23 +2,35 @@ ## Summary ## -This project aims to implement the hardware driver interacting with the [SparkFun IR Array Breakout - 55 Degree FOV, MLX90640 (Qwiic)](https://www.sparkfun.com/products/14844) via APIs of GSDK. +This project aims to implement the hardware driver interacting with the [SparkFun IR Array Breakout - 55 Degree FOV, MLX90640 (Qwiic)](https://www.sparkfun.com/products/14844) via APIs of Silicon Labs Platform. The MLX90640 is equipped with a 32x24 array of thermopile sensors creating, in essence, a low resolution thermal imaging camera. With this breakout, users can detect surface temperatures from many feet away with an accuracy of ±1.5°C (best case). To make it even easier to get the infrared image, all communication is enacted exclusively via I2C, utilizing our handy Qwiic system. It can be used for high precision non-contact temperature measurements, thermal leaks in homes, industrial temperature control of moving parts, movement detection, human presence, and other similar applications. -## Hardware Required ## +## Required Hardware ## + +- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) + +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) -- [BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) - [SparkFun IR Array Breakout - 55 Degree FOV, MLX90640 (Qwiic)](https://www.sparkfun.com/products/14844) -## Connections Required ## +## Hardware Connection ## + +- If the BGM220P Explorer Kit is used: + + The MLX90640 module can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. + + ![connection](image/connection.png) -The MLX90640 module can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: -![connection](image/connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun IR Array Breakout | + | -------------| ------------- | ------------------ | ---------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -26,16 +38,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "MLX90640". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *mlx90640*. 2. Click **Create** button on the **Third Party Hardware Drivers - MLX90640 - IR Array Breakout (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_ir_array_mlx90640/app.c` into the project root folder (overwriting the existing file). @@ -47,11 +60,21 @@ You can either create a project based on an example project or start with an emp - Install the following components: + **If the BGM220P Explorer Kit is used:** + + - [Application] → [Utility] → [Assert] - [Services] → [Timers] → [Sleep Timer] - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: qwiic - [Third Party Hardware Drivers] → [Sensors] → [MLX90640 - IR Array Breakout (Sparkfun)] + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + 4. Install printf float - Open Properties of the project. @@ -64,11 +87,11 @@ You can either create a project based on an example project or start with an emp **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "MLX90640 - IR Array Breakout (Sparkfun)" component. -- The driver stores the contents of the EEPROM, so the HEAP and STACK sizes need to be increased. Edit the config/sl_memory_config.h file and increase SL_STACK_SIZE to 10240 and SL_HEAP_SIZE to 6144 +- The driver stores the contents of the EEPROM, so the HEAP and STACK sizes need to be increased. Edit the config/sl_memory_config.h file and increase SL_STACK_SIZE to 10240 and SL_HEAP_SIZE to 6411 ![memory_config](image/memory_config.png) @@ -115,7 +138,7 @@ There is a Python script `image/image_generator.py` that parses the array of tem - numpy - seaborn -- matplotlib.pylab +- matplotlib - pyserial Simply replace the "COM19" in the script with the actual COM port your device is connected to. diff --git a/app/documentation/example/sparkfun_ir_array_mlx90640/image/create_example_si91x.png b/app/documentation/example/sparkfun_ir_array_mlx90640/image/create_example_si91x.png new file mode 100644 index 00000000..505619eb Binary files /dev/null and b/app/documentation/example/sparkfun_ir_array_mlx90640/image/create_example_si91x.png differ diff --git a/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md b/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md index 1bf75eb0..3009ed26 100644 --- a/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md +++ b/app/documentation/example/sparkfun_micro_oled_ssd1306/README.md @@ -51,14 +51,9 @@ To test this application, you should connect your board to the PC using a micro 1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by *micro oled*. -2. Click **Create** button on the project: +2. Click **Create** button on the **Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. - - **Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun)** example if the BGM220P Explorer Kit is used. - ![create_example](image/create_example_1.png) - - **Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun) - Si91x** example if the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used. - ![create_example](image/create_example_2.png) - - Example project creation dialog pops up -> click Create and Finish and Project should be generated. + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. @@ -93,7 +88,7 @@ To test this application, you should connect your board to the PC using a micro **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "SSD1306 - Micro OLED Breakout (Sparkfun) - I2C" component. diff --git a/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png b/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png new file mode 100644 index 00000000..1f672a47 Binary files /dev/null and b/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png b/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png deleted file mode 100644 index 12497032..00000000 Binary files a/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png and /dev/null differ diff --git a/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png b/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png deleted file mode 100644 index 5b37c35c..00000000 Binary files a/app/documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png and /dev/null differ diff --git a/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/README.md b/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/README.md index c7402bda..305f83f9 100644 --- a/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/README.md +++ b/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project aims to show the hardware driver that is used to interface with the SPS30 sensor via GSDK APIs. This driver is based on [SPS30 Sensor API](https://github.com/Sensirion/embedded-sps) from Sensirion. +This project aims to show the hardware driver that is used to interface with the SPS30 sensor using Silicon Labs platform. This driver is based on [SPS30 Sensor API](https://github.com/Sensirion/embedded-sps) from Sensirion. The Sensirion Particulate Matter Sensor SPS30 is a compact, high quality, optical particle sensor that uses laser scattering and the innovative contamination resistance technology of Sensirion to achieve superior binning and particle measurement. This sensor allows users to measure mass concentration and number of particles of 1 µg/m^3, 2.5 µg/m^3, 4 µg/m^3, and 10 µg/m^3. @@ -12,34 +12,54 @@ The SPS30 has a five-pin interface that can communicate over two different proto ## Required Hardware ## -- [**EFR32xG24-EK2703A** EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview). +- [EFR32xG24-EK2703A EFR32xG24 Explorer Kit](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [Particulate Matter Sensor - SPS30](https://www.sparkfun.com/products/15103) -- [**Particulate Matter Sensor - SPS30**](https://www.sparkfun.com/products/15103) +## Hardware Connection ## -**NOTE:** -Tested boards for working with this example: +- **If the EFR32xG24 Explorer Kit is used**: -| Board ID | Description | -| ---------------------- | ------ | -| BRD2703A | [EFR32xG24 Explorer Kit - XG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) | -| BRD4314A | [BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit?tab=overview) | -| BRD4108A | [EFR32BG22 Explorer Kit Board](https://www.silabs.com/development-tools/wireless/bluetooth/bg22-explorer-kit?tab=overview) | + The hardware connection is shown in the image below: -## Hardware Connection ## -The hardware connection is shown in the image below: + ![hw_connection_1](image/hw_connection_1.png) + ![hw_connection](image/hw_connection.png) + + --------------------------------------------------------------------------------------------- + + | Pin | SPS30 | Connect to | EFR32xG24 Explorer Kit | + | --- | ---------- | ---------- | -----------------------------------------------------------| + | 1. | VDD | <========> | 5V | + | 2. | RX/SDA | <========> | TX/SDA | + | 3. | TX/SCL | <========> | RX/SCL | + | 4. | SEL | <========> | Leave floating to select UART or Pull to GND to select I2C | + | 5. | GND | <========> | GND | + + --------------------------------------------------------------------------------------------- + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: -![hw_connection_1](image/hw_connection_1.png) -![hw_connection](image/hw_connection.png) + **- If using I2C interface:** ----------------------------------------------------------- -| Pin | SPS30 | Connect to | EFR32xG24 Explorer Kit | -| --- | ---------- | ---------- | ---------------------- | -| 1. | VDD | <========> | 5V | -| 2. | RX/SDA | <========> | TX/SDA | -| 3. | TX/SCL | <========> | RX/SCL | -| 4. | SEL | <========> | Leave floating to select UART or Pull to GND to select I2C | -| 5. | GND | <========> | GND | ----------------------------------------------------------- + | Description | BRD4338A GPIO | BRD4002 EXP Header | SPS30 | + | -------------| ------------- | ------------------ | ------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | PIN 2 (SDA) | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | PIN 3 (SCL) | + | GND | | | PIN 4 (SEL) | + | +5V | | | PIN 1 (+5V) | + | GND | | | PIN 5 (GND) | + + **- If using UART interface:** + + | Description | BRD4338A GPIO | BRD4002 Breakout Header | SPS30 | + | ------------ | -------------- | ----------------------- | ------------------- | + | UART1_RX_PIN | GPIO_6 | P19 | PIN 3 (TX) | + | UART1_TX_PIN | GPIO_7 | P20 | PIN 2 (RX) | + | Floating | | | PIN 4 (SEL) | + | +5V | | +5V | PIN 1 (+5V) | + | GND | | GND | PIN 5 (GND) | ## Setup ## @@ -47,22 +67,23 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with the filter: 'sps30'. +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by 'sps30'. 2. Click **Create** button on the example: - - **Third Party Hardware Drivers - SPS30 - Particulate Matter Sensor (Sparkfun) - I2C** if using the I2C interface. + - **Third Party Hardware Drivers - SPS30 - Particulate Matter Sensor (Sparkfun) - I2C** if using the I2C interface. + + - **Third Party Hardware Drivers - SPS30 - Particulate Matter Sensor (Sparkfun) - UART** if using the UART interface. - - **Third Party Hardware Drivers - SPS30 - Particulate Matter Sensor (Sparkfun) - UART** if using the UART interface. + Example project creation dialog pops up -> click Create and Finish and Project should be generated. - Example project creation dialog pops up -> click Create and Finish and Project should be generated. - ![Create_example](image/create_example.png) + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_particulate_matter_sensor_sps30/app.c` into the project root folder (overwriting the existing file). @@ -74,11 +95,23 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] + **If the EFR32xG24 Explorer Kit is used**: + - [Services] → [IO Stream] → [IO Stream: EUSART] → default instance name: vcom - [Application] → [Utility] → [Log] - - If using the I2C interface: [Third Party Hardware Drivers] → [Sensors] → [SPS30 - Particulate Matter Sensor (Sparkfun) - I2C] → use default configuration - - If using the UART interface: [Third Party Hardware Drivers] → [Sensors] → [SPS30 - Particulate Matter Sensor (Sparkfun) - UART] → use default configuration + - If using the I2C interface: + - [Third Party Hardware Drivers] → [Sensors] → [SPS30 - Particulate Matter Sensor (Sparkfun) - I2C] → use default configuration + - If using the UART interface: + - [Services] → [IO Stream] → [IO Stream: USART] → [mikroe] → set "Receive buffer size" to 256 + - [Third Party Hardware Drivers] → [Sensors] → [SPS30 - Particulate Matter Sensor (Sparkfun) - UART] → use default configuration + + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + - If using the I2C interface: + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [SPS30 - Particulate Matter Sensor (Sparkfun) - I2C] → use default configuration + - If using the UART interface: + - [Third Party Hardware Drivers] → [Sensors] → [SPS30 - Particulate Matter Sensor (Sparkfun) - UART] → use default configuration + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [UART] → disable "UART1 DMA" 4. Install **printf float** @@ -86,16 +119,15 @@ You can either create a project based on an example project or start with an emp - Select C/C++ Build → Settings → Tool Settings → GNU ARM C Linker → General. Check Printf float. - ![install_float](image/install_float.png) + ![install_float](image/install_float.png) 5. Build and flash this example to the board. - **Note:** -- Make sure that the SDK extension is already installed. If not, please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- Third-party Drivers Extension must be enabled for the project to install "SPS30 - Particulate Matter Sensor (Sparkfun) - I2C" or "SPS30 - Particulate Matter Sensor (Sparkfun) - UART" component. +- Third-party Drivers Extension must be enabled for the project to install "SPS30 - Particulate Matter Sensor (Sparkfun) - I2C" or "SPS30 - Particulate Matter Sensor (Sparkfun) - UART" component ## How It Works ## @@ -103,7 +135,7 @@ Driver Layer Diagram is shown in the image below: ![driver_layer](image/driver_layer.png) -After you flash the code to the Explorer Kit and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that the EFR32xG24 Explorer Kit board uses the default baud rate of 115200. +After you flash the code to the Explorer Kit and power the connected boards, the application starts running automatically. Use Putty/Tera Term (or another program) to read the values of the serial output. Note that your board uses the default baud rate of 115200. In the image below, you can see an example how the output is displayed. The main program performs a sensor probing at first, then it reads the serial number and feature set version. The main program starts the measurements and continuously receives measured values ​​(pm1.0, pm2.5, pm4.0, pm10.0 ... concentration). @@ -111,6 +143,7 @@ There is a periodic timer in the code, which determines the sampling intervals; ![log_i2c](image/log_i2c.png "USB Debug Output Data") ![log_uart](image/log_uart.png "USB Debug Output Data") + ## Report Bugs & Get Support ## To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of [third_party_hw_drivers_extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues. diff --git a/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/image/create_example.png b/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/image/create_example.png index 5d6151dd..f0e2a08b 100644 Binary files a/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/image/create_example.png and b/app/documentation/example/sparkfun_particulate_matter_sensor_sps30/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_proximity_vcnl4040/README.md b/app/documentation/example/sparkfun_proximity_vcnl4040/README.md index f3f3a39c..20d18e6d 100644 --- a/app/documentation/example/sparkfun_proximity_vcnl4040/README.md +++ b/app/documentation/example/sparkfun_proximity_vcnl4040/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project aims to implement a hardware driver interacting with the [VCNL4040 proximity sensor](https://www.vishay.com/ppg?84274) via APIs of GSDK. +This project aims to implement a hardware driver interacting with the [VCNL4040 proximity sensor](https://www.vishay.com/ppg?84274) using Silicon Labs platform. VCNL4040 integrates a proximity sensor (PS), ambient light sensor (ALS), and a high power IRED into one small package. It incorporates photodiodes, amplifiers, and analog to digital converting circuits into a single chip by CMOS process. The 16-bit high resolution ALS offers excellent sensing capabilities with sufficient selections to fulfill most applications whether dark or high transparency lens design. High and low interrupt thresholds can be programmed for both ALS and PS, allowing the component to use a minimal amount of the microcontroller's resources. With the ability to detect objects up to 20 cm, it is often used in automatic towel and soap dispensers or automatic faucets. @@ -11,13 +11,23 @@ The patented Filtron technology achieves ambient light spectral sensitivity clos ## Required Hardware ## - [BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit?tab=overview) (BRD4002 + BRD4338A) - [SparkFun Proximity Sensor Breakout - 20cm, VCNL4040 (Qwiic)](https://www.sparkfun.com/products/15177) ## Hardware Connection ## -A VCNL4040 sensor board can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. +- If the BGM220P Explorer Kit is used: -![connection](image/connection.png) + A VCNL4040 sensor board can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. + + ![connection](image/connection.png) + +- If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun Proximity VCNL4040 | + | -------------| ------------- | ------------------ | ---------------------------- | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -25,39 +35,47 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "VCNL4040". +1. From the Launcher Home, add your device to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter **"VCNL4040"**. 2. Click **Create** button on the **Third Party Hardware Drivers - VCNL4040 - Proximity Sensor (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for the your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_proximity_vcnl4040/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - - Open the .slcp file in the project. + - Open the .slcp file in the project. + + - Select the SOFTWARE COMPONENTS tab. + + - Install the following components: - - Select the SOFTWARE COMPONENTS tab. + **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: USART] → instance name: **vcom** + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: **qwiic** + - [Third Party Hardware Drivers] -> [Sensors] -> [VCNL4040 - Proximity Sensor (Sparkfun)] → use default configuration - - Install the following components - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → instance name: **vcom** - - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] -> [Sensors] -> [VCNL4040 - Proximity Sensor (Sparkfun)] → use default configuration - ![config](image/config.png) + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Service] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] -> [Sensors] -> [VCNL4040 - Proximity Sensor (Sparkfun)] → use default configuration 4. Build and flash the project to your device **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "VCNL4040 - Proximity Sensor (Sparkfun)" component. +- Third-party Drivers Extension must be enabled for the project to install **"VCNL4040 - Proximity Sensor (Sparkfun)"** component. ## How It Works ## diff --git a/app/documentation/example/sparkfun_proximity_vcnl4040/image/config.png b/app/documentation/example/sparkfun_proximity_vcnl4040/image/config.png deleted file mode 100644 index 717d8b14..00000000 Binary files a/app/documentation/example/sparkfun_proximity_vcnl4040/image/config.png and /dev/null differ diff --git a/app/documentation/example/sparkfun_proximity_vcnl4040/image/connection.png b/app/documentation/example/sparkfun_proximity_vcnl4040/image/connection.png index 7787b6e9..f05b3438 100644 Binary files a/app/documentation/example/sparkfun_proximity_vcnl4040/image/connection.png and b/app/documentation/example/sparkfun_proximity_vcnl4040/image/connection.png differ diff --git a/app/documentation/example/sparkfun_proximity_vcnl4040/image/create_example.png b/app/documentation/example/sparkfun_proximity_vcnl4040/image/create_example.png index 45c3bf7c..541d89f8 100644 Binary files a/app/documentation/example/sparkfun_proximity_vcnl4040/image/create_example.png and b/app/documentation/example/sparkfun_proximity_vcnl4040/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_proximity_vcnl4040/image/test.png b/app/documentation/example/sparkfun_proximity_vcnl4040/image/test.png index 608ab861..1af4e9d6 100644 Binary files a/app/documentation/example/sparkfun_proximity_vcnl4040/image/test.png and b/app/documentation/example/sparkfun_proximity_vcnl4040/image/test.png differ diff --git a/app/documentation/example/sparkfun_qwiic_joystick/README.md b/app/documentation/example/sparkfun_qwiic_joystick/README.md index d677402a..6cdd759a 100644 --- a/app/documentation/example/sparkfun_qwiic_joystick/README.md +++ b/app/documentation/example/sparkfun_qwiic_joystick/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project shows the implementation of a Joystick module that is integrated on the SparkFun Qwiic Joystick board. +This project shows the implementation of a Joystick module that is integrated into the SparkFun Qwiic Joystick board. The SparkFun Qwiic Joystick board combines the convenience of the Qwiic connection system and an analog Joystick that is similar to the analog Joysticks on PS2 (PlayStation 2) controllers. Directional movements are simply measured with two 10 kΩ potentiometers, connected with a gimbal mechanism that separates the horizontal and vertical movements. This Joystick also has a select button that is actuated when the Joystick is pressed down. With the pre-installed firmware, the ATtiny85 acts as an intermediary (microcontroller) for the analog and digital inputs from the Joystick. This allows the Qwiic Joystick to report its position over I2C. @@ -10,15 +10,26 @@ For more information about the SparkFun Qwiic Joystick, see the [specification p ## Required Hardware ## -- [A BGM220P Explorer Kit board.](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) - -- [A SparkFun Qwiic Joystick Board.](https://www.sparkfun.com/products/15168) +- [A BGM220P Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [A SparkFun Qwiic Joystick Board](https://www.sparkfun.com/products/15168) ## Hardware Connection ## -The Sparkfun Qwiic Joystick board can be easily connected by using a [Qwiic cable](https://www.sparkfun.com/products/17259). +- **If the BGM220P Explorer Kit is used**: + + The Sparkfun Qwiic Joystick board can be easily connected to your board by using a [Qwiic cable](https://www.sparkfun.com/products/17259). The hardware connection is shown in the image below: + + ![hardware_connection](image/hardware_connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: -![hardware_connection](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | Sparkfun Qwiic Joystick | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -26,39 +37,43 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "joystick". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "joystick". -2. Click **Create** button on the **Third Party Hardware Drivers - Qwiic Joystick (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) +2. Click Create button on the project **Third Party Hardware Drivers - Qwiic Joystick (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_qwiic_joystick/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: + + - **If the BGM220P Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Qwiic Joystick (Sparkfun)] - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Qwiic Joystick (Sparkfun)] + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Qwiic Joystick (Sparkfun)] 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). -- SDK Extension must be enabled for the project to install "Qwiic Joystick (Sparkfun)" component. +- SDK Extension must be enabled for the project to install "Qwiic Joystick (Sparkfun)" component ## How It Works ## @@ -66,7 +81,7 @@ You can either create a project based on an example project or start with an emp - *sparkfun_joystick_init()*: Initialize the Joystick module. This function should be called before the main loop. -- *sparkfun_joystick_get_firmware_version()*: Read Firmware Version from the Joystick. Helpful for tech support. +- *sparkfun_joystick_get_firmware_version(): Read the Firmware Version from the Joystick. Helpful for tech support. - *sparkfun_joystick_set_address()*: Set new I2C address for Joystick. @@ -76,13 +91,13 @@ You can either create a project based on an example project or start with an emp - *sparkfun_joystick_select_device()*: Select device on the I2C bus based on its I2C address. -- *sparkfun_joystick_read_horizontal_position()*: Read Current Horizontal Position from the Joystick. +- *sparkfun_joystick_read_horizontal_position(): Read the Current Horizontal Position from the Joystick. -- *sparkfun_joystick_read_vertical_position()*: Read Current Vertical Position from the Joystick. +- *sparkfun_joystick_read_vertical_position(): Read the Current Vertical Position from the Joystick. -- *sparkfun_joystick_read_button_position()*: Read Current Button Position from the Joystick. +- *sparkfun_joystick_read_button_position(): Read the Current Button Position from the Joystick. -- *sparkfun_joystick_check_button()*: Reads Status of Button. +- *sparkfun_joystick_check_button(): Reads the Status of the Button. - *sparkfun_joystick_present()*: Check whether a Joystick is present on the I2C bus or not. @@ -92,11 +107,11 @@ You can either create a project based on an example project or start with an emp This example demonstrates some of the available features of the Joystick module. Follow the below steps to test the example: -1. On your PC open a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. +1. On your PC open a terminal program, such as the Console that is integrated with Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. 2. Try to move the Joystick in some direction and check the logs on the terminal. -![logging_screen](image/logs.png) + ![logging_screen](image/logs.png) ## Report Bugs & Get Support ## diff --git a/app/documentation/example/sparkfun_qwiic_joystick/image/create_example.png b/app/documentation/example/sparkfun_qwiic_joystick/image/create_example.png index 10803969..0a0af3d6 100644 Binary files a/app/documentation/example/sparkfun_qwiic_joystick/image/create_example.png and b/app/documentation/example/sparkfun_qwiic_joystick/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_qwiic_joystick/image/create_example_si91x.png b/app/documentation/example/sparkfun_qwiic_joystick/image/create_example_si91x.png new file mode 100644 index 00000000..aa1f1521 Binary files /dev/null and b/app/documentation/example/sparkfun_qwiic_joystick/image/create_example_si91x.png differ diff --git a/app/documentation/example/sparkfun_qwiic_joystick/image/hardware_connection.png b/app/documentation/example/sparkfun_qwiic_joystick/image/hardware_connection.png index a90adf02..49743fee 100644 Binary files a/app/documentation/example/sparkfun_qwiic_joystick/image/hardware_connection.png and b/app/documentation/example/sparkfun_qwiic_joystick/image/hardware_connection.png differ diff --git a/app/documentation/example/sparkfun_qwiic_keypad/README.md b/app/documentation/example/sparkfun_qwiic_keypad/README.md index c4b43561..223b17ba 100644 --- a/app/documentation/example/sparkfun_qwiic_keypad/README.md +++ b/app/documentation/example/sparkfun_qwiic_keypad/README.md @@ -2,23 +2,36 @@ ## Summary ## -This project shows the implementation of a Keypad module that is integrated on the SparkFun Qwiic Keypad board. +This project shows the implementation of a Keypad module that is integrated into the SparkFun Qwiic Keypad board. -The SparkFun Qwiic Keypad board combines the convenience of the Qwiic connection system and a matrix keypad with a contoller IC, so you don't need to mess with any pull-up resistors or configuring multiple GPIO pins. You only need to connect the Qwiic interfaces together and initialize the I2C peripheral on your development board. +The SparkFun Qwiic Keypad board combines the convenience of the Qwiic connection system and a matrix keypad with a controller IC, so you don't need to mess with any pull-up resistors or configure multiple GPIO pins. You only need to connect the Qwiic interfaces and initialize the I2C peripheral on your development board. For more information about the SparkFun Qwiic Keypad, see the [specification page](https://learn.sparkfun.com/tutorials/qwiic-keypad-hookup-guide). ## Required Hardware ## - [An EFR32xG24 Explorer Kit - xG24-EK2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview#user-guides) - -- [A SparkFun Qwiic keypad Board.](https://www.sparkfun.com/products/15290) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [A SparkFun Qwiic keypad Board](https://www.sparkfun.com/products/15290) ## Hardware Connection ## -The Sparkfun Qwiic Keypad board can be easily connected by using a [Qwiic cable](https://www.sparkfun.com/products/17259). +- **If the EFR32xG24 Explorer Kit is used**: + + The Sparkfun Qwiic Keypad board can be easily connected to the Explorer Kit by using a [Qwiic cable](https://www.sparkfun.com/products/17259). + + The hardware connection is shown in the image below: + ![hardware_connection](image/hardware_connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: -![hardware_connection](image/hardware_connection.png) + | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun Qwiic Keypad | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | + | Interrupt Pin| GPIO_46 | P24 | INT | ## Setup ## @@ -26,43 +39,45 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD2703A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "keypad". +1. From the Launcher Home, add your board Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "qwiic keypad". 2. Click **Create** button on the **Third Party Hardware Drivers - Qwiic Keypad (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) -3. In this step you can decide if you want to use the INT I/O. If you don't want to use it, then you don't need to modify anything, just continue on with the guide. If you want to use it, then uncomment the 17th line in sparkfun_qwiic_keypad.h and connect the INT pin on the Keypad to the B1 pin on the Explorer Kit. + ![Create_example](image/create_example.png) -4. Build and flash this example to the board. +3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "EFR32xG24 Explorer Kit" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_qwiic_keypad/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Third Party] → [Tiny printf] - - [Third Party Hardware Drivers] → [Human Machine Interface] → [Qwiic Keypad (Sparkfun)] + **If the EFR32xG24 Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Qwiic Keypad (Sparkfun)] -4. In this step you can decide if you want to use the INT I/O. If you don't want to use it, then you don't need to modify anything, just continue on with the guide. If you want to use it, then uncomment the 22th line in app.h and connect the INT pin on the Keypad to the B1 pin on the Explorer Kit. + **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** -5. Build and flash the project to your device. + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Human Machine Interface] → [Qwiic Keypad (Sparkfun)] + +4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide) -- SDK Extension must be enabled for the project to install "Qwiic Keypad (Sparkfun)" component. +- SDK Extension must be enabled for the project to install the "Qwiic Keypad (Sparkfun)" component ## How It Works ## @@ -80,9 +95,9 @@ You can either create a project based on an example project or start with an emp - *sparkfun_keypad_select_device()*: Select device on the I2C bus based on its I2C address. -- *sparkfun_keypad_read_last_button()*: Read the first element from the fifo. +- *sparkfun_keypad_read_last_button()*: Read the first element from the FIFO. -- *sparkfun_keypad_time_since_last_button_event()*: Get the time elapsed since the last button was pressed in miliseconds. +- *sparkfun_keypad_time_since_last_button_event()*: Get the time elapsed since the last button was pressed in milliseconds. - *sparkfun_keypad_update_fifo()*: Send a command to the keypad to update the contents of the fifo inside the device. @@ -90,15 +105,17 @@ You can either create a project based on an example project or start with an emp - *sparkfun_keypad_send_command()*: Send a command and read the result over the I2C bus. +- There are two operation modes for this example. One is using interrupt and one is polling using the timer. You can choose this mode via macro "SAPRKFUN_KEYPAD_INT_PIN_EN" in file "app.h" + ### Testing ### This example demonstrates some of the available features of the Keypad module. Follow the below steps to test the example: -1. On your PC open a terminal program, such as the Console that is integrated in Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. +1. On your PC open a terminal program, such as the Console that is integrated into Simplicity Studio or a third-party tool terminal like TeraTerm to receive the logs from the virtual COM port. -2. Press one or more button on the keypad and check the logs on the terminal. +2. Press one or more buttons on the keypad and check the logs on the terminal. -![logging_screen](image/logs.png) + ![logging_screen](image/logs.png) ## Report Bugs & Get Support ## diff --git a/app/documentation/example/sparkfun_qwiic_keypad/image/create_example.png b/app/documentation/example/sparkfun_qwiic_keypad/image/create_example.png index 1ed1b203..203722bf 100644 Binary files a/app/documentation/example/sparkfun_qwiic_keypad/image/create_example.png and b/app/documentation/example/sparkfun_qwiic_keypad/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_rfid_id12la/README.md b/app/documentation/example/sparkfun_rfid_id12la/README.md index cc9b8339..a2d1fe0b 100644 --- a/app/documentation/example/sparkfun_rfid_id12la/README.md +++ b/app/documentation/example/sparkfun_rfid_id12la/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project shows the implementation of an RFID module that outputs the 10-character unique ID ( 5 bytes ID + 1 byte checksum + 4 bytes timestamp) of a 125kHz RFID card with **BGM220 Explorer Kit** based on Qwiic communication. +This project shows the implementation of an RFID module that outputs the 10-character unique ID ( 5 bytes ID + 1 byte checksum + 4 bytes timestamp) of a 125kHz RFID card with Silicon Labs platform based on I2C communication. It can be used for human tracking, checking event attendance, and is also beneficial for electronic wallet applications. @@ -10,6 +10,8 @@ It can be used for human tracking, checking event attendance, and is also benefi - [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) + - [SparkFun RFID Qwiic Reader](https://www.sparkfun.com/products/15191) - [RFID Reader ID-12LA](https://www.sparkfun.com/products/11827) @@ -18,9 +20,20 @@ It can be used for human tracking, checking event attendance, and is also benefi ## Hardware Connection ## -An ID12L RFID module can be easily connected with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun Qwiic compatible STEMMA QT connectors can be used. +- **If the BGM220P Explorer Kit is used**: + + The SparkFun RFID Qwiic Reader board can be easily connected to your board by using a [Qwiic cable](https://www.sparkfun.com/products/17259). The hardware connection is shown in the image below: -![hardware_connection](image/hardware_connection.png) + ![hardware_connection](image/hardware_connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun RFID Qwiic Reader | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -28,16 +41,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "ID-12LA". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "ID-12LA". 2. Click **Create** button on the **Third Party Hardware Drivers - ID-12LA - RFID Qwiic Reader (Sparkfun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board" using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_rfid_id12la/app.c` into the project root folder (overwriting the existing file). @@ -49,16 +63,23 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Application] → [Utility] → [Log] - [Application] → [Utility] → [Assert] - - [Third Party Hardware Drivers] → [Wireless Connectivity] → [ID-12LA - RFID Reader (Sparkfun) - I2C] + - **If the BGM220P Explorer Kit is used:** + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [ID-12LA - RFID Reader (Sparkfun) - I2C] + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Wireless Connectivity] → [ID-12LA - RFID Reader (Sparkfun) - I2C] → set the correct I2C address of the RFID Reader 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install "ID-12LA - RFID Reader (Sparkfun) - I2C" component. diff --git a/app/documentation/example/sparkfun_rfid_id12la/image/create_example.png b/app/documentation/example/sparkfun_rfid_id12la/image/create_example.png index 14c08d89..3ce1a79c 100644 Binary files a/app/documentation/example/sparkfun_rfid_id12la/image/create_example.png and b/app/documentation/example/sparkfun_rfid_id12la/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_rfid_id12la/image/hardware_connection.png b/app/documentation/example/sparkfun_rfid_id12la/image/hardware_connection.png index 722ae6af..e99ba1cf 100644 Binary files a/app/documentation/example/sparkfun_rfid_id12la/image/hardware_connection.png and b/app/documentation/example/sparkfun_rfid_id12la/image/hardware_connection.png differ diff --git a/app/documentation/example/sparkfun_rfid_id12la/image/testing_result.png b/app/documentation/example/sparkfun_rfid_id12la/image/testing_result.png index e65e5c20..d9235d50 100644 Binary files a/app/documentation/example/sparkfun_rfid_id12la/image/testing_result.png and b/app/documentation/example/sparkfun_rfid_id12la/image/testing_result.png differ diff --git a/app/documentation/example/sparkfun_soil_moisture/README.md b/app/documentation/example/sparkfun_soil_moisture/README.md index 842b7209..e96e85e6 100644 --- a/app/documentation/example/sparkfun_soil_moisture/README.md +++ b/app/documentation/example/sparkfun_soil_moisture/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project aims to implement a hardware driver interacting with the [Sparkfun soil moisture sensor](https://www.sparkfun.com/products/17731) via APIs of GSDK. +This project aims to implement a hardware driver interacting with the [Sparkfun soil moisture sensor](https://www.sparkfun.com/products/17731) using Silicon Labs platform. Sparkfun soil moisture is a simple breakout for measuring the moisture in soil and similar materials. The soil moisture sensor is pretty straightforward to use. The two large, exposed pads function as probes for the sensor, together acting as a variable resistor. The more water that is in the soil means the better the conductivity between the pads will be, resulting in a lower resistance and a higher SIG out. This version of the Soil Moisture Sensor includes a Qwiic connector, making it even easier to use this sensor. @@ -11,13 +11,25 @@ This soil moisture sensor be used in agricultural infrastructure, but also benef ## Required Hardware ## - [BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) - [SparkFun Qwiic Soil Moisture Sensor](https://www.sparkfun.com/products/17731) ## Hardware Connection ## -Sparkfun soil moisture sensor board can connect with the BGM220 Explorer Kit easily via SparkFun Qwiic compatible STEMMA QT. The Sparkfun Qwiic is a special connector that includes two I2C wires (SDA and SCL), 3v3 and GND. All of these wires are combined into 1 connection port so that it makes the connection between 2 devices become easier and more convenient. +- **If the BGM220P Explorer Kit is used**: -![connection](image/connection.png) + The SparkFun Qwiic Soil Moisture Sensor board can be easily connected to your board by using a [Qwiic cable](https://www.sparkfun.com/products/17259). The hardware connection is shown in the image below: + + ![connection](image/connection.png) + +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | SparkFun Qwiic Soil Moisture Sensor | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -25,16 +37,17 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "soil". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "soil". 2. Click **Create** button on the **Third Party Hardware Drivers - Qwiic Soil Moisture Sensor (Sparkfun) - I2C** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_soil_moisture/app.c` into the project root folder (overwriting the existing file). @@ -46,17 +59,23 @@ You can either create a project based on an example project or start with an emp - Install the following components: - - [Services] → [Timers] → [Sleep Timer] - - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom - - [Application] → [Utility] → [Log] - - [Application] → [Utility] → [Assert] - - [Third Party Hardware Drivers] → [Sensors] → [Qwiic Soil Moisture Sensor (Sparkfun) - I2C] + - **If the BGM220P Explorer Kit is used:** + - [Services] → [Timers] → [Sleep Timer] + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Sensors] → [Qwiic Soil Moisture Sensor (Sparkfun) - I2C] + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Services] → [Sleep Timer for Si91x] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [Qwiic Soil Moisture Sensor (Sparkfun) - I2C] 4. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **Qwiic Soil Moisture Sensor (Sparkfun) - I2C** component. diff --git a/app/documentation/example/sparkfun_soil_moisture/image/connection.png b/app/documentation/example/sparkfun_soil_moisture/image/connection.png index c498e139..3eadb466 100644 Binary files a/app/documentation/example/sparkfun_soil_moisture/image/connection.png and b/app/documentation/example/sparkfun_soil_moisture/image/connection.png differ diff --git a/app/documentation/example/sparkfun_soil_moisture/image/create_example.png b/app/documentation/example/sparkfun_soil_moisture/image/create_example.png index dcc508aa..6d464755 100644 Binary files a/app/documentation/example/sparkfun_soil_moisture/image/create_example.png and b/app/documentation/example/sparkfun_soil_moisture/image/create_example.png differ diff --git a/app/documentation/example/sparkfun_soil_moisture/image/result.png b/app/documentation/example/sparkfun_soil_moisture/image/result.png index 7e168646..2d68d015 100644 Binary files a/app/documentation/example/sparkfun_soil_moisture/image/result.png and b/app/documentation/example/sparkfun_soil_moisture/image/result.png differ diff --git a/app/documentation/example/sparkfun_spectroscopy_as7265x/README.md b/app/documentation/example/sparkfun_spectroscopy_as7265x/README.md index a765a706..e3ce57d6 100644 --- a/app/documentation/example/sparkfun_spectroscopy_as7265x/README.md +++ b/app/documentation/example/sparkfun_spectroscopy_as7265x/README.md @@ -2,7 +2,7 @@ ## Summary ## -This project shows the implementation of the Triad Spectroscopy Sensor using a **Triad Spectroscopy Sensor-AS7265x** with **BGM220 Explorer Kit** based on Qwiic communication. +This project shows the implementation of the Triad Spectroscopy Sensor using a **Triad Spectroscopy Sensor-AS7265x** with Silicon Labs platform based on I2C communication. The SparkFun Triad Spectroscopy Sensor is a powerful optical inspection sensor also known as a spectrophotometer. Three AS7265x spectral sensors are combined alongside visible, UV, and IR LEDs to illuminate and test various surfaces for light spectroscopy. The Triad is made up of three sensors; the AS72651, the AS72652, and the AS72653 and can detect light from 410nm (UV) to 940nm (IR). @@ -10,15 +10,28 @@ For more information about the Triad Spectroscopy Sensor-AS7265x, see the [speci ## Required Hardware ## -- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit). - -- [A Triad Spectroscopy Sensor - AS7265x Board](https://www.sparkfun.com/products/15050). +- [A BGM220 Explorer Kit board](https://www.silabs.com/development-tools/wireless/bluetooth/bgm220-explorer-kit) +- Or [SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit](https://www.silabs.com/development-tools/wireless/wi-fi/siwx917-pk6031a-wifi-6-bluetooth-le-soc-pro-kit) (BRD4002 + BRD4338A) +- [A Triad Spectroscopy Sensor - AS7265x Board](https://www.sparkfun.com/products/15050) ## Hardware Connection ## -A Triad Spectroscopy Sensor - AS7265x can be easily connected up with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun qwiic compatible STEMMA QT connectors can be used. +A Triad Spectroscopy Sensor - AS7265x can be easily connected with two I2C wires (SDA and SCL) along with 3v3 and GND. For the designated boards, SparkFun qwiic compatible STEMMA QT connectors can be used. + +- **If the BGM220P Explorer Kit is used**: + + The connection is shown in the image below: + + ![board](image/connection.png "BGM220 Explorer Kit Board and Triad Spectroscopy Sensor - AS7265x Board") -![board](image/connection.png "BGM220 Explorer Kit Board and Triad Spectroscopy Sensor - AS7265x Board") +- **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used**: + + The hardware connection is shown in the table below: + + | Description | BRD4338A GPIO | BRD4002 EXP Header | A Triad Spectroscopy Sensor | + | -------------| ------------- | ------------------ | ------------------ | + | I2C_SDA | ULP_GPIO_6 | EXP_16 | SDA | + | I2C_SCL | ULP_GPIO_7 | EXP_15 | SCL | ## Setup ## @@ -26,40 +39,51 @@ You can either create a project based on an example project or start with an emp ### Create a project based on an example project ### -1. From the Launcher Home, add the BRD4314A to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project with filter "AS7265X". +1. From the Launcher Home, add your board to My Products, click on it, and click on the **EXAMPLE PROJECTS & DEMOS** tab. Find the example project filtering by "as7265x". 2. Click **Create** button on the **Third Party Hardware Drivers - AS7265X - Triad Spectroscopy Sensor (SparkFun)** example. Example project creation dialog pops up -> click Create and Finish and Project should be generated. -![Create_example](image/create_example.png) + + ![Create_example](image/create_example.png) 3. Build and flash this example to the board. ### Start with an empty example project ### -1. Create an "Empty C Project" for the "BGM220 Explorer Kit Board" using Simplicity Studio v5. Use the default project settings. +1. Create an "Empty C Project" for your board using Simplicity Studio v5. Use the default project settings. 2. Copy the file `app/example/sparkfun_spectroscopy_as7265x/app.c` into the project root folder (overwriting the existing file). 3. Install the software components: - Open the .slcp file in the project. - - Select the SOFTWARE COMPONENTS tab. - - Install the following components: + + - **If the BGM220P Explorer Kit is used:** + + - [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom + - [Application] → [Utility] → [Log] + - [Application] → [Utility] → [Assert] + - [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance + - [Third Party Hardware Drivers] → [Sensors] → [AS7265x - Triad Spectroscopy Sensor (Sparkfun) - I2C] + + - **If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:** + + - [Application] → [Utility] → [Assert] + - [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2] + - [Third Party Hardware Drivers] → [Sensors] → [AS7265x - Triad Spectroscopy Sensor (Sparkfun) - I2C] - - **[Services] → [Timers] → [Sleep Timer]** - - **[Services] → [IO Stream] → [IO Stream: USART]** → default instance name: vcom - - **[Application] → [Utility] → [Log]** - - **[Application] → [Utility] → [Assert]** - - **[Third Party Hardware Drivers] → [Sensors] → [AS7265x - Triad Spectroscopy Sensor (Sparkfun) - I2C]** +4. Install "Printf float" -4. If you want to print float sensor values like in this example, follow the instructions of the [Floating point print() with GCC](https://www.silabs.com/community/mcu/32-bit/knowledge-base.entry.html/2014/11/19/floating_point_print-7R9j) article. + - Open Properties of the project. + + - Select C/C++ Build > Settings > Tool Settings > GNU ARM C Linker > General > Check "Printf float". 5. Build and flash the project to your device. **Note:** -- Make sure that the SDK extension already be installed. If not please follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). +- Make sure that the **Third Party Hardware Drivers** extension is installed. If not, follow [this documentation](https://github.com/SiliconLabs/third_party_hw_drivers_extension/blob/master/README.md#how-to-add-to-simplicity-studio-ide). - SDK Extension must be enabled for the project to install **AS7265x - Triad Spectroscopy Sensor (Sparkfun) - I2C** component. @@ -73,13 +97,11 @@ You can either create a project based on an example project or start with an emp - Read Sensor Data/Status: specific register read to get acceleration data and status. -`sparkfun_as7265x_platform.c`: implements APIs for low level. - - Low-level functions: initialize I2C communication, read/write a memory block via I2C, given memory address, and read/write a register via I2C, given register address. ### Testing ### -This simple test application demonstrates some of the available features of the A Triad Spectroscopy Sensor - AS7265x, after initialization, the Triad Spectroscopy Sensor - AS7265x measure the value and return on the serial communication interface. +This simple test application demonstrates some of the available features of the A Triad Spectroscopy Sensor - AS7265x, after initialization, the Triad Spectroscopy Sensor - AS7265x measures the value and return on the serial communication interface. You can choose which type of test you want by uncommenting the #define, follow the below steps to test the example: @@ -89,19 +111,19 @@ You can choose which type of test you want by uncommenting the #define, follow t - If you use **TEST_BASIC_READING** for testing, this example takes all 18 readings, 372nm to 966nm, over I2C and outputs them to the serial port. -![basic reading](image/basic_reading.png "Basic Reading Result") + ![basic reading](image/basic_reading.png "Basic Reading Result") - If you use **TEST_BASIC_READING_WITH_LED** for testing, this example takes all 18 readings and blinks the illumination LEDs as it goes, resets the device, and observes the log messages. -![basic reading with led](image/basic_reading_with_led.png "Basic Reading With LED Result") + ![basic reading with led](image/basic_reading_with_led.png "Basic Reading With LED Result") - If you use **TEST_READ_RAW_VALUE** for testing, this example shows how to output the raw sensor values. -![raw data reading](image/raw_data_reading.png "Raw Data Reading Result") + ![raw data reading](image/raw_data_reading.png "Raw Data Reading Result") - If you use **TEST_MAX_READ_RATE** for testing, this example shows how to set up the sensor for max, calibrated read rate. -![max rate reading](image/max_data_rate_reading.png "Max Data Rate Reading Result") + ![max rate reading](image/max_data_rate_reading.png "Max Data Rate Reading Result") ## Report Bugs & Get Support ## diff --git a/app/documentation/example/sparkfun_spectroscopy_as7265x/image/connection.png b/app/documentation/example/sparkfun_spectroscopy_as7265x/image/connection.png index fcb565d2..1dc1c2dd 100644 Binary files a/app/documentation/example/sparkfun_spectroscopy_as7265x/image/connection.png and b/app/documentation/example/sparkfun_spectroscopy_as7265x/image/connection.png differ diff --git a/app/documentation/example/sparkfun_spectroscopy_as7265x/image/create_example.png b/app/documentation/example/sparkfun_spectroscopy_as7265x/image/create_example.png index 76c9fd5e..a95eb4f5 100644 Binary files a/app/documentation/example/sparkfun_spectroscopy_as7265x/image/create_example.png and b/app/documentation/example/sparkfun_spectroscopy_as7265x/image/create_example.png differ diff --git a/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp b/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp index b6eaa3db..999db652 100644 --- a/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp +++ b/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09.slcp @@ -28,8 +28,6 @@ component: instance: [vcom] - id: i2cspm instance: [qwiic] -- id: app_assert -- id: sleeptimer - id: app_log - id: adafruit_neotrellis_keypad_atsamd09 from: third_party_hw_drivers @@ -39,7 +37,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_neotrellis_keypad_atsamd09/image/connection.png diff --git a/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09_si91x.slcp b/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09_si91x.slcp new file mode 100644 index 00000000..e54e3fc6 --- /dev/null +++ b/app/example/adafruit_neotrellis_keypad_atsamd09/adafruit_neotrellis_keypad_atsamd09_si91x.slcp @@ -0,0 +1,60 @@ +project_name: adafruit_neotrellis_keypad_atsamd09 +package: platform +label: Third Party Hardware Drivers - NeoTrellis 4x4 Keypad (Adafruit) +description: | + This example project shows an example for Adafruit NeoTrellis 4x4 Keypad. +category: Example|Platform +quality: evaluation +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] +readme: +- path: ../../documentation/example/adafruit_neotrellis_keypad_atsamd09/README.md +source: +- path: app.c +- path: main.c +include: +- path: '' + file_list: + - path: app.h +component: +- id: sl_system +- id: adafruit_neotrellis_keypad_atsamd09 + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/adafruit_neotrellis_keypad_atsamd09/image/connection.png + directory: "image" + - path: ../../documentation/example/adafruit_neotrellis_keypad_atsamd09/image/create_example.png + directory: "image" + - path: ../../documentation/example/adafruit_neotrellis_keypad_atsamd09/image/result_test.gif + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_neotrellis_keypad_atsamd09/app.c b/app/example/adafruit_neotrellis_keypad_atsamd09/app.c index 6eefd175..48cb0d9b 100644 --- a/app/example/adafruit_neotrellis_keypad_atsamd09/app.c +++ b/app/example/adafruit_neotrellis_keypad_atsamd09/app.c @@ -3,36 +3,69 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * // Include ******************************************************************************/ #include -#include "app_log.h" -#include "app_assert.h" -#include "sl_i2cspm_instances.h" +#include "sl_sleeptimer.h" #include "adafruit_neotrellis.h" #include "adafruit_neotrellis_config.h" -#include "sl_sleeptimer.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif /***************************************************************************//** * // Definition ******************************************************************************/ -#define NUMBER_NEOTRELLIS_BOARD (NEOTRELLIS_NUM_COLUMN_BOARDS \ - * NEOTRELLIS_NUM_ROW_BOARDS) +#define NUMBER_NEOTRELLIS_BOARD (NEOTRELLIS_NUM_COLUMN_BOARDS \ + * NEOTRELLIS_NUM_ROW_BOARDS) /***************************************************************************//** * // Global Variables @@ -48,21 +81,33 @@ static uint32_t color_list[8] = { 0xff0000, 0xff00ff, 0xffff00, 0x00ff00, static TrellisCallback blink(keyEvent evt); +static mikroe_i2c_handle_t app_i2c_instance = NULL; + /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { - sl_status_t sc; + sl_status_t sc = SL_STATUS_OK; + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif - app_log("\rAdafruit NeoTrellis 4x4 Keypad Initializing....\n"); + app_printf("Adafruit NeoTrellis 4x4 Keypad Initializing....\r\n"); - sc = adafruit_neotrellis_init(sl_i2cspm_qwiic, + sc = adafruit_neotrellis_init(app_i2c_instance, keypad_addr_list, NUMBER_NEOTRELLIS_BOARD); - app_assert(sc == SL_STATUS_OK, "Keypad Initilization fail\n"); - app_log("number keypad: %d\n", NUMBER_NEOTRELLIS_BOARD); + if (sc != SL_STATUS_OK) { + app_printf("Keypad Initilization fail\r\n"); + while (1) {} + } + + app_printf("number keypad: %d\r\n", NUMBER_NEOTRELLIS_BOARD); for (uint8_t i = 0; i < 16; i++) { sc |= adafruit_neotrellis_activateKey(i, SEESAW_KEYPAD_EDGE_FALLING, true); @@ -70,8 +115,6 @@ void app_init(void) adafruit_neotrellis_registerCallback(i, blink); } - app_assert_status(sc); - for (uint8_t i = 0; i < 16; i++) { adafruit_neotrellis_setPixelColor(i, 0xff00ff); adafruit_neotrellis_show(); @@ -80,7 +123,12 @@ void app_init(void) adafruit_neotrellis_show(); } - app_log("\rApplication Initialization done.\n"); + if (sc != SL_STATUS_OK) { + app_printf("\rApplication Initialization fail.\r\n"); + while (1) {} + } else { + app_printf("\rApplication Initialization done.\r\n"); + } } /***************************************************************************//** diff --git a/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp b/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp index fdfa3976..b772adfb 100644 --- a/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp +++ b/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741.slcp @@ -5,6 +5,7 @@ description: | This example project shows an example for Adafruit 13x9 PWM RGB LED Matrix driver integration. category: Example|Platform quality: evaluation + filter: - name: Device Type value: [SoC] @@ -12,15 +13,19 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] + readme: - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/README.md + source: - path: app.c - path: main.c + include: - path: '' file_list: - path: app.h + component: - id: sl_system - id: device_init @@ -35,18 +40,14 @@ component: from: third_party_hw_drivers - id: services_oled_glib from: third_party_hw_drivers -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] + define: - name: DEBUG_EFM + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 + other_file: - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/connection.png directory: "image" @@ -54,10 +55,11 @@ other_file: directory: "image" - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/create_example.png directory: "image" + - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/yt_thumbnail.jpg + directory: "image" - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/result_test.gif directory: "image" ui_hints: highlight: - path: README.md focus: true - diff --git a/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741_si91x.slcp b/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741_si91x.slcp new file mode 100644 index 00000000..0f484970 --- /dev/null +++ b/app/example/adafruit_rgb_led_is31fl3741/adafruit_rgb_led_is31fl3741_si91x.slcp @@ -0,0 +1,73 @@ +project_name: adafruit_rgb_led_is31fl3741_si91x +package: platform +label: Third Party Hardware Drivers - IS31FL3741 - 13x9 PWM RGB LED Matrix (Adafruit) +description: | + This example project shows an example for Adafruit 13x9 PWM RGB LED Matrix driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_rgb_led_is31fl3741/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: adafruit_rgb_led_is31fl3741 + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: app_assert + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/connection.png + directory: "image" + - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/config.png + directory: "image" + - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/create_example.png + directory: "image" + - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/yt_thumbnail.jpg + directory: "image" + - path: ../../documentation/example/adafruit_rgb_led_is31fl3741/image/result_test.gif + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/adafruit_rgb_led_is31fl3741/app.c b/app/example/adafruit_rgb_led_is31fl3741/app.c index 1a340c91..a009b649 100644 --- a/app/example/adafruit_rgb_led_is31fl3741/app.c +++ b/app/example/adafruit_rgb_led_is31fl3741/app.c @@ -3,31 +3,65 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- - #include -#include "app_log.h" #include "app_assert.h" -#include "sl_i2cspm_instances.h" -#include "adafruit_is31fl3741.h" #include "sl_sleeptimer.h" +#include "adafruit_is31fl3741.h" #include "glib.h" #include "glib_font.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- @@ -38,6 +72,7 @@ static uint16_t color[] = { 0xf800, 0xffe0, 0x07e0, 0x07ff, 0x001f, 0xf81f, 0xffff, 0x73c0 }; static volatile bool app_timer_expire = false; static sl_sleeptimer_timer_handle_t app_timer; +static mikroe_i2c_handle_t app_i2c_instance = NULL; // ----------------------------------------------------------------------------- // Local Functions @@ -53,9 +88,15 @@ void app_init(void) { sl_status_t ret; - ret = adafruit_is31fl3741_init(sl_i2cspm_qwiic); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + ret = adafruit_is31fl3741_init(app_i2c_instance); app_assert(ret == SL_STATUS_OK, "\rAdafruit RGB LED initialization fail\n"); - app_log("\rAdafruit RGB LED initialization done\n"); + app_printf("\rAdafruit RGB LED initialization done\n"); // GLIB initialization glib_init(&glib_context); @@ -64,7 +105,7 @@ void app_init(void) glib_set_bg_color(&glib_context, 0x0000); glib_enable_wrap(&glib_context, false); glib_enable_display(true); - app_log("\rGLIB Initialization done\n"); + app_printf("\rGLIB Initialization done\n"); ret = sl_sleeptimer_start_periodic_timer_ms(&app_timer, 50, @@ -73,7 +114,7 @@ void app_init(void) 0, 0); app_assert(ret == SL_STATUS_OK, "\rStart displaying text fail\n"); - app_log("\rStart displaying text\n"); + app_printf("\rStart displaying text\n"); } /***************************************************************************//** diff --git a/app/example/adafruit_rgb_led_is31fl3741/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/adafruit_rgb_led_is31fl3741/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/adafruit_rgb_led_is31fl3741/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp index d30664cb..071eb85b 100644 --- a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp +++ b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d.slcp @@ -18,11 +18,13 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/README.md source: -- path: app.c +- path: gecko/app.c +- path: app_main_screen.c +- path: app_calib_screen.c - path: main.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h @@ -34,19 +36,22 @@ component: - id: app_assert - id: sleeptimer - id: app_log +- id: udelay - id: adafruit_tft_lcd_hxd8357d from: third_party_hw_drivers - id: services_oled_glib from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/create_example_with_dma_mode.png @@ -55,27 +60,31 @@ other_file: directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/result.GIF directory: image - - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/enable_calib_printf.png + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/calib.jpg directory: image - - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/calib_point.png + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/touch_settings.png directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/hxd8357d_display.png directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/hardware_connect.png directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi_dma.png + directory: image configuration: -- name: CALIB_X_MIN +- name: TOUCHSCREEN_X_MIN value: '428' -- name: CALIB_X_MAX +- name: TOUCHSCREEN_X_MAX value: '3628' -- name: CALIB_Y_MIN +- name: TOUCHSCREEN_Y_MIN value: '260' -- name: CALIB_Y_MAX +- name: TOUCHSCREEN_Y_MAX value: '3776' -- name: TOUCHSCREEN_WIDTH +- name: TOUCHSCREEN_HOR_RES value: '320' -- name: TOUCHSCREEN_HEIGHT +- name: TOUCHSCREEN_VER_RES value: '480' ui_hints: diff --git a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp index e9993d78..648b0dba 100644 --- a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp +++ b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma.slcp @@ -18,11 +18,13 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/README.md source: -- path: app.c +- path: gecko/app.c +- path: app_main_screen.c +- path: app_calib_screen.c - path: main.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h @@ -34,19 +36,22 @@ component: - id: app_assert - id: sleeptimer - id: app_log +- id: udelay - id: adafruit_tft_lcd_hxd8357d_dma from: third_party_hw_drivers - id: services_oled_glib from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/create_example_with_dma_mode.png @@ -55,27 +60,31 @@ other_file: directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/result.GIF directory: image - - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/enable_calib_printf.png + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/calib.jpg directory: image - - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/calib_point.png + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/touch_settings.png directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/hxd8357d_display.png directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/hardware_connect.png directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi_dma.png + directory: image configuration: -- name: CALIB_X_MIN +- name: TOUCHSCREEN_X_MIN value: '428' -- name: CALIB_X_MAX +- name: TOUCHSCREEN_X_MAX value: '3628' -- name: CALIB_Y_MIN +- name: TOUCHSCREEN_Y_MIN value: '260' -- name: CALIB_Y_MAX +- name: TOUCHSCREEN_Y_MAX value: '3776' -- name: TOUCHSCREEN_WIDTH +- name: TOUCHSCREEN_HOR_RES value: '320' -- name: TOUCHSCREEN_HEIGHT +- name: TOUCHSCREEN_VER_RES value: '480' ui_hints: diff --git a/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma_si91x.slcp b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma_si91x.slcp new file mode 100644 index 00000000..7154fb97 --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d/adafruit_tft_lcd_hxd8357d_dma_si91x.slcp @@ -0,0 +1,103 @@ +project_name: adafruit_tft_lcd_hxd8357d_dma_si91x +package: platform +label: Third Party Hardware Drivers - HXD8357D - TFT LCD with Touchscreen (Adafruit) - SPI with DMA +description: | + This example project shows an example for Adafruit TFT LCD with Touchscreen driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/README.md + +source: +- path: si91x/app.c +- path: app_main_screen.c +- path: app_calib_screen.c +- path: main.c + +include: +- path: 'si91x' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: adafruit_tft_lcd_hxd8357d_dma + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers +- id: touch_screen_analog + from: third_party_hw_drivers +- id: touch_screen_analog_si91x + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/create_example_with_dma_mode.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/create_example_without_dma_mode.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/result.GIF + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/calib.jpg + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/touch_settings.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/hxd8357d_display.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/hardware_connect.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d/image/gspi_dma.png + directory: image + +configuration: +- name: SL_GSPI_DMA_CONFIG_ENABLE + value: "1" +- name: TOUCHSCREEN_X_MIN + value: '678' +- name: TOUCHSCREEN_X_MAX + value: '3566' +- name: TOUCHSCREEN_Y_MIN + value: '393' +- name: TOUCHSCREEN_Y_MAX + value: '3521' +- name: TOUCHSCREEN_HOR_RES + value: '320' +- name: TOUCHSCREEN_VER_RES + value: '480' +- name: "GSPI_UC" + value: "0" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb + diff --git a/app/example/adafruit_tft_lcd_hxd8357d/app.c b/app/example/adafruit_tft_lcd_hxd8357d/app.c deleted file mode 100644 index 019a7789..00000000 --- a/app/example/adafruit_tft_lcd_hxd8357d/app.c +++ /dev/null @@ -1,163 +0,0 @@ -/***************************************************************************//** - * @file - * @brief Top level application functions - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" -#include "app_assert.h" -#include "adafruit_hxd8357d.h" -#include "touch_screen.h" -#include "glib.h" -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_DMA_PRESENT) -#include "sl_spidrv_instances.h" -#endif - -#define PRESSURE_THRESH 25 - -static glib_context_t g_context; -static touch_point_t point; -static uint16_t color = HXD8357D_YELLOW; -static uint8_t rotation = 0; - -static void draw_main_screen(void); -static void select_color(touch_point_t point); - -void app_init(void) -{ - sl_status_t sc; - -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_PRESENT) - sc = adafruit_hxd8357d_init(); -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_DMA_PRESENT) - sc = adafruit_hxd8357d_init(sl_spidrv_hxd8357d_handle); -#endif - app_assert_status(sc); - app_log("\rAdafruit HXD8357D Init done\n"); - - sc = touch_screen_init(); - app_assert_status(sc); - app_log("\rTouch Screen Init done\n"); - - glib_init(&g_context); - app_assert_status(sc); - app_log("\rGLIB Init done\n"); - g_context.bg_color = HXD8357D_BLACK; - g_context.textsize_x = 2; - g_context.textsize_y = 2; - g_context.text_color = HXD8357D_WHITE; - g_context.wrap = false; - - glib_set_rotation(&g_context, rotation); - - draw_main_screen(); -} - -/***************************************************************************//** - * App ticking function. - ******************************************************************************/ -void app_process_action(void) -{ - touch_screen_get_point(100, &point); - int temp; - switch (rotation) { - case 1: - temp = point.x; - point.x = point.y; - point.y = g_context.height - temp; - break; - case 2: - point.x = g_context.width - point.x; - point.y = g_context.height - point.y; - break; - case 3: - temp = point.x; - point.x = g_context.width - point.y; - point.y = g_context.height - temp; - break; - default: - break; - } - if (point.z < PRESSURE_THRESH) { - if ((point.y >= (g_context.height - 30)) && (point.x < 240)) { - select_color(point); - } else if ((point.x >= (g_context.width - 40)) && (point.y < 25)) { - draw_main_screen(); - } else if ((point.x >= (g_context.width - 80)) && (point.y < 25)) { - // go to erase mode - glib_fill_rect(&g_context, g_context.width - 80, 0, 40, 25, HXD8357D_RED); - glib_draw_string(&g_context, "ERA", g_context.width - 77, 5); - color = HXD8357D_BLACK; - } else { - glib_fill_circle(&g_context, point.x, point.y, 2, color); - } - } -} - -static void select_color(touch_point_t point) -{ - // draw erase button - if (color == HXD8357D_BLACK) { - glib_fill_rect(&g_context, g_context.width - 80, 0, 40, 25, HXD8357D_BLACK); - glib_draw_string(&g_context, "ERA", g_context.width - 77, 5); - glib_draw_rect(&g_context, g_context.width - 80, 0, 40, 25, HXD8357D_WHITE); - } - - // select color - if ((point.x >= 0) && (point.x < 30)) { - color = HXD8357D_BLUE; - } else if ((point.x >= 30) && (point.x < 60)) { - color = HXD8357D_RED; - } else if ((point.x >= 60) && (point.x < 90)) { - color = HXD8357D_GREEN; - } else if ((point.x >= 90) && (point.x < 120)) { - color = HXD8357D_CYAN; - } else if ((point.x >= 120) && (point.x < 150)) { - color = HXD8357D_MAGENTA; - } else if ((point.x >= 150) && (point.x < 180)) { - color = HXD8357D_YELLOW; - } else if ((point.x >= 180) && (point.x < 210)) { - color = HXD8357D_WHITE; - } - glib_fill_rect(&g_context, 0, 0, 10, 10, color); -} - -static void draw_main_screen(void) -{ - glib_fill(&g_context, HXD8357D_BLACK); - glib_fill_rect(&g_context, 0, g_context.height - 30, 30, 30, HXD8357D_BLUE); - glib_fill_rect(&g_context, 30, g_context.height - 30, 30, 30, HXD8357D_RED); - glib_fill_rect(&g_context, 60, g_context.height - 30, 30, 30, HXD8357D_GREEN); - glib_fill_rect(&g_context, 90, g_context.height - 30, 30, 30, HXD8357D_CYAN); - glib_fill_rect(&g_context, - 120, - g_context.height - 30, - 30, - 30, - HXD8357D_MAGENTA); - glib_fill_rect(&g_context, 150, g_context.height - 30, 30, 30, - HXD8357D_YELLOW); - glib_fill_rect(&g_context, 180, g_context.height - 30, 30, 30, - HXD8357D_WHITE); - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - // draw reset button - glib_draw_string(&g_context, "RTS", g_context.width - 37, 5); - glib_draw_rect(&g_context, g_context.width - 40, 0, 40, 25, HXD8357D_WHITE); - // draw erase button - glib_draw_string(&g_context, "ERA", g_context.width - 77, 5); - glib_draw_rect(&g_context, g_context.width - 80, 0, 40, 25, HXD8357D_WHITE); -} diff --git a/app/example/adafruit_tft_lcd_hxd8357d/app_calib_screen.c b/app/example/adafruit_tft_lcd_hxd8357d/app_calib_screen.c new file mode 100644 index 00000000..45988fbd --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d/app_calib_screen.c @@ -0,0 +1,82 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "glib.h" +#include "adafruit_hxd8357d.h" + +#define Y_OFFSET (40) + +void calib_screen_update( + glib_context_t *g_context, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw) +{ + char string_buf[32]; + + snprintf(string_buf, sizeof(string_buf), "X: %3ld ", x); + glib_draw_string(g_context, string_buf, 0, Y_OFFSET + 30); + snprintf(string_buf, sizeof(string_buf), "X_RAW: %4d ", x_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 30); + + snprintf(string_buf, sizeof(string_buf), "Y: %3ld", y); + glib_draw_string(g_context, string_buf, 0, Y_OFFSET + 50); + snprintf(string_buf, sizeof(string_buf), "Y_RAW: %4d", y_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 50); + + snprintf(string_buf, sizeof(string_buf), "RT: %3ld ", rtouch); + glib_draw_string(g_context, string_buf, 0, Y_OFFSET + 70); + snprintf(string_buf, sizeof(string_buf), "Z1_RAW: %4d ", z1_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 70); + snprintf(string_buf, sizeof(string_buf), "Z2_RAW: %4d ", z2_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 90); +} + +void calib_screen_init(glib_context_t *g_context) +{ + glib_fill(g_context, HXD8357D_BLACK); + glib_draw_string(g_context, "~TOUCH SCREEN CALIB~", 40, Y_OFFSET); + glib_fill_rect(g_context, 0, 0, 10, 10, + HXD8357D_GREEN); + glib_fill_rect(g_context, + g_context->width - 10, + g_context->height - 10, + 10, 10, + HXD8357D_YELLOW); + calib_screen_update(g_context, + 0, 0, 0, + 0, 0, 0, 0); +} diff --git a/app/example/adafruit_tft_lcd_hxd8357d/app_main_screen.c b/app/example/adafruit_tft_lcd_hxd8357d/app_main_screen.c new file mode 100644 index 00000000..5b8f9e23 --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d/app_main_screen.c @@ -0,0 +1,135 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "glib.h" +#include "adafruit_hxd8357d.h" + +static uint16_t color = HXD8357D_YELLOW; +static uint8_t rotation = 0; + +static void select_color(glib_context_t *g_context, + int32_t x) +{ + // draw erase button + if (color == HXD8357D_BLACK) { + glib_fill_rect(g_context, g_context->width - 80, 0, 40, 25, HXD8357D_BLACK); + glib_draw_string(g_context, "ERA", g_context->width - 77, 5); + glib_draw_rect(g_context, g_context->width - 80, 0, 40, 25, HXD8357D_WHITE); + } + + // select color + if ((x >= 0) && (x < 30)) { + color = HXD8357D_BLUE; + } else if ((x >= 30) && (x < 60)) { + color = HXD8357D_RED; + } else if ((x >= 60) && (x < 90)) { + color = HXD8357D_GREEN; + } else if ((x >= 90) && (x < 120)) { + color = HXD8357D_CYAN; + } else if ((x >= 120) && (x < 150)) { + color = HXD8357D_MAGENTA; + } else if ((x >= 150) && (x < 180)) { + color = HXD8357D_YELLOW; + } else if ((x >= 180) && (x < 210)) { + color = HXD8357D_WHITE; + } + glib_fill_rect(g_context, 0, 0, 10, 10, color); +} + +void main_screen_init(glib_context_t *g_context) +{ + glib_fill(g_context, HXD8357D_BLACK); + glib_fill_rect(g_context, 0, g_context->height - 30, 30, 30, HXD8357D_BLUE); + glib_fill_rect(g_context, 30, g_context->height - 30, 30, 30, HXD8357D_RED); + glib_fill_rect(g_context, 60, g_context->height - 30, 30, 30, HXD8357D_GREEN); + glib_fill_rect(g_context, 90, g_context->height - 30, 30, 30, HXD8357D_CYAN); + glib_fill_rect(g_context, + 120, + g_context->height - 30, + 30, + 30, + HXD8357D_MAGENTA); + glib_fill_rect(g_context, 150, g_context->height - 30, 30, 30, + HXD8357D_YELLOW); + glib_fill_rect(g_context, 180, g_context->height - 30, 30, 30, + HXD8357D_WHITE); + glib_fill_rect(g_context, 0, 0, 10, 10, color); + // draw reset button + glib_draw_string(g_context, "RTS", g_context->width - 37, 5); + glib_draw_rect(g_context, g_context->width - 40, 0, 40, 25, HXD8357D_WHITE); + // draw erase button + glib_draw_string(g_context, "ERA", g_context->width - 77, 5); + glib_draw_rect(g_context, g_context->width - 80, 0, 40, 25, HXD8357D_WHITE); + + glib_set_rotation(g_context, rotation); +} + +void main_screen_update(glib_context_t *g_context, + int32_t x, int32_t y) +{ + int temp; + switch (rotation) { + case 1: + temp = x; + x = y; + y = g_context->height - temp; + break; + case 2: + x = g_context->width - x; + y = g_context->height - y; + break; + case 3: + temp = x; + x = g_context->width - y; + y = g_context->height - temp; + break; + default: + break; + } + if ((y >= (g_context->height - 30)) && (x < 240)) { + select_color(g_context, x); + } else if ((x >= (g_context->width - 40)) && (y < 25)) { + main_screen_init(g_context); + } else if ((x >= (g_context->width - 80)) && (y < 25)) { + // go to erase mode + glib_fill_rect(g_context, g_context->width - 80, 0, 40, 25, HXD8357D_RED); + glib_draw_string(g_context, "ERA", g_context->width - 77, 5); + color = HXD8357D_BLACK; + } else { + glib_fill_circle(g_context, x, y, 2, color); + } +} diff --git a/app/example/adafruit_tft_lcd_hxd8357d/calib.c b/app/example/adafruit_tft_lcd_hxd8357d/calib.c new file mode 100644 index 00000000..7459e98a --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d/calib.c @@ -0,0 +1,70 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "glib.h" + +void calib_screen_print( + glib_context_t *g_context + int16_t glib_y_ofset, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw) +{ + char string_buf[32]; + + snprintf(string_buf, sizeof(string_buf), "X: %3ld ", x); + glib_draw_string(g_context, string_buf, 0, glib_y_ofset); + snprintf(string_buf, sizeof(string_buf), "X_RAW: %4d ", x_raw); + glib_draw_string(g_context, string_buf, 95, glib_y_ofset); + + snprintf(string_buf, sizeof(string_buf), "Y: %3ld", y); + glib_draw_string(g_context, string_buf, 0, glib_y_ofset + 20); + snprintf(string_buf, sizeof(string_buf), "Y_RAW: %4d", y_raw); + glib_draw_string(g_context, string_buf, 95, glib_y_ofset + 20); + + snprintf(string_buf, sizeof(string_buf), "RT: %3ld ", rtouch); + glib_draw_string(g_context, string_buf, 0, glib_y_ofset + 40); + snprintf(string_buf, sizeof(string_buf), "Z1_RAW: %4d ", z1_raw); + glib_draw_string(g_context, string_buf, 95, glib_y_ofset + 40); + snprintf(string_buf, sizeof(string_buf), "Z2_RAW: %4d ", z2_raw); + glib_draw_string(g_context, string_buf, 95, glib_y_ofset + 60); +} + +void calib_init(glib_context_t *g_context) +{ + glib_fill(&g_context, ILI9341_BLACK); + glib_draw_string(&g_context, "~TOUCH SCREEN CALIBRATION~", 15, 10); +} diff --git a/app/example/adafruit_tft_lcd_hxd8357d/gecko/app.c b/app/example/adafruit_tft_lcd_hxd8357d/gecko/app.c new file mode 100644 index 00000000..f61c31e4 --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d/gecko/app.c @@ -0,0 +1,124 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "app_log.h" +#include "app_assert.h" +#include "adafruit_hxd8357d.h" +#include "adafruit_hxd8357d_spi_config.h" +#include "touch_screen.h" +#include "glib.h" + +#define CALIB_ENABLED 0 + +#define PRESSURE_THRESH 500 + +void main_screen_init(glib_context_t *g_context); +void main_screen_update(glib_context_t *g_context, + int32_t x, int32_t y); + +void calib_screen_init(glib_context_t *g_context); +void calib_screen_update( + glib_context_t *g_context, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw); + +struct touch_screen touch_screen; +static touch_point_t point; +static glib_context_t g_context; + +MIPI_DBI_SPI_INTERFACE_DEFINE(hx8357d_config, + ADAFRUIT_HXD8357D_PERIPHERAL, + ADAFRUIT_HXD8357D_PERIPHERAL_NO, + ADAFRUIT_HXD8357D_BITRATE, + ADAFRUIT_HXD8357D_CLOCK_MODE, + ADAFRUIT_HXD8357D_CS_CONTROL, + ADAFRUIT_HXD8357D_CLK_PORT, + ADAFRUIT_HXD8357D_CLK_PIN, + ADAFRUIT_HXD8357D_TX_PORT, + ADAFRUIT_HXD8357D_TX_PIN, + ADAFRUIT_HXD8357D_RX_PORT, + ADAFRUIT_HXD8357D_RX_PIN, + ADAFRUIT_HXD8357D_CS_PORT, + ADAFRUIT_HXD8357D_CS_PIN, + ADAFRUIT_HXD8357D_DC_PORT, + ADAFRUIT_HXD8357D_DC_PIN); + +void app_init(void) +{ + sl_status_t sc; + + sc = adafruit_hxd8357d_init(&hx8357d_config); + app_assert_status(sc); + app_log("\rAdafruit HXD8357D Init done\n"); + + sc = touch_screen_init(&touch_screen); + app_assert_status(sc); + app_log("\rTouch Screen Init done\n"); + + glib_init(&g_context); + app_assert_status(sc); + app_log("\rGLIB Init done\n"); + g_context.bg_color = HXD8357D_BLACK; + g_context.textsize_x = 2; + g_context.textsize_y = 2; + g_context.text_color = HXD8357D_WHITE; + g_context.wrap = false; + +#if CALIB_ENABLED + calib_screen_init(&g_context); +#else + main_screen_init(&g_context); +#endif +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + touch_screen_get_point(&touch_screen, &point); + if (point.r_touch < PRESSURE_THRESH) { +#if CALIB_ENABLED + calib_screen_update(&g_context, + point.x, point.y, point.r_touch, + touch_screen.t_x, touch_screen.t_y, + touch_screen.t_z1, touch_screen.t_z2); +#else + main_screen_update(&g_context, point.x, point.y); +#endif + } +} diff --git a/app/example/adafruit_tft_lcd_hxd8357d/app.h b/app/example/adafruit_tft_lcd_hxd8357d/gecko/app.h similarity index 100% rename from app/example/adafruit_tft_lcd_hxd8357d/app.h rename to app/example/adafruit_tft_lcd_hxd8357d/gecko/app.h diff --git a/app/example/adafruit_tft_lcd_hxd8357d/si91x/app.c b/app/example/adafruit_tft_lcd_hxd8357d/si91x/app.c new file mode 100644 index 00000000..9904c39d --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d/si91x/app.c @@ -0,0 +1,126 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "app_assert.h" +#include "adafruit_hxd8357d.h" +#include "adafruit_hxd8357d_spi_config.h" +#include "touch_screen.h" +#include "glib.h" + +#define CALIB_ENABLED 0 + +#define PRESSURE_THRESH 500 + +void main_screen_init(glib_context_t *g_context); +void main_screen_update(glib_context_t *g_context, + int32_t x, int32_t y); + +void calib_screen_init(glib_context_t *g_context); +void calib_screen_update( + glib_context_t *g_context, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw); + +static glib_context_t g_context; +struct touch_screen touch_screen; +static touch_point_t point; + +MIPI_DBI_SPI_INTERFACE_DEFINE(hxd8357d_config, + ADAFRUIT_HXD8357D_BITRATE, + ADAFRUIT_HXD8357D_CLOCK_MODE, + ADAFRUIT_HXD8357D_CS_CONTROL, + RTE_GSPI_MASTER_CLK_PORT, + RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MOSI_PORT, + RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_CS0_PORT, + RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_4, + ADAFRUIT_HXD8357D_DC_PORT, + ADAFRUIT_HXD8357D_DC_PIN, + SL_GPIO_MODE_0); + +void app_init(void) +{ + sl_status_t sc; + + sc = adafruit_hxd8357d_init(&hxd8357d_config); + app_assert_status(sc); + printf("\rAdafruit HXD8357D Init done\n"); + + sc = touch_screen_init(&touch_screen); + app_assert_status(sc); + printf("\rTouch Screen Init done\n"); + + glib_init(&g_context); + app_assert_status(sc); + printf("\rGLIB Init done\n"); + g_context.bg_color = HXD8357D_BLACK; + g_context.textsize_x = 2; + g_context.textsize_y = 2; + g_context.text_color = HXD8357D_WHITE; + g_context.wrap = false; + +#if CALIB_ENABLED + calib_screen_init(&g_context); +#else + main_screen_init(&g_context); +#endif +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + touch_screen_get_point(&touch_screen, &point); + if (point.r_touch < PRESSURE_THRESH) { +#if CALIB_ENABLED + calib_screen_update(&g_context, + point.x, point.y, point.r_touch, + touch_screen.t_x, touch_screen.t_y, + touch_screen.t_z1, touch_screen.t_z2); +#else + main_screen_update(&g_context, point.x, point.y); +#endif + } +} diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app.h b/app/example/adafruit_tft_lcd_hxd8357d/si91x/app.h similarity index 100% rename from app/example/adafruit_tft_lcd_hxd8357d_lvgl/app.h rename to app/example/adafruit_tft_lcd_hxd8357d/si91x/app.h diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp index 73412001..fd1ba511 100644 --- a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp +++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl.slcp @@ -18,9 +18,9 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/README.md source: -- path: app.c +- path: gecko/app.c - path: main.c -- path: app_ui/ui_events.c +- path: app_ui/ui_events_gecko.c - path: app_ui/ui_helpers.c - path: app_ui/ui.c - path: app_ui/components/ui_comp_hook.c @@ -33,7 +33,7 @@ source: - path: app_ui/images/ui_img_842152610.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h - path: app_ui @@ -50,6 +50,7 @@ component: - id: app_assert - id: sleeptimer - id: app_log +- id: udelay - id: simple_led instance: [led0, led1] - id: simple_button @@ -60,13 +61,15 @@ component: from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/create_example.png @@ -85,19 +88,23 @@ other_file: directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/single_buffered_lvgl_settings.png directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi_dma.png + directory: image configuration: -- name: CALIB_X_MIN +- name: TOUCHSCREEN_X_MIN value: '428' -- name: CALIB_X_MAX +- name: TOUCHSCREEN_X_MAX value: '3628' -- name: CALIB_Y_MIN +- name: TOUCHSCREEN_Y_MIN value: '260' -- name: CALIB_Y_MAX +- name: TOUCHSCREEN_Y_MAX value: '3776' -- name: TOUCHSCREEN_WIDTH +- name: TOUCHSCREEN_HOR_RES value: '320' -- name: TOUCHSCREEN_HEIGHT +- name: TOUCHSCREEN_VER_RES value: '480' - name: LV_BUFFER_MODE value: "0" diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp index 3626d4b0..a8257939 100644 --- a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp +++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma.slcp @@ -18,9 +18,9 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/README.md source: -- path: app.c +- path: gecko/app.c - path: main.c -- path: app_ui/ui_events.c +- path: app_ui/ui_events_gecko.c - path: app_ui/ui_helpers.c - path: app_ui/ui.c - path: app_ui/components/ui_comp_hook.c @@ -34,7 +34,7 @@ source: include: -- path: '' +- path: 'gecko' file_list: - path: app.h - path: app_ui @@ -52,6 +52,7 @@ component: - id: app_assert - id: sleeptimer - id: app_log +- id: udelay - id: simple_led instance: [led0, led1] - id: simple_button @@ -60,6 +61,8 @@ component: from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers - id: services_lvgl from: third_party_hw_drivers @@ -68,7 +71,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/create_example.png @@ -87,19 +90,23 @@ other_file: directory: image - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/single_buffered_lvgl_settings.png directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi_dma.png + directory: image configuration: -- name: CALIB_X_MIN +- name: TOUCHSCREEN_X_MIN value: '428' -- name: CALIB_X_MAX +- name: TOUCHSCREEN_X_MAX value: '3628' -- name: CALIB_Y_MIN +- name: TOUCHSCREEN_Y_MIN value: '260' -- name: CALIB_Y_MAX +- name: TOUCHSCREEN_Y_MAX value: '3776' -- name: TOUCHSCREEN_WIDTH +- name: TOUCHSCREEN_HOR_RES value: '320' -- name: TOUCHSCREEN_HEIGHT +- name: TOUCHSCREEN_VER_RES value: '480' - name: LV_BUFFER_MODE value: "1" diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma_si91x.slcp b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma_si91x.slcp new file mode 100644 index 00000000..427b2ee1 --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/adafruit_tft_lcd_hxd8357d_lvgl_dma_si91x.slcp @@ -0,0 +1,132 @@ +project_name: adafruit_tft_lcd_hxd8357d_lvgl_dma_si91x +package: platform +label: Third Party Hardware Drivers - HXD8357D - TFT LCD with Touchscreen (Adafruit) - LVGL + DMA +description: | + This example project shows an example for Adafruit HXD8357D TFT LCD with Touchscreen driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/README.md + +source: +- path: si91x/app.c +- path: main.c +- path: app_ui/ui_events_si91x.c +- path: app_ui/ui_helpers.c +- path: app_ui/ui.c +- path: app_ui/components/ui_comp_hook.c +- path: app_ui/screens/ui_loader.c +- path: app_ui/screens/ui_main.c +- path: app_ui/images/ui_img_buld_off_png.c +- path: app_ui/images/ui_img_buld_on_png.c +- path: app_ui/images/ui_img_button1_off_png.c +- path: app_ui/images/ui_img_button1_on_png.c +- path: app_ui/images/ui_img_842152610.c + +include: +- path: 'si91x' + file_list: + - path: app.h +- path: app_ui + file_list: + - path: ui_events.h + - path: ui_helpers.h + - path: ui.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: sl_si91x_button_917 + instance: [btn0, btn1] + from: wiseconnect3_sdk +- id: sl_si91x_led_917 + instance: [led0, led1] + from: wiseconnect3_sdk +- id: adafruit_tft_lcd_hxd8357d_dma + from: third_party_hw_drivers +- id: services_lvgl + from: third_party_hw_drivers +- id: touch_screen_analog + from: third_party_hw_drivers +- id: touch_screen_analog_si91x + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/create_example.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/result.GIF + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/enable_calib_printf.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/calib_point.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/hxd8357d_display.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/hardware_connect.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/double_buffered_lvgl_settings.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/single_buffered_lvgl_settings.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_hxd8357d_lvgl/image/gspi_dma.png + directory: image + +configuration: +- name: SL_GSPI_DMA_CONFIG_ENABLE + value: "1" +- name: TOUCHSCREEN_X_MIN + value: '678' +- name: TOUCHSCREEN_X_MAX + value: '3566' +- name: TOUCHSCREEN_Y_MIN + value: '393' +- name: TOUCHSCREEN_Y_MAX + value: '3521' +- name: TOUCHSCREEN_HOR_RES + value: '320' +- name: TOUCHSCREEN_VER_RES + value: '480' +- name: LV_BUFFER_MODE + value: "1" +- name: LV_DISPLAY_ROTATION + value: "LV_DISP_ROT_90" +- name: LV_ENABLE_SOFTWARE_ROTATION + value: "1" +- name: LV_INPUT_TYPE + value: "LV_INPUT_TYPE_POINTER" +- name: "GSPI_UC" + value: "0" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui/ui_events.c b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui/ui_events_gecko.c similarity index 100% rename from app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui/ui_events.c rename to app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui/ui_events_gecko.c diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui/ui_events_si91x.c b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui/ui_events_si91x.c new file mode 100644 index 00000000..af7b8380 --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app_ui/ui_events_si91x.c @@ -0,0 +1,53 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: demo_hxd8357d + +#include "ui.h" +#include "sl_si91x_led_instances.h" +#include "sl_si91x_led.h" + +static volatile bool led0_status = false; +static volatile bool led1_status = false; + +void led0_switch(lv_event_t *e) +{ + (void) e; + // Your code here + if (led0_status) { + led0_status = false; + sl_si91x_led_set(led_led0.pin); + lv_obj_add_flag(ui_led0OffSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(ui_led0OffLabel, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led0ONSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led0OnLabel, LV_OBJ_FLAG_HIDDEN); + } else { + led0_status = true; + sl_si91x_led_clear(led_led0.pin); + lv_obj_add_flag(ui_led0ONSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(ui_led0OnLabel, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led0OffSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led0OffLabel, LV_OBJ_FLAG_HIDDEN); + } +} + +void led1_switch(lv_event_t *e) +{ + (void) e; + // Your code here + if (led1_status) { + led1_status = false; + sl_si91x_led_set(led_led1.pin); + lv_obj_add_flag(ui_led1OffSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(ui_led1OffLabel, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led1ONSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led1OnLabel, LV_OBJ_FLAG_HIDDEN); + } else { + led1_status = true; + sl_si91x_led_clear(led_led1.pin); + lv_obj_add_flag(ui_led1ONSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(ui_led1OnLabel, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led1OffSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led1OffLabel, LV_OBJ_FLAG_HIDDEN); + } +} diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app.c b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/gecko/app.c similarity index 57% rename from app/example/adafruit_tft_lcd_hxd8357d_lvgl/app.c rename to app/example/adafruit_tft_lcd_hxd8357d_lvgl/gecko/app.c index d166baf3..a606979c 100644 --- a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/app.c +++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/gecko/app.c @@ -3,26 +3,41 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include "sl_sleeptimer.h" #include "sl_component_catalog.h" -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_DMA_PRESENT) -#include "sl_spidrv_instances.h" -#endif +#include "adafruit_hxd8357d_spi_config.h" #include "adafruit_hxd8357d.h" #include "lv_port_disp.h" #include "lv_port_indev.h" @@ -37,16 +52,29 @@ static bool btn0_pressed = 0; static bool btn0_released = 0; static sl_sleeptimer_timer_handle_t lvgl_tick_timer; +MIPI_DBI_SPI_INTERFACE_DEFINE(hx8357d_config, + ADAFRUIT_HXD8357D_PERIPHERAL, + ADAFRUIT_HXD8357D_PERIPHERAL_NO, + ADAFRUIT_HXD8357D_BITRATE, + ADAFRUIT_HXD8357D_CLOCK_MODE, + ADAFRUIT_HXD8357D_CS_CONTROL, + ADAFRUIT_HXD8357D_CLK_PORT, + ADAFRUIT_HXD8357D_CLK_PIN, + ADAFRUIT_HXD8357D_TX_PORT, + ADAFRUIT_HXD8357D_TX_PIN, + ADAFRUIT_HXD8357D_RX_PORT, + ADAFRUIT_HXD8357D_RX_PIN, + ADAFRUIT_HXD8357D_CS_PORT, + ADAFRUIT_HXD8357D_CS_PIN, + ADAFRUIT_HXD8357D_DC_PORT, + ADAFRUIT_HXD8357D_DC_PIN); + static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, void *data); void app_init(void) { -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_PRESENT) - adafruit_hxd8357d_init(); -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_DMA_PRESENT) - adafruit_hxd8357d_init(sl_spidrv_hxd8357d_handle); -#endif + adafruit_hxd8357d_init(&hx8357d_config); lv_init(); lv_port_disp_init(); lv_port_indev_init(); diff --git a/app/example/adafruit_tft_lcd_ili9341/app.h b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/gecko/app.h similarity index 100% rename from app/example/adafruit_tft_lcd_ili9341/app.h rename to app/example/adafruit_tft_lcd_hxd8357d_lvgl/gecko/app.h diff --git a/app/example/adafruit_tft_lcd_hxd8357d_lvgl/si91x/app.c b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/si91x/app.c new file mode 100644 index 00000000..95da96f7 --- /dev/null +++ b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/si91x/app.c @@ -0,0 +1,152 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "sl_sleeptimer.h" +#include "sl_component_catalog.h" +#include "adafruit_hxd8357d_spi_config.h" +#include "adafruit_hxd8357d.h" +#include "lv_port_disp.h" +#include "lv_port_indev.h" +#include "ui.h" + +#include "sl_si91x_led.h" +#include "sl_si91x_button.h" +#include "sl_si91x_button_pin_config.h" +#include "sl_si91x_led_config.h" +#include "sl_si91x_button_instances.h" +#include "sl_si91x_led_instances.h" + +#define LVGL_TIMER_PERIOD 1 + +static bool btn0_pressed = 0; +static bool btn0_released = 0; +static sl_sleeptimer_timer_handle_t lvgl_tick_timer; + +MIPI_DBI_SPI_INTERFACE_DEFINE(hxd8357d_config, + ADAFRUIT_HXD8357D_BITRATE, + ADAFRUIT_HXD8357D_CLOCK_MODE, + ADAFRUIT_HXD8357D_CS_CONTROL, + RTE_GSPI_MASTER_CLK_PORT, + RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MOSI_PORT, + RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_CS0_PORT, + RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_4, + ADAFRUIT_HXD8357D_DC_PORT, + ADAFRUIT_HXD8357D_DC_PIN, + SL_GPIO_MODE_0); + +static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data); + +void app_init(void) +{ + adafruit_hxd8357d_init(&hxd8357d_config); + lv_init(); + lv_port_disp_init(); + lv_port_indev_init(); + + sl_sleeptimer_start_periodic_timer_ms(&lvgl_tick_timer, + LVGL_TIMER_PERIOD, + lvgl_tick_timer_callback, + NULL, + 0, + 0); + + ui_init(); + + // init status led 0 + lv_obj_add_flag(ui_led0ONSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(ui_led0OnLabel, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led0OffSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led0OffLabel, LV_OBJ_FLAG_HIDDEN); + + // init status Led 1 + lv_obj_add_flag(ui_led1ONSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(ui_led1OnLabel, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led1OffSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_led1OffLabel, LV_OBJ_FLAG_HIDDEN); + + // init status button 0 + lv_obj_add_flag(ui_buttonOnSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_buttonOffSymbol, LV_OBJ_FLAG_HIDDEN); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + lv_timer_handler_run_in_period(5); + + if (btn0_pressed) { + lv_obj_add_flag(ui_buttonOffSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_buttonOnSymbol, LV_OBJ_FLAG_HIDDEN); + btn0_pressed = false; + } + if (btn0_released) { + lv_obj_add_flag(ui_buttonOnSymbol, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_buttonOffSymbol, LV_OBJ_FLAG_HIDDEN); + btn0_released = false; + } +} + +static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data) +{ + (void)timer; + (void)data; + + lv_tick_inc(LVGL_TIMER_PERIOD); +} + +void sl_si91x_button_isr(uint8_t pin, int8_t state) +{ + if (pin == button_btn0.pin) { + if (state == BUTTON_PRESSED) { + btn0_pressed = true; + } else { + btn0_released = true; + } + } +} diff --git a/app/example/adafruit_tft_lcd_st7789/app.h b/app/example/adafruit_tft_lcd_hxd8357d_lvgl/si91x/app.h similarity index 100% rename from app/example/adafruit_tft_lcd_st7789/app.h rename to app/example/adafruit_tft_lcd_hxd8357d_lvgl/si91x/app.h diff --git a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp index 1e5e68d7..ab153b15 100644 --- a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp +++ b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341.slcp @@ -18,11 +18,13 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_ili9341/README.md source: -- path: app.c +- path: gecko/app.c +- path: app_main_screen.c +- path: app_calib_screen.c - path: main.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h @@ -34,28 +36,35 @@ component: - id: app_assert - id: sleeptimer - id: app_log +- id: udelay - id: adafruit_tft_lcd_ili9341 from: third_party_hw_drivers - id: services_oled_glib from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/create_example.png directory: image - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/result.GIF directory: image - - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/enable_calib_printf.png + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/calib.jpg + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/touch_settings.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/gspi.png directory: image - - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/calib_point.png + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/gspi_dma.png directory: image ui_hints: diff --git a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp index a63f979a..3c2eba55 100644 --- a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp +++ b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma.slcp @@ -18,11 +18,13 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_ili9341/README.md source: -- path: app.c +- path: gecko/app.c +- path: app_main_screen.c +- path: app_calib_screen.c - path: main.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h @@ -34,28 +36,35 @@ component: - id: app_assert - id: sleeptimer - id: app_log +- id: udelay - id: adafruit_tft_lcd_ili9341_dma from: third_party_hw_drivers - id: services_oled_glib from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/create_example.png directory: image - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/result.GIF directory: image - - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/enable_calib_printf.png + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/calib.jpg + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/touch_settings.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/gspi.png directory: image - - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/calib_point.png + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/gspi_dma.png directory: image ui_hints: diff --git a/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma_si91x.slcp b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma_si91x.slcp new file mode 100644 index 00000000..a7b3714a --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341/adafruit_tft_lcd_ili9341_dma_si91x.slcp @@ -0,0 +1,92 @@ +project_name: adafruit_tft_lcd_ili9341_dma_si91x +package: platform +label: Third Party Hardware Drivers - ILI9341 - TFT LCD with Touchscreen (Adafruit) - SPI +description: | + This example project shows an example for Adafruit TFT LCD with Touchscreen driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_tft_lcd_ili9341/README.md + +source: +- path: si91x/app.c +- path: app_main_screen.c +- path: app_calib_screen.c +- path: main.c + +include: +- path: 'si91x' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: adafruit_tft_lcd_ili9341_dma + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers +- id: touch_screen_analog + from: third_party_hw_drivers +- id: touch_screen_analog_si91x + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +configuration: +- name: SL_GSPI_DMA_CONFIG_ENABLE + value: "1" +- name: TOUCHSCREEN_X_MIN + value: '598' +- name: TOUCHSCREEN_X_MAX + value: '3618' +- name: TOUCHSCREEN_Y_MIN + value: '420' +- name: TOUCHSCREEN_Y_MAX + value: '3402' +- name: "GSPI_UC" + value: "0" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/create_example.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/result.GIF + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/calib.jpg + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/touch_settings.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/gspi.png + directory: image + - path: ../../documentation/example/adafruit_tft_lcd_ili9341/image/gspi_dma.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_tft_lcd_ili9341/app.c b/app/example/adafruit_tft_lcd_ili9341/app.c deleted file mode 100644 index 550985f0..00000000 --- a/app/example/adafruit_tft_lcd_ili9341/app.c +++ /dev/null @@ -1,144 +0,0 @@ -/***************************************************************************//** - * @file - * @brief Top level application functions - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" -#include "app_assert.h" -#include "adafruit_ili9341.h" -#include "touch_screen.h" -#include "glib.h" -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_DMA_PRESENT) -#include "sl_spidrv_instances.h" -#endif - -#define PRESSURE_THRESH 25 - -static glib_context_t g_context; -static touch_point_t point; -static uint16_t color = ILI9341_YELLOW; -static uint8_t rotation = 0; - -static void draw_main_screen(void) -{ - glib_fill(&g_context, ILI9341_BLACK); - glib_fill_rect(&g_context, 0, g_context.height - 30, 30, 30, ILI9341_YELLOW); - glib_fill_rect(&g_context, 30, g_context.height - 30, 30, 30, ILI9341_BLUE); - glib_fill_rect(&g_context, 60, g_context.height - 30, 30, 30, ILI9341_GREEN); - glib_fill_rect(&g_context, 90, g_context.height - 30, 30, 30, ILI9341_RED); - glib_fill_rect(&g_context, 120, g_context.height - 30, 30, 30, ILI9341_WHITE); - glib_fill_rect(&g_context, 150, g_context.height - 30, 30, 30, ILI9341_PINK); - glib_fill_rect(&g_context, 180, g_context.height - 30, 30, 30, - ILI9341_PURPLE); - glib_fill_rect(&g_context, 210, g_context.height - 30, 30, 30, - ILI9341_ORANGE); - - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - glib_draw_string(&g_context, "CLR", g_context.width - 37, 5); - glib_draw_rect(&g_context, g_context.width - 40, 0, 40, 25, ILI9341_WHITE); -} - -void app_init(void) -{ - sl_status_t sc; - -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_PRESENT) - sc = adafruit_ili9341_init(); -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_DMA_PRESENT) - sc = adafruit_ili9341_init(sl_spidrv_ili9341_handle); -#endif - app_assert_status(sc); - app_log("\rAdafruit ILI9341 Init done\n"); - - sc = touch_screen_init(); - app_assert_status(sc); - app_log("\rTouch Screen Init done\n"); - - glib_init(&g_context); - app_assert_status(sc); - app_log("\rGLIB Init done\n"); - g_context.bg_color = ILI9341_BLACK; - g_context.textsize_x = 2; - g_context.textsize_y = 2; - g_context.text_color = ILI9341_WHITE; - g_context.wrap = false; - - glib_set_rotation(&g_context, rotation); - - draw_main_screen(); -} - -/***************************************************************************//** - * App ticking function. - ******************************************************************************/ -void app_process_action(void) -{ - touch_screen_get_point(200, &point); - int temp; - switch (rotation) { - case 1: - temp = point.x; - point.x = point.y; - point.y = g_context.height - temp; - break; - case 2: - point.x = g_context.width - point.x; - point.y = g_context.height - point.y; - break; - case 3: - temp = point.x; - point.x = g_context.width - point.y; - point.y = g_context.height - temp; - break; - default: - break; - } - if (point.z < PRESSURE_THRESH) { - if ((point.y >= (g_context.height - 30)) && (point.x < 240)) { - if ((point.x >= 0) && (point.x < 30)) { - color = ILI9341_YELLOW; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } else if ((point.x >= 30) && (point.x < 60)) { - color = ILI9341_BLUE; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } else if ((point.x >= 60) && (point.x < 90)) { - color = ILI9341_GREEN; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } else if ((point.x >= 90) && (point.x < 120)) { - color = ILI9341_RED; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } else if ((point.x >= 120) && (point.x < 150)) { - color = ILI9341_WHITE; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } else if ((point.x >= 150) && (point.x < 180)) { - color = ILI9341_PINK; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } else if ((point.x >= 180) && (point.x < 210)) { - color = ILI9341_PURPLE; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } else if ((point.x >= 210) && (point.x < 240)) { - color = ILI9341_ORANGE; - glib_fill_rect(&g_context, 0, 0, 10, 10, color); - } - } else if ((point.x >= (g_context.width - 40)) && (point.y < 25)) { - draw_main_screen(); - } else { - glib_draw_pixel(&g_context, point.x, point.y, color); - } - } -} diff --git a/app/example/adafruit_tft_lcd_ili9341/app_calib_screen.c b/app/example/adafruit_tft_lcd_ili9341/app_calib_screen.c new file mode 100644 index 00000000..56c82b6e --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341/app_calib_screen.c @@ -0,0 +1,82 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "glib.h" +#include "adafruit_ili9341.h" + +#define Y_OFFSET (40) + +void calib_screen_update( + glib_context_t *g_context, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw) +{ + char string_buf[32]; + + snprintf(string_buf, sizeof(string_buf), "X: %3ld ", x); + glib_draw_string(g_context, string_buf, 0, Y_OFFSET + 20); + snprintf(string_buf, sizeof(string_buf), "X_RAW: %4d ", x_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 20); + + snprintf(string_buf, sizeof(string_buf), "Y: %3ld", y); + glib_draw_string(g_context, string_buf, 0, Y_OFFSET + 40); + snprintf(string_buf, sizeof(string_buf), "Y_RAW: %4d", y_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 40); + + snprintf(string_buf, sizeof(string_buf), "RT: %3ld ", rtouch); + glib_draw_string(g_context, string_buf, 0, Y_OFFSET + 60); + snprintf(string_buf, sizeof(string_buf), "Z1_RAW: %4d ", z1_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 60); + snprintf(string_buf, sizeof(string_buf), "Z2_RAW: %4d ", z2_raw); + glib_draw_string(g_context, string_buf, 95, Y_OFFSET + 80); +} + +void calib_screen_init(glib_context_t *g_context) +{ + glib_fill(g_context, ILI9341_BLACK); + glib_draw_string(g_context, "~TOUCH SCREEN CALIB~", 0, Y_OFFSET); + glib_fill_rect(g_context, 0, 0, 10, 10, + ILI9341_GREEN); + glib_fill_rect(g_context, + g_context->width - 10, + g_context->height - 10, + 10, 10, + ILI9341_YELLOW); + calib_screen_update(g_context, + 0, 0, 0, + 0, 0, 0, 0); +} diff --git a/app/example/adafruit_tft_lcd_ili9341/app_main_screen.c b/app/example/adafruit_tft_lcd_ili9341/app_main_screen.c new file mode 100644 index 00000000..b5f78278 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341/app_main_screen.c @@ -0,0 +1,118 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "glib.h" +#include "adafruit_ili9341.h" + +static uint16_t color = ILI9341_YELLOW; +static uint8_t rotation = 0; + +void main_screen_init(glib_context_t *g_context) +{ + glib_set_rotation(g_context, rotation); + + glib_fill(g_context, ILI9341_BLACK); + glib_fill_rect(g_context, 0, g_context->height - 30, 30, 30, ILI9341_YELLOW); + glib_fill_rect(g_context, 30, g_context->height - 30, 30, 30, ILI9341_BLUE); + glib_fill_rect(g_context, 60, g_context->height - 30, 30, 30, ILI9341_GREEN); + glib_fill_rect(g_context, 90, g_context->height - 30, 30, 30, ILI9341_RED); + glib_fill_rect(g_context, 120, g_context->height - 30, 30, 30, ILI9341_WHITE); + glib_fill_rect(g_context, 150, g_context->height - 30, 30, 30, ILI9341_PINK); + glib_fill_rect(g_context, 180, g_context->height - 30, 30, 30, + ILI9341_PURPLE); + glib_fill_rect(g_context, 210, g_context->height - 30, 30, 30, + ILI9341_ORANGE); + + glib_fill_rect(g_context, 0, 0, 10, 10, color); + glib_draw_string(g_context, "CLR", g_context->width - 37, 5); + glib_draw_rect(g_context, g_context->width - 40, 0, 40, 25, ILI9341_WHITE); +} + +void main_screen_update(glib_context_t *g_context, + int32_t x, int32_t y) +{ + int temp; + switch (rotation) { + case 1: + temp = x; + x = y; + y = g_context->height - temp; + break; + case 2: + x = g_context->width - x; + y = g_context->height - y; + break; + case 3: + temp = x; + x = g_context->width - y; + y = g_context->height - temp; + break; + default: + break; + } + if ((y >= (g_context->height - 30)) && (x < 240)) { + if ((x >= 0) && (x < 30)) { + color = ILI9341_YELLOW; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } else if ((x >= 30) && (x < 60)) { + color = ILI9341_BLUE; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } else if ((x >= 60) && (x < 90)) { + color = ILI9341_GREEN; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } else if ((x >= 90) && (x < 120)) { + color = ILI9341_RED; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } else if ((x >= 120) && (x < 150)) { + color = ILI9341_WHITE; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } else if ((x >= 150) && (x < 180)) { + color = ILI9341_PINK; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } else if ((x >= 180) && (x < 210)) { + color = ILI9341_PURPLE; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } else if ((x >= 210) && (x < 240)) { + color = ILI9341_ORANGE; + glib_fill_rect(g_context, 0, 0, 10, 10, color); + } + } else if ((x >= (g_context->width - 40)) && (y < 25)) { + main_screen_init(g_context); + } else { + glib_draw_pixel(g_context, x, y, color); + } +} diff --git a/app/example/adafruit_tft_lcd_ili9341/gecko/app.c b/app/example/adafruit_tft_lcd_ili9341/gecko/app.c new file mode 100644 index 00000000..205a7222 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341/gecko/app.c @@ -0,0 +1,124 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "app_log.h" +#include "app_assert.h" +#include "adafruit_ili9341.h" +#include "touch_screen.h" +#include "glib.h" +#include "adafruit_ili9341_spi_config.h" + +#define CALIB_ENABLED 0 + +#define PRESSURE_THRESH 500 + +void main_screen_init(glib_context_t *g_context); +void main_screen_update(glib_context_t *g_context, + int32_t x, int32_t y); + +void calib_screen_init(glib_context_t *g_context); +void calib_screen_update( + glib_context_t *g_context, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw); + +struct touch_screen touch_screen; +static touch_point_t point; +static glib_context_t g_context; + +MIPI_DBI_SPI_INTERFACE_DEFINE(ili9341_config, + ADAFRUIT_ILI9341_PERIPHERAL, + ADAFRUIT_ILI9341_PERIPHERAL_NO, + ADAFRUIT_ILI9341_BITRATE, + ADAFRUIT_ILI9341_CLOCK_MODE, + ADAFRUIT_ILI9341_CS_CONTROL, + ADAFRUIT_ILI9341_CLK_PORT, + ADAFRUIT_ILI9341_CLK_PIN, + ADAFRUIT_ILI9341_TX_PORT, + ADAFRUIT_ILI9341_TX_PIN, + ADAFRUIT_ILI9341_RX_PORT, + ADAFRUIT_ILI9341_RX_PIN, + ADAFRUIT_ILI9341_CS_PORT, + ADAFRUIT_ILI9341_CS_PIN, + ADAFRUIT_ILI9341_DC_PORT, + ADAFRUIT_ILI9341_DC_PIN); + +void app_init(void) +{ + sl_status_t sc; + + sc = adafruit_ili9341_init(&ili9341_config); + app_assert_status(sc); + app_log("\rAdafruit ILI9341 Init done\n"); + + sc = touch_screen_init(&touch_screen); + app_assert_status(sc); + app_log("\rTouch Screen Init done\n"); + + glib_init(&g_context); + app_assert_status(sc); + app_log("\rGLIB Init done\n"); + g_context.bg_color = ILI9341_BLACK; + g_context.textsize_x = 2; + g_context.textsize_y = 2; + g_context.text_color = ILI9341_WHITE; + g_context.wrap = false; + +#if CALIB_ENABLED + calib_screen_init(&g_context); +#else + main_screen_init(&g_context); +#endif +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + touch_screen_get_point(&touch_screen, &point); + if (point.r_touch < PRESSURE_THRESH) { +#if CALIB_ENABLED + calib_screen_update(&g_context, + point.x, point.y, point.r_touch, + touch_screen.t_x, touch_screen.t_y, + touch_screen.t_z1, touch_screen.t_z2); +#else + main_screen_update(&g_context, point.x, point.y); +#endif + } +} diff --git a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/app.h b/app/example/adafruit_tft_lcd_ili9341/gecko/app.h similarity index 100% rename from app/example/adafruit_tft_lcd_st7789_lvgl_dma/app.h rename to app/example/adafruit_tft_lcd_ili9341/gecko/app.h diff --git a/app/example/adafruit_tft_lcd_ili9341/si91x/app.c b/app/example/adafruit_tft_lcd_ili9341/si91x/app.c new file mode 100644 index 00000000..fe641f85 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341/si91x/app.c @@ -0,0 +1,126 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "app_assert.h" +#include "adafruit_ili9341.h" +#include "touch_screen.h" +#include "glib.h" +#include "adafruit_ili9341_spi_config.h" + +#define CALIB_ENABLED 0 + +#define PRESSURE_THRESH 500 + +void main_screen_init(glib_context_t *g_context); +void main_screen_update(glib_context_t *g_context, + int32_t x, int32_t y); + +void calib_screen_init(glib_context_t *g_context); +void calib_screen_update( + glib_context_t *g_context, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw); + +static glib_context_t g_context; +static struct touch_screen touch_screen; +static touch_point_t point; + +MIPI_DBI_SPI_INTERFACE_DEFINE(ili9341_config, + ADAFRUIT_ILI9341_BITRATE, + ADAFRUIT_ILI9341_CLOCK_MODE, + ADAFRUIT_ILI9341_CS_CONTROL, + RTE_GSPI_MASTER_CLK_PORT, + RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MOSI_PORT, + RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_CS0_PORT, + RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_4, + ADAFRUIT_ILI9341_DC_PORT, + ADAFRUIT_ILI9341_DC_PIN, + SL_GPIO_MODE_0); + +void app_init(void) +{ + sl_status_t sc; + + sc = adafruit_ili9341_init(&ili9341_config); + app_assert_status(sc); + printf("\rAdafruit ILI9341 Init done\n"); + + sc = touch_screen_init(&touch_screen); + app_assert_status(sc); + printf("\rTouch Screen Init done\n"); + + glib_init(&g_context); + app_assert_status(sc); + printf("\rGLIB Init done\n"); + g_context.bg_color = ILI9341_BLACK; + g_context.textsize_x = 2; + g_context.textsize_y = 2; + g_context.text_color = ILI9341_WHITE; + g_context.wrap = false; + +#if CALIB_ENABLED + calib_screen_init(&g_context); +#else + main_screen_init(&g_context); +#endif +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + touch_screen_get_point(&touch_screen, &point); + if (point.r_touch < PRESSURE_THRESH) { +#if CALIB_ENABLED + calib_screen_update(&g_context, + point.x, point.y, point.r_touch, + touch_screen.t_x, touch_screen.t_y, + touch_screen.t_z1, touch_screen.t_z2); +#else + main_screen_update(&g_context, point.x, point.y); +#endif + } +} diff --git a/app/example/adafruit_touchscreen_tsc2007/app.h b/app/example/adafruit_tft_lcd_ili9341/si91x/app.h similarity index 100% rename from app/example/adafruit_touchscreen_tsc2007/app.h rename to app/example/adafruit_tft_lcd_ili9341/si91x/app.h diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp index 2c8aa5bf..10dadc3f 100644 --- a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl.slcp @@ -18,7 +18,7 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md source: -- path: app.c +- path: gecko/app.c - path: main.c - path: app_ui/brd2703a/single_buffer_without_dma/ui_events.c condition: [brd2703a] @@ -54,7 +54,7 @@ source: condition: [brd2704a] include: -- path: '' +- path: 'gecko' file_list: - path: app.h - path: app_ui/brd2703a/single_buffer_without_dma @@ -74,6 +74,7 @@ component: - id: sl_system - id: device_init - id: sleeptimer +- id: udelay - id: simple_led instance: [led0] - id: adafruit_tft_lcd_ili9341 @@ -82,13 +83,15 @@ component: from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 configuration: - name: LV_BUFFER_MODE @@ -100,16 +103,20 @@ configuration: - name: LV_INPUT_TYPE value: "LV_INPUT_TYPE_POINTER" other_file: - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/create_example.png - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffered_lvgl_settings.png - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffered_lvgl_settings.png - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffer_lvgl.gif - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffer_lvgl.gif - directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/create_example.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi_dma.png + directory: "image" ui_hints: highlight: diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp index 15f43cf9..341990f5 100644 --- a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma.slcp @@ -18,7 +18,7 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md source: -- path: app.c +- path: gecko/app.c - path: main.c - path: app_ui/brd2703a/double_buffered_dma/ui_events.c - path: app_ui/brd2703a/double_buffered_dma/ui_helpers.c @@ -30,7 +30,7 @@ source: - path: app_ui/brd2703a/double_buffered_dma/screens/ui_main.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h - path: app_ui/brd2703a/double_buffered_dma @@ -43,8 +43,7 @@ component: - id: sl_system - id: device_init - id: sleeptimer -- id: spidrv - instance: [ili9341] +- id: udelay - id: simple_led instance: [led0, led1] - id: simple_button @@ -55,12 +54,14 @@ component: from: third_party_hw_drivers - id: touch_screen_analog from: third_party_hw_drivers +- id: touch_screen_analog_gecko + from: third_party_hw_drivers define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 configuration: - name: LV_BUFFER_MODE @@ -72,16 +73,20 @@ configuration: - name: LV_INPUT_TYPE value: "LV_INPUT_TYPE_POINTER" other_file: - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/create_example.png - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffered_lvgl_settings.png - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffered_lvgl_settings.png - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffer_lvgl.gif - directory: "image" - - path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffer_lvgl.gif - directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/create_example.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi_dma.png + directory: "image" ui_hints: highlight: diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma_si91x.slcp b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma_si91x.slcp new file mode 100644 index 00000000..a3903e08 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_dma_si91x.slcp @@ -0,0 +1,110 @@ +project_name: adafruit_tft_lcd_ili9341_lvgl_dma_si91x +package: platform +label: Third Party Hardware Drivers - ILI9341 - TFT LCD with Touchscreen (Adafruit) with LVGL +description: | + This examples shows an example for integrating the ILI9341 display with the LVGL library using the single buffer mode without DMA. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md + +source: +- path: si91x/app.c +- path: main.c +- path: app_ui/brd4338a/double_buffered_dma/ui_events.c +- path: app_ui/brd4338a/double_buffered_dma/ui_helpers.c +- path: app_ui/brd4338a/double_buffered_dma/ui.c +- path: app_ui/brd4338a/double_buffered_dma/components/ui_comp_hook.c +- path: app_ui/brd4338a/double_buffered_dma/images/ui_img_1802009198.c +- path: app_ui/brd4338a/double_buffered_dma/images/ui_img_2106501360.c +- path: app_ui/brd4338a/double_buffered_dma/screens/ui_loader.c +- path: app_ui/brd4338a/double_buffered_dma/screens/ui_main.c + +include: +- path: 'si91x' + file_list: + - path: app.h +- path: app_ui/brd4338a/double_buffered_dma + file_list: + - path: ui_events.h + - path: ui_helpers.h + - path: ui.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: sl_si91x_button_917 + instance: [btn0, btn1] + from: wiseconnect3_sdk +- id: sl_si91x_led_917 + instance: [led0, led1] + from: wiseconnect3_sdk +- id: adafruit_tft_lcd_ili9341_dma + from: third_party_hw_drivers +- id: services_lvgl + from: third_party_hw_drivers +- id: touch_screen_analog + from: third_party_hw_drivers +- id: touch_screen_analog_si91x + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +configuration: +- name: SL_GSPI_DMA_CONFIG_ENABLE + value: "1" +- name: LV_BUFFER_MODE + value: "1" +- name: LV_DISPLAY_ROTATION + value: "LV_DISP_ROT_90" +- name: LV_ENABLE_SOFTWARE_ROTATION + value: "1" +- name: LV_INPUT_TYPE + value: "LV_INPUT_TYPE_POINTER" +- name: "GSPI_UC" + value: "0" + +other_file: +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/create_example.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi_dma.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_si91x.slcp b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_si91x.slcp new file mode 100644 index 00000000..76fffe84 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/adafruit_tft_lcd_ili9341_lvgl_si91x.slcp @@ -0,0 +1,108 @@ +project_name: adafruit_tft_lcd_ili9341_lvgl_si91x +package: platform +label: Third Party Hardware Drivers - ILI9341 - TFT LCD with Touchscreen (Adafruit) with LVGL +description: | + This examples shows an example for integrating the ILI9341 display with the LVGL library using the single buffer mode without DMA. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/README.md + +source: +- path: si91x/app.c +- path: main.c +- path: app_ui/brd4338a/single_buffer_without_dma/ui_events.c +- path: app_ui/brd4338a/single_buffer_without_dma/ui_helpers.c +- path: app_ui/brd4338a/single_buffer_without_dma/ui.c +- path: app_ui/brd4338a/single_buffer_without_dma/components/ui_comp_hook.c +- path: app_ui/brd4338a/single_buffer_without_dma/images/ui_img_1802009198.c +- path: app_ui/brd4338a/single_buffer_without_dma/images/ui_img_2106501360.c +- path: app_ui/brd4338a/single_buffer_without_dma/screens/ui_loader.c +- path: app_ui/brd4338a/single_buffer_without_dma/screens/ui_main.c + +include: +- path: 'si91x' + file_list: + - path: app.h +- path: app_ui/brd4338a/single_buffer_without_dma + file_list: + - path: ui_events.h + - path: ui_helpers.h + - path: ui.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: sl_si91x_button_917 + instance: [btn0, btn1] + from: wiseconnect3_sdk +- id: sl_si91x_led_917 + instance: [led0, led1] + from: wiseconnect3_sdk +- id: adafruit_tft_lcd_ili9341 + from: third_party_hw_drivers +- id: services_lvgl + from: third_party_hw_drivers +- id: touch_screen_analog + from: third_party_hw_drivers +- id: touch_screen_analog_si91x + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +configuration: +- name: LV_BUFFER_MODE + value: "0" +- name: LV_DISPLAY_ROTATION + value: "LV_DISP_ROT_90" +- name: LV_ENABLE_SOFTWARE_ROTATION + value: "1" +- name: LV_INPUT_TYPE + value: "LV_INPUT_TYPE_POINTER" +- name: "GSPI_UC" + value: "0" + +other_file: +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/create_example.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffered_lvgl_settings.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/double_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/single_buffer_lvgl.gif + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi.png + directory: "image" +- path: ../../documentation/example/adafruit_tft_lcd_ili9341_lvgl/image/gspi_dma.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/CMakeLists.txt b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/CMakeLists.txt new file mode 100644 index 00000000..6a69b407 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/CMakeLists.txt @@ -0,0 +1,9 @@ +SET(SOURCES screens/ui_loader.c + screens/ui_main.c + ui.c + components/ui_comp_hook.c + ui_helpers.c + images/ui_img_2106501360.c + images/ui_img_1802009198.c) + +add_library(ui ${SOURCES}) diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/components/ui_comp_hook.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/components/ui_comp_hook.c new file mode 100644 index 00000000..45656b41 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/components/ui_comp_hook.c @@ -0,0 +1,4 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/filelist.txt b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/filelist.txt new file mode 100644 index 00000000..62c979d6 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/filelist.txt @@ -0,0 +1,7 @@ +screens/ui_loader.c +screens/ui_main.c +ui.c +components/ui_comp_hook.c +ui_helpers.c +images/ui_img_2106501360.c +images/ui_img_1802009198.c diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/images/ui_img_1802009198.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/images/ui_img_1802009198.c new file mode 100644 index 00000000..2b184ad5 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/images/ui_img_1802009198.c @@ -0,0 +1,778 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +// IMAGE DATA: assets\silabs-logo.png +const LV_ATTRIBUTE_MEM_ALIGN uint8_t ui_img_1802009198_data[] = { + 0x00, 0x00, 0x59, 0x00, 0x00, 0x98, 0x00, 0x00, 0x95, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x95, 0x00, 0x00, 0x95, 0x00, 0x00, 0x9B, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x10, + 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x18, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, + 0x20, 0x20, 0xFF, 0x41, 0x28, 0xFF, 0x41, 0x28, 0xFF, 0x41, 0x28, 0xFF, 0x21, + 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x18, 0xFF, 0x00, 0x30, 0xFF, 0x00, 0x48, 0xFF, 0x21, 0x58, 0xFF, 0x21, + 0x68, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x68, + 0xFF, 0x21, 0x58, 0xFF, 0x20, 0x40, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x38, 0xFF, 0x41, 0x68, 0xFF, 0x20, 0x38, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x21, 0x38, + 0xFF, 0x41, 0x48, 0xFF, 0x41, 0x48, 0xFF, 0x41, 0x38, 0xFF, + 0x20, 0x20, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x30, + 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xB0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xE0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x21, 0xB8, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x70, 0xFF, 0x20, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, + 0xFF, 0x21, 0x68, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x88, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, + 0x48, 0xFF, 0x21, 0x70, 0xFF, 0x41, 0x70, 0xFF, 0x21, 0x50, 0xFF, 0x20, 0x28, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, + 0x50, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0xC0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xB0, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x21, 0xC0, + 0xFF, 0x02, 0xE8, 0xFF, 0x21, 0xB8, 0xFF, 0x20, 0x40, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, + 0x21, 0x70, 0xFF, 0x42, 0xA0, 0xFF, 0x42, 0x90, 0xFF, 0x21, 0x50, 0xFF, 0x00, + 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x21, 0x50, 0xFF, 0x21, 0xA8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xE8, + 0xFF, 0x41, 0x78, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x22, 0xC0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, + 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x40, + 0xFF, 0x21, 0x88, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xB0, 0xFF, 0x21, 0x58, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x20, 0xFF, 0x21, 0x90, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xA8, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x21, + 0xA0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, + 0xFF, 0x42, 0x98, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, + 0x48, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xE0, 0xFF, 0x21, 0x80, + 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0xB0, 0xFF, 0x01, 0xE0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, + 0xB8, 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x30, 0xFF, + 0x21, 0x70, 0xFF, 0x21, 0xB8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xC0, 0xFF, 0x20, 0x28, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x38, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xE0, 0xFF, 0x21, 0x70, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x41, + 0x98, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xC8, 0xFF, 0x01, + 0xB8, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x68, + 0xFF, 0x22, 0xA0, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x21, 0xC8, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x18, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0x90, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x20, 0xFF, 0x21, 0xC8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xB8, + 0xFF, 0x21, 0xA8, 0xFF, 0x01, 0x90, 0xFF, 0x21, 0x80, 0xFF, 0x21, 0x70, 0xFF, + 0x20, 0x60, 0xFF, 0x20, 0x50, 0xFF, 0x21, 0x48, 0xFF, 0x20, 0x40, 0xFF, 0x20, + 0x40, 0xFF, 0x00, 0x40, 0xFF, 0x00, 0x40, 0xFF, 0x00, 0x40, 0xFF, 0x21, 0x48, + 0xFF, 0x21, 0x50, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x80, 0xFF, + 0x21, 0x98, 0xFF, 0x21, 0xB8, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xE8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xA8, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x22, 0xB0, 0xFF, 0x01, 0xE0, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x21, 0x48, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x10, 0xFF, 0x22, 0x98, 0xFF, 0x01, 0xE8, 0xFF, 0x21, 0xB0, 0xFF, 0x21, + 0x58, 0xFF, 0x20, 0x28, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x10, 0xFF, + 0x20, 0x30, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xC8, 0xFF, 0x01, + 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x22, 0xD8, 0xFF, 0x21, 0x58, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, + 0x58, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0x60, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, + 0x21, 0x90, 0xFF, 0x21, 0xC0, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0x60, 0xFF, 0x00, + 0x40, 0xFF, 0x00, 0x38, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x28, 0xFF, 0x20, 0x20, + 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x42, 0x90, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xB8, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x38, 0xFF, + 0x21, 0x80, 0xFF, 0x21, 0xA0, 0xFF, 0x42, 0xA8, 0xFF, 0x41, 0xA8, 0xFF, 0x21, + 0xA8, 0xFF, 0x21, 0xA0, 0xFF, 0x42, 0xA0, 0xFF, 0x42, 0xA8, 0xFF, 0x42, 0xA8, + 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x90, 0xFF, 0x41, 0x70, 0xFF, 0x20, 0x40, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, + 0xFF, 0x22, 0xA0, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x22, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x22, 0xC0, 0xFF, 0x21, 0x68, 0xFF, 0x20, 0x20, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x18, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x30, 0xFF, 0x00, + 0x30, 0xFF, 0x00, 0x38, 0xFF, 0x20, 0x40, 0xFF, 0x00, 0x48, 0xFF, 0x21, 0x58, + 0xFF, 0x41, 0x80, 0xFF, 0x42, 0xB8, 0xFF, 0x21, 0xA8, 0xFF, + 0x21, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x38, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x21, 0xE0, 0xFF, 0x21, 0x90, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, + 0xFF, 0x22, 0xA8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xE0, + 0xFF, 0x21, 0xB8, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x30, 0xFF, + 0x00, 0x18, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x18, 0xFF, 0x20, 0x20, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x48, 0xFF, 0x21, 0x68, + 0xFF, 0x01, 0xB8, 0xFF, 0x01, 0xE8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x38, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x38, 0xFF, 0x21, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x68, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x48, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE8, 0xFF, 0x01, 0xF0, + 0xFF, 0x01, 0xE0, 0xFF, 0x02, 0xD0, 0xFF, 0x22, 0xB0, 0xFF, + 0x21, 0x98, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x70, 0xFF, 0x21, + 0x68, 0xFF, 0x21, 0x68, 0xFF, 0x20, 0x68, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x68, + 0xFF, 0x21, 0x68, 0xFF, 0x41, 0x70, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x88, 0xFF, + 0x21, 0x98, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0xB0, 0xFF, 0x21, 0xC0, 0xFF, 0x21, + 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x21, 0xE8, 0xFF, 0x41, 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x21, 0x90, 0xFF, 0x01, 0xE8, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0x98, 0xFF, + 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, + 0x68, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD8, 0xFF, 0x41, 0xA0, 0xFF, 0x21, + 0x50, 0xFF, 0x00, 0x40, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xB0, + 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x38, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x88, 0xFF, 0x22, 0xE0, 0xFF, 0x21, 0xA8, + 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x58, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xC0, 0xFF, + 0x41, 0x60, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, 0xFF, 0x21, 0x60, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, + 0xC8, 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x30, 0xFF, 0x42, 0x90, 0xFF, 0x42, + 0xB0, 0xFF, 0x21, 0x60, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x21, 0xB8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x22, 0xA0, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x18, 0xFF, 0x22, 0xA8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, + 0x22, 0xD8, 0xFF, 0x41, 0xA0, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, 0xFF, + 0x41, 0x48, 0xFF, 0x62, 0x78, 0xFF, 0x21, 0x58, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x21, 0x48, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xA0, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x22, 0xC0, 0xFF, 0x01, + 0xE8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, + 0xFF, 0x21, 0xC0, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0x50, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x10, + 0xFF, 0x41, 0x28, 0xFF, 0x41, 0x38, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x48, 0xFF, + 0x21, 0xC0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x20, + 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0xC0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, + 0xD0, 0xFF, 0x22, 0xB8, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0x60, 0xFF, 0x20, 0x30, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x80, 0xFF, + 0x21, 0xC0, 0xFF, 0x21, 0xE0, 0xFF, 0x21, 0x98, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x50, 0xFF, 0x21, + 0x78, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xA0, 0xFF, 0x01, 0xA8, 0xFF, 0x01, 0xA8, + 0xFF, 0x01, 0xA8, 0xFF, 0x01, 0xA0, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0x88, 0xFF, + 0x21, 0x70, 0xFF, 0x20, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x28, 0xFF, + 0x21, 0x68, 0xFF, 0x21, 0xA0, 0xFF, 0x41, 0x80, 0xFF, 0x41, 0x38, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x20, 0x30, 0xFF, 0x41, 0x40, 0xFF, 0x41, 0x30, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x04, 0x21, 0xFF, 0x51, 0x8C, 0xFF, 0x34, 0xA5, 0xFF, 0xB2, + 0x94, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xCF, 0x7B, + 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x2C, 0x63, 0xFF, + 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x2C, + 0x63, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0xD3, 0x9C, + 0xFF, 0x14, 0xA5, 0xFF, 0xCF, 0x7B, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, + 0xE7, 0x39, 0xFF, 0xB2, 0x94, 0xFF, 0x14, 0xA5, 0xFF, 0xEF, 0x7B, 0xFF, 0xA2, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0x8A, 0x52, 0xFF, 0x20, 0x00, + 0xFF, 0x4D, 0x6B, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x24, 0x21, 0xFF, 0xAE, 0x73, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, + 0xEF, 0x7B, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, + 0x42, 0xFF, 0xD3, 0x9C, 0xFF, 0xF3, 0x9C, 0xFF, 0x92, 0x94, 0xFF, 0x86, 0x31, + 0xFF, 0x00, 0x00, 0xFF, 0x49, 0x4A, 0xFF, 0xD3, 0x9C, 0xFF, 0x14, 0xA5, 0xFF, + 0xEF, 0x7B, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x10, 0x84, 0xFF, + 0x18, 0xC6, 0xFF, 0x8E, 0x73, 0xFF, 0x38, 0xC6, 0xFF, 0xB2, 0x94, 0xFF, 0x00, + 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x79, 0xCE, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, + 0xFF, 0xEF, 0x7B, 0xFF, 0x75, 0xAD, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x96, 0xB5, 0xFF, 0x20, 0x00, 0xFF, 0x41, + 0x08, 0xFF, 0xB6, 0xB5, 0xFF, 0x96, 0xB5, 0xFF, 0x30, 0x84, 0xFF, 0xBA, 0xD6, + 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, 0x75, 0xAD, 0xFF, + 0xD7, 0xBD, 0xFF, 0x10, 0x84, 0xFF, 0x9A, 0xD6, 0xFF, 0xAA, 0x52, 0xFF, 0x00, + 0x00, 0xFF, 0x96, 0xB5, 0xFF, 0x38, 0xC6, 0xFF, 0xC3, 0x18, 0xFF, 0x75, 0xAD, + 0xFF, 0xEF, 0x7B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x59, + 0xCE, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x51, 0x8C, 0xFF, 0xDF, 0xFF, 0xFF, 0xC7, 0x39, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xEF, 0x7B, 0xFF, 0x9A, 0xD6, 0xFF, 0xCF, + 0x7B, 0xFF, 0xF7, 0xBD, 0xFF, 0xB2, 0x94, 0xFF, 0x82, 0x10, 0xFF, 0xB6, 0xB5, + 0xFF, 0x14, 0xA5, 0xFF, 0x10, 0x84, 0xFF, 0xDB, 0xDE, 0xFF, 0x69, 0x4A, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0xB6, 0xB5, 0xFF, 0x61, 0x08, 0xFF, + 0xE3, 0x18, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x18, + 0xC6, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0x14, 0xA5, + 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x2C, 0x63, 0xFF, 0x34, 0xA5, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xF7, + 0xBD, 0xFF, 0xAA, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0xE3, 0x18, + 0xFF, 0x61, 0x08, 0xFF, 0xB6, 0xB5, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, + 0x55, 0xAD, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0xBE, + 0xF7, 0xFF, 0x8A, 0x52, 0xFF, 0xD3, 0x9C, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, 0xF7, 0xBD, 0xFF, 0x65, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x55, 0xAD, + 0xFF, 0x1C, 0xE7, 0xFF, 0x4D, 0x6B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x10, 0x84, 0xFF, 0x71, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x34, + 0xA5, 0xFF, 0xC3, 0x18, 0xFF, 0xF7, 0xBD, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, + 0xFF, 0xA6, 0x31, 0xFF, 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x86, 0x31, + 0xFF, 0x96, 0xB5, 0xFF, 0x59, 0xCE, 0xFF, 0x0C, 0x63, 0xFF, + 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x18, 0xC6, 0xFF, 0x28, + 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0x14, 0xA5, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x2C, 0x63, 0xFF, 0x34, 0xA5, 0xFF, + 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xD7, 0xBD, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x96, 0xB5, + 0xFF, 0x2C, 0x63, 0xFF, 0x20, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0x0C, 0x63, 0xFF, + 0x00, 0x00, 0xFF, 0x92, 0x94, 0xFF, 0x1C, 0xE7, 0xFF, 0x14, 0xA5, 0xFF, 0x34, + 0xA5, 0xFF, 0x8E, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, + 0xD7, 0xBD, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x14, 0xA5, 0xFF, 0xCF, 0x7B, 0xFF, 0xF3, 0x9C, + 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0x59, 0xCE, 0xFF, + 0x30, 0x84, 0xFF, 0x75, 0xAD, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x0C, + 0x63, 0xFF, 0x9A, 0xD6, 0xFF, 0x75, 0xAD, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, + 0xFF, 0x6D, 0x6B, 0xFF, 0xBA, 0xD6, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, 0xFF, + 0x24, 0x21, 0xFF, 0x18, 0xC6, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, + 0x73, 0xFF, 0x14, 0xA5, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x2C, 0x63, 0xFF, 0x34, 0xA5, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, + 0xD7, 0xBD, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x96, 0xB5, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, + 0xFF, 0x55, 0xAD, 0xFF, 0x0C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0xB2, 0x94, 0xFF, + 0x92, 0x94, 0xFF, 0xB6, 0xB5, 0xFF, 0xFB, 0xDE, 0xFF, 0x2C, 0x63, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, 0xD7, 0xBD, 0xFF, 0x65, 0x29, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0x55, + 0xAD, 0xFF, 0xCB, 0x5A, 0xFF, 0xF7, 0xBD, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, + 0xFF, 0xAE, 0x73, 0xFF, 0x59, 0xCE, 0xFF, 0x30, 0x84, 0xFF, + 0x75, 0xAD, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x65, + 0x29, 0xFF, 0x14, 0xA5, 0xFF, 0x79, 0xCE, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x49, 0x4A, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x10, 0x84, + 0xFF, 0x14, 0xA5, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x18, 0xC6, 0xFF, + 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xF3, 0x9C, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0x34, 0xA5, + 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x18, 0xC6, 0xFF, 0x8A, 0x52, 0xFF, + 0x00, 0x00, 0xFF, 0xEB, 0x5A, 0xFF, 0x86, 0x31, 0xFF, 0x41, 0x08, 0xFF, 0xB6, + 0xB5, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0x2C, 0x63, + 0xFF, 0x00, 0x00, 0xFF, 0x14, 0xA5, 0xFF, 0x4D, 0x6B, 0xFF, 0xEF, 0x7B, 0xFF, + 0xFF, 0xFF, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, + 0xFF, 0xD7, 0xBD, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0xDB, 0xDE, 0xFF, 0xD7, + 0xBD, 0xFF, 0xDB, 0xDE, 0xFF, 0x8A, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x10, 0x84, + 0xFF, 0x71, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x55, 0xAD, 0xFF, + 0x82, 0x10, 0xFF, 0xCB, 0x5A, 0xFF, 0xC3, 0x18, 0xFF, 0x20, 0x00, 0xFF, 0xF7, + 0xBD, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x51, 0x8C, 0xFF, 0x9A, + 0xD6, 0xFF, 0xCF, 0x7B, 0xFF, 0xF7, 0xBD, 0xFF, 0x71, 0x8C, 0xFF, 0x00, 0x00, + 0xFF, 0x45, 0x29, 0xFF, 0x79, 0xCE, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, + 0xAE, 0x73, 0xFF, 0xBA, 0xD6, 0xFF, 0x30, 0x84, 0xFF, 0x10, 0x84, 0xFF, 0xE3, + 0x18, 0xFF, 0x2C, 0x63, 0xFF, 0x96, 0xB5, 0xFF, 0x20, 0x00, 0xFF, 0x61, 0x08, + 0xFF, 0xB6, 0xB5, 0xFF, 0x96, 0xB5, 0xFF, 0x10, 0x84, 0xFF, 0xFB, 0xDE, 0xFF, + 0xAA, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0xB6, 0xB5, 0xFF, 0xEF, + 0x7B, 0xFF, 0x9A, 0xD6, 0xFF, 0xAA, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x96, 0xB5, + 0xFF, 0x8E, 0x73, 0xFF, 0x65, 0x29, 0xFF, 0x7D, 0xEF, 0xFF, + 0xAE, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xBA, 0xD6, + 0xFF, 0xD3, 0x9C, 0xFF, 0x30, 0x84, 0xFF, 0xE7, 0x39, 0xFF, 0x24, 0x21, 0xFF, + 0x38, 0xC6, 0xFF, 0x0C, 0x63, 0xFF, 0x65, 0x29, 0xFF, 0x55, 0xAD, 0xFF, 0xD3, + 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0xCF, 0x7B, 0xFF, 0x79, 0xCE, 0xFF, 0xCF, 0x7B, + 0xFF, 0xF7, 0xBD, 0xFF, 0xB2, 0x94, 0xFF, 0xA2, 0x10, 0xFF, 0xF7, 0xBD, 0xFF, + 0x55, 0xAD, 0xFF, 0x10, 0x84, 0xFF, 0x79, 0xCE, 0xFF, 0x49, 0x4A, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x45, 0x29, 0xFF, 0x51, 0x8C, 0xFF, 0x14, 0xA5, 0xFF, 0x92, + 0x94, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xAE, 0x73, + 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0xB2, 0x94, 0xFF, + 0xF3, 0x9C, 0xFF, 0xD3, 0x9C, 0xFF, 0x24, 0x21, 0xFF, 0xA6, 0x31, 0xFF, 0x2C, + 0x63, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0xD3, 0x9C, + 0xFF, 0x14, 0xA5, 0xFF, 0xCF, 0x7B, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0xB2, 0x94, 0xFF, 0x14, 0xA5, 0xFF, 0xEF, + 0x7B, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x2C, 0x63, 0xFF, 0x28, 0x42, + 0xFF, 0x20, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x10, 0x84, 0xFF, 0xF3, 0x9C, 0xFF, 0x14, 0xA5, + 0xFF, 0x49, 0x4A, 0xFF, 0x45, 0x29, 0xFF, 0x8E, 0x73, 0xFF, 0x61, 0x08, 0xFF, + 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x6D, 0x6B, 0xFF, 0x20, 0x00, 0xFF, 0xE7, + 0x39, 0xFF, 0xB2, 0x94, 0xFF, 0xF3, 0x9C, 0xFF, 0x92, 0x94, 0xFF, 0xA6, 0x31, + 0xFF, 0x00, 0x00, 0xFF, 0x8A, 0x52, 0xFF, 0xF3, 0x9C, 0xFF, 0xF3, 0x9C, 0xFF, + 0x8E, 0x73, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x95, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0x96, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, +}; +const lv_img_dsc_t ui_img_1802009198 = { + .header.always_zero = 0, + .header.w = 75, + .header.h = 43, + .data_size = sizeof(ui_img_1802009198_data), + .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, + .data = ui_img_1802009198_data +}; diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/images/ui_img_2106501360.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/images/ui_img_2106501360.c new file mode 100644 index 00000000..b38ba0c1 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/images/ui_img_2106501360.c @@ -0,0 +1,2409 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +// IMAGE DATA: assets\silabs-logo-large.png +const LV_ATTRIBUTE_MEM_ALIGN uint8_t ui_img_2106501360_data[] = { + 0x00, 0x00, 0x73, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xB7, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x01, 0x10, 0xFF, 0x00, 0x10, + 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x18, 0xFF, 0x41, 0x20, + 0xFF, 0x21, 0x28, 0xFF, 0x21, 0x28, 0xFF, 0x21, 0x20, 0xFF, 0x20, 0x18, 0xFF, + 0x01, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x41, 0x30, 0xFF, 0x20, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, + 0xFF, 0x41, 0x30, 0xFF, 0x62, 0x40, 0xFF, 0x62, 0x40, 0xFF, 0x82, 0x38, 0xFF, + 0x41, 0x28, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x28, 0xFF, 0x20, 0x40, 0xFF, 0x21, 0x50, + 0xFF, 0x21, 0x60, 0xFF, 0x42, 0x68, 0xFF, 0x41, 0x68, 0xFF, 0x41, 0x68, 0xFF, + 0x41, 0x68, 0xFF, 0x41, 0x68, 0xFF, 0x42, 0x60, 0xFF, 0x21, 0x50, 0xFF, 0x20, + 0x40, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, + 0x28, 0xFF, 0x82, 0x68, 0xFF, 0x42, 0x78, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x41, 0x38, 0xFF, 0x62, 0x58, 0xFF, + 0x62, 0x58, 0xFF, 0x82, 0x48, 0xFF, 0x61, 0x38, 0xFF, 0x21, 0x20, 0xFF, 0x20, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0x40, 0xFF, 0x41, 0x68, + 0xFF, 0x42, 0x88, 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0xB8, 0xFF, 0x02, 0xC0, 0xFF, + 0x22, 0xC8, 0xFF, 0x21, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x21, 0xD0, 0xFF, 0x21, + 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x02, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x42, 0xC0, 0xFF, 0x42, 0xB8, 0xFF, 0x21, 0xB0, 0xFF, + 0x21, 0x98, 0xFF, 0x61, 0x78, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x30, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x22, 0x88, 0xFF, + 0x43, 0xC0, 0xFF, 0x41, 0x98, 0xFF, 0x41, 0x50, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, + 0x20, 0x30, 0xFF, 0x41, 0x58, 0xFF, 0x82, 0x70, 0xFF, 0x83, 0x70, 0xFF, 0x62, + 0x58, 0xFF, 0x41, 0x38, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, + 0xFF, 0x21, 0x40, 0xFF, 0x21, 0x70, 0xFF, 0x42, 0x98, 0xFF, 0x42, 0xB8, 0xFF, + 0x22, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0x70, 0xFF, + 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x22, 0xA0, 0xFF, 0x01, 0xE0, 0xFF, 0x42, 0xD0, + 0xFF, 0x63, 0x90, 0xFF, 0x21, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x40, 0xFF, 0x21, + 0x70, 0xFF, 0x42, 0x98, 0xFF, 0x82, 0x90, 0xFF, 0x62, 0x68, 0xFF, 0x20, 0x38, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x38, 0xFF, + 0x21, 0x70, 0xFF, 0x42, 0xA8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x02, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0xB0, 0xFF, 0x21, 0x58, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x50, 0xFF, + 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, + 0x70, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x38, 0xFF, 0x01, 0x78, 0xFF, 0x42, 0xA8, + 0xFF, 0x62, 0xB0, 0xFF, 0x62, 0x88, 0xFF, 0x21, 0x48, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x58, 0xFF, 0x22, + 0x98, 0xFF, 0x22, 0xC0, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x43, 0xC0, 0xFF, 0x41, 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x38, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x42, 0xD0, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x70, 0xFF, 0x42, 0xA0, 0xFF, 0x63, 0xC8, 0xFF, + 0x63, 0xC0, 0xFF, 0x42, 0x78, 0xFF, 0x20, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x41, 0x58, 0xFF, 0x42, 0xA8, + 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x62, 0xA0, 0xFF, 0x00, 0x10, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x58, 0xFF, 0x02, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x22, + 0xD8, 0xFF, 0x42, 0x98, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, + 0x21, 0x48, 0xFF, 0x42, 0x90, 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xD8, 0xFF, 0x42, + 0xC0, 0xFF, 0x41, 0x78, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x42, 0xA0, 0xFF, + 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD8, 0xFF, + 0x62, 0xA8, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x41, + 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0x80, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x41, + 0x68, 0xFF, 0x41, 0xA8, 0xFF, 0x22, 0xD0, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xC8, + 0xFF, 0x41, 0x78, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x42, 0x78, 0xFF, 0x22, + 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x00, 0xC8, 0xFF, 0x00, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x23, 0xC8, 0xFF, 0x42, 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, + 0xFF, 0x42, 0x80, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x62, 0xC0, 0xFF, 0x41, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x38, 0xFF, 0x41, 0x80, + 0xFF, 0x22, 0xC0, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x42, 0xD8, 0xFF, + 0x41, 0x98, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x38, 0xFF, 0x62, 0xA8, + 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x42, 0xA0, 0xFF, 0x21, 0x40, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x30, 0xFF, 0x41, 0x90, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x62, 0x78, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x21, 0x90, 0xFF, + 0x42, 0xC8, 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x42, + 0xC8, 0xFF, 0x41, 0x70, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x40, 0xFF, 0x62, 0xB0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x41, 0xA0, 0xFF, 0x20, 0x38, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, + 0x40, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0xC0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x22, 0x90, 0xFF, 0x22, + 0xC0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x60, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, 0xA8, 0xFF, 0x02, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xC0, + 0xFF, 0x42, 0xA8, 0xFF, 0x42, 0x98, 0xFF, 0x21, 0x80, 0xFF, 0x41, 0x68, 0xFF, + 0x41, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x21, 0x48, 0xFF, 0x21, 0x80, + 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x62, 0xA8, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x42, 0x88, 0xFF, 0x22, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x60, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x62, 0x70, 0xFF, 0x42, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x02, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x41, 0xC8, 0xFF, 0x42, 0xC0, 0xFF, 0x22, 0xB8, + 0xFF, 0x42, 0xA8, 0xFF, 0x41, 0x90, 0xFF, 0x41, 0x88, 0xFF, + 0x22, 0xB0, 0xFF, 0x22, 0xC8, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x41, 0x70, 0xFF, 0x22, 0xC0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x42, 0x78, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x61, + 0xA0, 0xFF, 0x00, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x02, + 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xB8, + 0xFF, 0x21, 0xB0, 0xFF, 0x41, 0xA8, 0xFF, 0x41, 0x98, 0xFF, 0x62, 0x90, 0xFF, + 0x62, 0x88, 0xFF, 0x42, 0x80, 0xFF, 0x41, 0x78, 0xFF, 0x21, 0x78, 0xFF, 0x41, + 0x70, 0xFF, 0x41, 0x70, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x70, + 0xFF, 0x21, 0x78, 0xFF, 0x42, 0x80, 0xFF, 0x42, 0x88, 0xFF, 0x42, 0x88, 0xFF, + 0x42, 0x90, 0xFF, 0x41, 0xA0, 0xFF, 0x41, 0xB0, 0xFF, 0x42, 0xB8, 0xFF, 0x21, + 0xC0, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xD0, 0xFF, 0x41, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0x78, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x48, 0xFF, 0x42, 0xA8, 0xFF, 0x22, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x42, 0xB8, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x10, 0xFF, 0x42, 0xA8, 0xFF, 0x00, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x22, + 0xD0, 0xFF, 0x62, 0xC0, 0xFF, 0x62, 0xB0, 0xFF, 0x62, 0xA8, 0xFF, 0x42, 0x90, + 0xFF, 0x22, 0x80, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x50, 0xFF, 0x21, 0x38, 0xFF, + 0x21, 0x30, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x18, + 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x30, 0xFF, 0x20, 0x40, 0xFF, + 0x40, 0x58, 0xFF, 0x41, 0x78, 0xFF, 0x21, 0x88, 0xFF, 0x42, 0xA0, 0xFF, 0x62, + 0xB8, 0xFF, 0x22, 0xC8, 0xFF, 0x02, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x43, 0xC8, 0xFF, 0x41, + 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x22, 0x80, 0xFF, 0x22, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x41, 0x80, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x42, 0x80, 0xFF, 0x22, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xB8, 0xFF, 0x41, 0x88, + 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x48, 0xFF, 0x41, 0x70, 0xFF, + 0x42, 0xA0, 0xFF, 0x41, 0xC0, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x62, 0x90, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x38, 0xFF, + 0x63, 0x98, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x41, 0x70, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x28, 0xFF, 0x42, 0xA8, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x22, 0xB8, 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x38, 0xFF, 0x21, 0x80, + 0xFF, 0x22, 0xB8, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x42, 0xC0, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x48, 0xFF, 0x22, 0xB8, 0xFF, 0x02, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x42, 0x90, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, + 0x90, 0xFF, 0x42, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x42, 0xA8, + 0xFF, 0x41, 0x70, 0xFF, 0x20, 0x50, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x18, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x61, 0x80, 0xFF, 0x42, + 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x43, 0xC8, 0xFF, 0x41, 0x60, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x21, 0x58, 0xFF, 0x42, 0xC0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xC0, 0xFF, 0x21, 0x40, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x48, 0xFF, 0x41, 0x88, 0xFF, + 0x41, 0xB8, 0xFF, 0x42, 0xD8, 0xFF, 0x42, 0xD8, 0xFF, 0x42, 0xD0, 0xFF, 0x22, + 0xC0, 0xFF, 0x42, 0xB0, 0xFF, 0x22, 0xA8, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0x88, + 0xFF, 0x21, 0x80, 0xFF, 0x41, 0x78, 0xFF, 0x41, 0x70, 0xFF, + 0x61, 0x70, 0xFF, 0x41, 0x68, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x60, 0xFF, 0x21, + 0x58, 0xFF, 0x00, 0x48, 0xFF, 0x20, 0x28, 0xFF, 0x20, 0x20, 0xFF, 0x00, 0x10, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x60, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0x80, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x50, 0xFF, 0x42, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x43, 0xB0, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0x58, 0xFF, 0x21, 0x80, + 0xFF, 0x42, 0xA0, 0xFF, 0x42, 0xB8, 0xFF, 0x42, 0xC8, 0xFF, + 0x41, 0xC8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x22, + 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xD8, 0xFF, 0x42, 0xD8, 0xFF, 0x22, 0xD8, + 0xFF, 0x21, 0xD8, 0xFF, 0x42, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xC8, 0xFF, + 0x42, 0xB8, 0xFF, 0x41, 0x98, 0xFF, 0x41, 0x78, 0xFF, 0x21, 0x48, 0xFF, 0x20, + 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x70, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x42, + 0x88, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x38, 0xFF, 0x63, 0xB8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x63, 0xB8, 0xFF, + 0x42, 0x58, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x20, 0xFF, 0x00, 0x30, 0xFF, 0x20, 0x38, 0xFF, 0x20, 0x40, 0xFF, 0x21, 0x40, + 0xFF, 0x21, 0x48, 0xFF, 0x01, 0x48, 0xFF, 0x01, 0x50, 0xFF, 0x00, 0x50, 0xFF, + 0x41, 0x58, 0xFF, 0x41, 0x68, 0xFF, 0x41, 0x70, 0xFF, 0x41, 0x80, 0xFF, 0x41, + 0x88, 0xFF, 0x02, 0xA0, 0xFF, 0x21, 0xB8, 0xFF, 0x41, 0xC8, 0xFF, 0x62, 0xD8, + 0xFF, 0x63, 0xD0, 0xFF, 0x42, 0xB0, 0xFF, 0x42, 0x78, 0xFF, 0x20, 0x28, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x20, 0xFF, 0x41, 0xB0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x22, 0xD0, + 0xFF, 0x42, 0x80, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x42, 0xA0, 0xFF, + 0x02, 0xE0, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xA0, 0xFF, 0x41, 0x50, + 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x20, 0xFF, 0x21, 0x50, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x21, + 0xD8, 0xFF, 0x42, 0xB8, 0xFF, 0x41, 0x60, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x22, + 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x00, 0xD8, 0xFF, 0x62, 0xC0, 0xFF, 0x21, 0x68, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x68, 0xFF, 0x42, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x21, 0xD8, 0xFF, 0x42, 0xD0, 0xFF, 0x42, 0xA8, 0xFF, 0x41, 0x80, 0xFF, 0x21, + 0x50, 0xFF, 0x01, 0x28, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x18, 0xFF, 0x20, 0x28, 0xFF, 0x20, 0x40, 0xFF, 0x21, 0x80, + 0xFF, 0x02, 0xC0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x42, 0xD0, 0xFF, + 0x42, 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x22, 0xA8, 0xFF, 0x21, 0x40, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x28, 0xFF, 0x62, 0xB0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x00, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xB8, 0xFF, + 0x42, 0xA0, 0xFF, 0x42, 0x78, 0xFF, 0x41, 0x50, 0xFF, 0x21, 0x38, 0xFF, 0x00, + 0x20, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x28, 0xFF, 0x21, 0x38, 0xFF, 0x41, 0x40, 0xFF, 0x41, 0x50, 0xFF, 0x21, 0x70, + 0xFF, 0x41, 0x88, 0xFF, 0x42, 0x98, 0xFF, 0x22, 0xB0, 0xFF, 0x22, 0xC0, 0xFF, + 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x42, 0xB8, 0xFF, 0x21, 0x28, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x41, + 0xB8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x23, 0xC0, 0xFF, 0x42, 0x80, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x58, 0xFF, 0x42, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x22, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xB8, 0xFF, 0x42, 0xA0, 0xFF, 0x41, 0x90, 0xFF, + 0x41, 0x88, 0xFF, 0x21, 0x78, 0xFF, 0x41, 0x70, 0xFF, 0x41, 0x68, 0xFF, 0x41, + 0x60, 0xFF, 0x41, 0x58, 0xFF, 0x41, 0x50, 0xFF, 0x40, 0x50, 0xFF, 0x20, 0x50, + 0xFF, 0x00, 0x50, 0xFF, 0x20, 0x50, 0xFF, 0x41, 0x50, 0xFF, 0x41, 0x50, 0xFF, + 0x40, 0x58, 0xFF, 0x61, 0x60, 0xFF, 0x61, 0x60, 0xFF, 0x61, 0x68, 0xFF, 0x41, + 0x70, 0xFF, 0x41, 0x80, 0xFF, 0x42, 0x90, 0xFF, 0x41, 0x98, 0xFF, 0x41, 0xA8, + 0xFF, 0x42, 0xB0, 0xFF, 0x42, 0xB8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, + 0x22, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x62, 0xC8, 0xFF, + 0x22, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x41, 0x78, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xA0, 0xFF, 0x21, 0x48, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x62, 0x80, + 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x42, + 0xC0, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0xB0, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, + 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD8, + 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, + 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x22, + 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, + 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x62, 0xB8, 0xFF, 0x41, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x50, 0xFF, 0x42, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x42, 0xB0, 0xFF, 0x22, 0x60, 0xFF, 0x00, 0x18, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x62, 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0xC0, + 0xFF, 0x62, 0x80, 0xFF, 0x41, 0x38, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x18, 0xFF, + 0x21, 0x38, 0xFF, 0x41, 0x60, 0xFF, 0x41, 0x88, 0xFF, 0x41, 0xA0, 0xFF, 0x42, + 0xC0, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x62, 0x78, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x58, 0xFF, 0x41, 0xC0, 0xFF, 0x01, 0xE0, + 0xFF, 0x21, 0xD8, 0xFF, 0x42, 0xB0, 0xFF, 0x22, 0x70, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x88, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, + 0x62, 0x90, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x78, 0xFF, + 0x21, 0xB0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x62, + 0x98, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x68, 0xFF, 0x42, 0xD0, 0xFF, + 0x22, 0xD8, 0xFF, 0x62, 0xB8, 0xFF, 0x62, 0x78, 0xFF, 0x20, 0x28, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x70, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x62, + 0xB8, 0xFF, 0x41, 0x60, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x20, 0x20, 0xFF, 0x21, 0xA0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD0, + 0xFF, 0x62, 0x88, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, 0x90, 0xFF, 0x63, + 0xD0, 0xFF, 0x62, 0xB0, 0xFF, 0x42, 0x70, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x42, 0xC0, + 0xFF, 0x00, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD0, + 0xFF, 0x22, 0xA0, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x30, 0xFF, 0x42, 0xA8, 0xFF, 0x22, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x41, 0xD0, 0xFF, + 0x42, 0xC0, 0xFF, 0x21, 0x68, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x61, 0x68, 0xFF, 0x83, 0xB0, + 0xFF, 0x43, 0xA8, 0xFF, 0x21, 0x60, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x78, 0xFF, 0x42, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, + 0x42, 0xC8, 0xFF, 0x42, 0x70, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x42, 0x88, 0xFF, 0x22, + 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x22, + 0xC8, 0xFF, 0x41, 0x88, 0xFF, 0x20, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x41, 0x50, 0xFF, 0x83, 0x80, 0xFF, + 0x62, 0x80, 0xFF, 0x41, 0x48, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, 0xFF, 0x62, 0x98, + 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x21, 0xC8, 0xFF, 0x41, 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x42, 0x70, 0xFF, 0x42, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xB8, + 0xFF, 0x42, 0x88, 0xFF, 0x20, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x21, 0x18, 0xFF, 0x62, 0x48, 0xFF, 0x82, 0x60, 0xFF, 0x61, + 0x50, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, 0xA0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x42, 0x80, 0xFF, 0x42, + 0xC8, 0xFF, 0x21, 0xD0, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x21, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x22, 0xC0, 0xFF, 0x42, 0x98, 0xFF, + 0x21, 0x58, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x21, 0x18, 0xFF, 0x62, 0x28, 0xFF, 0x62, 0x30, 0xFF, 0x41, 0x20, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, + 0xFF, 0x41, 0x88, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x21, 0xD8, 0xFF, 0x41, + 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x58, 0xFF, 0x42, 0xA0, 0xFF, + 0x42, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xD8, 0xFF, + 0x42, 0xC8, 0xFF, 0x42, 0xB0, 0xFF, 0x42, 0x88, 0xFF, 0x21, 0x58, 0xFF, 0x21, + 0x30, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x58, 0xFF, 0x22, + 0xB0, 0xFF, 0x42, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x21, 0xD0, 0xFF, 0x41, 0x80, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x40, 0xFF, 0x21, 0x78, 0xFF, 0x22, 0xA8, + 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x21, 0xC0, 0xFF, 0x42, 0xB0, 0xFF, 0x41, 0xA0, 0xFF, 0x42, + 0x80, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x41, 0x68, 0xFF, 0x42, 0xB0, 0xFF, + 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, + 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0x48, 0xFF, 0x41, + 0x68, 0xFF, 0x21, 0x80, 0xFF, 0x21, 0x98, 0xFF, 0x41, 0xA0, 0xFF, 0x42, 0xA0, + 0xFF, 0x21, 0xA8, 0xFF, 0x21, 0xA8, 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0xA8, 0xFF, + 0x21, 0xA0, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0x90, 0xFF, 0x41, + 0x78, 0xFF, 0x61, 0x60, 0xFF, 0x21, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x20, 0x20, + 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x21, 0x58, 0xFF, 0x42, 0x90, 0xFF, 0x41, 0xC0, + 0xFF, 0x22, 0xD8, 0xFF, 0x43, 0xC0, 0xFF, 0x41, 0x60, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x18, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x30, 0xFF, 0x21, 0x60, 0xFF, 0x41, + 0x90, 0xFF, 0x82, 0xB0, 0xFF, 0x82, 0x90, 0xFF, 0x61, 0x50, 0xFF, 0x00, 0x20, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x41, 0x48, 0xFF, + 0x62, 0x60, 0xFF, 0x62, 0x60, 0xFF, 0x81, 0x40, 0xFF, 0x41, 0x20, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, + 0xFF, 0x21, 0x18, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xE3, + 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x41, 0x08, 0xFF, 0xC3, 0x18, 0xFF, 0xA2, 0x10, 0xFF, 0x20, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xC3, 0x18, + 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xE3, + 0x18, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, + 0xC3, 0x18, 0xFF, 0xE3, 0x18, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, + 0xC3, 0x18, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0xE3, 0x18, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xE3, 0x18, 0xFF, + 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x82, 0x10, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, + 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, + 0xE3, 0x18, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0xE3, 0x18, + 0xFF, 0xC3, 0x18, 0xFF, 0xE3, 0x18, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, + 0xFF, 0xF3, 0x9C, 0xFF, 0x59, 0xCE, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, + 0x38, 0xC6, 0xFF, 0xF3, 0x9C, 0xFF, 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x65, 0x29, 0xFF, 0xF7, 0xBD, 0xFF, 0x34, 0xA5, + 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, + 0x71, 0x8C, 0xFF, 0x38, 0xC6, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x30, 0x84, 0xFF, 0x38, 0xC6, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x18, + 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x75, 0xAD, + 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0x30, 0x84, 0xFF, 0x38, 0xC6, 0xFF, 0x38, + 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0xF3, 0x9C, 0xFF, 0x45, 0x29, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x71, 0x8C, 0xFF, + 0x79, 0xCE, 0xFF, 0x8A, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAA, + 0x52, 0xFF, 0x9A, 0xD6, 0xFF, 0x8E, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x96, 0xB5, 0xFF, 0x55, 0xAD, + 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xF3, 0x9C, 0xFF, 0x59, 0xCE, 0xFF, 0x28, 0x42, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xD7, 0xBD, 0xFF, 0x18, 0xC6, 0xFF, 0x38, + 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0xB6, 0xB5, 0xFF, 0x69, 0x4A, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, + 0x2C, 0x63, 0xFF, 0xF7, 0xBD, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, + 0xC6, 0xFF, 0xF7, 0xBD, 0xFF, 0x0C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x9E, 0xF7, 0xFF, 0xDB, 0xDE, 0xFF, 0xBA, + 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xFB, 0xDE, 0xFF, 0xBE, 0xF7, 0xFF, 0x6D, 0x6B, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, + 0x3C, 0xE7, 0xFF, 0x59, 0xCE, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x9E, 0xF7, 0xFF, 0xC7, 0x39, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x14, 0xA5, 0xFF, 0x9E, 0xF7, 0xFF, 0xC7, + 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8A, 0x52, + 0xFF, 0x7D, 0xEF, 0xFF, 0x1C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, + 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, 0x9E, 0xF7, 0xFF, 0x96, 0xB5, 0xFF, 0x61, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xBE, 0xF7, + 0xFF, 0xFB, 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, + 0xBE, 0xF7, 0xFF, 0x92, 0x94, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, + 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0xFF, 0xFF, 0xFF, 0x75, 0xAD, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0xFF, 0xFF, 0xFF, 0x71, 0x8C, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, + 0xBA, 0xD6, 0xFF, 0x79, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x86, 0x31, 0xFF, 0x1C, 0xE7, 0xFF, + 0xDF, 0xFF, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, + 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, + 0xBA, 0xD6, 0xFF, 0x5D, 0xEF, 0xFF, 0xBA, 0xD6, 0xFF, 0x45, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0x1C, 0xE7, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, + 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0x5D, 0xEF, 0xFF, 0xBA, 0xD6, 0xFF, + 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xD7, 0xBD, 0xFF, 0x1C, 0xE7, + 0xFF, 0x28, 0x42, 0xFF, 0x04, 0x21, 0xFF, 0x04, 0x21, 0xFF, 0x6D, 0x6B, 0xFF, + 0xFF, 0xFF, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, + 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, + 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x71, + 0x8C, 0xFF, 0x04, 0x21, 0xFF, 0x24, 0x21, 0xFF, 0xE7, 0x39, 0xFF, 0x1C, 0xE7, + 0xFF, 0x79, 0xCE, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x92, 0x94, 0xFF, 0xBE, 0xF7, 0xFF, 0xAE, 0x73, 0xFF, 0x04, 0x21, 0xFF, 0x04, + 0x21, 0xFF, 0x8A, 0x52, 0xFF, 0x3C, 0xE7, 0xFF, 0x75, 0xAD, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x7D, 0xEF, 0xFF, + 0x1C, 0xE7, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0x2C, 0x63, 0xFF, 0xBE, + 0xF7, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x2C, + 0x63, 0xFF, 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, 0xFF, 0x96, 0xB5, 0xFF, 0x61, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x5D, 0xEF, 0xFF, 0x34, 0xA5, 0xFF, 0x24, + 0x21, 0xFF, 0x24, 0x21, 0xFF, 0x65, 0x29, 0xFF, 0x96, 0xB5, 0xFF, 0x3C, 0xE7, + 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x49, 0x4A, 0xFF, 0x7D, 0xEF, 0xFF, + 0xF3, 0x9C, 0xFF, 0x04, 0x21, 0xFF, 0x24, 0x21, 0xFF, 0x86, 0x31, 0xFF, 0x59, + 0xCE, 0xFF, 0x5D, 0xEF, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, + 0xD7, 0xBD, 0xFF, 0x1C, 0xE7, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x45, 0x29, 0xFF, 0x10, 0x84, 0xFF, 0x08, 0x42, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, + 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, + 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, + 0xFF, 0xBE, 0xF7, 0xFF, 0x10, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x61, 0x08, 0xFF, 0x8E, 0x73, 0xFF, 0x2C, 0x63, 0xFF, 0x41, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0x9E, 0xF7, 0xFF, 0x0C, 0x63, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, + 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, + 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, 0xFF, 0x92, 0x94, 0xFF, 0x00, 0x00, + 0xFF, 0x2C, 0x63, 0xFF, 0xBE, 0xF7, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, + 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x00, 0xFF, 0x14, 0xA5, 0xFF, 0x3C, 0xE7, 0xFF, + 0x9A, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x5D, 0xEF, + 0xFF, 0xF3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, + 0x75, 0xAD, 0xFF, 0x3C, 0xE7, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x28, + 0x42, 0xFF, 0x9E, 0xF7, 0xFF, 0xD3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x0C, 0x63, 0xFF, 0xAE, 0x73, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x34, 0xA5, 0xFF, 0xBE, 0xF7, 0xFF, 0x75, 0xAD, + 0xFF, 0x28, 0x42, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, + 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, + 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, + 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x30, 0x84, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, + 0x9E, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, + 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x3C, 0xE7, 0xFF, + 0xDB, 0xDE, 0xFF, 0x24, 0x21, 0xFF, 0xCB, 0x5A, 0xFF, 0xBE, 0xF7, 0xFF, 0x51, + 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, + 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0xBA, + 0xD6, 0xFF, 0xD7, 0xBD, 0xFF, 0x10, 0x84, 0xFF, 0x9E, 0xF7, 0xFF, 0x0C, 0x63, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x08, 0x42, 0xFF, 0x5D, 0xEF, 0xFF, 0xD3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0x7D, 0xEF, 0xFF, 0xE7, 0x39, + 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0xFB, 0xDE, 0xFF, + 0xEF, 0x7B, 0xFF, 0x24, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, + 0xF7, 0xBD, 0xFF, 0xBE, 0xF7, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x28, + 0x42, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, + 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xBE, 0xF7, + 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0x9E, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0xFB, + 0xDE, 0xFF, 0xD7, 0xBD, 0xFF, 0x7D, 0xEF, 0xFF, 0xCF, 0x7B, 0xFF, 0xEB, 0x5A, + 0xFF, 0xBE, 0xF7, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, + 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x8A, 0x52, 0xFF, 0x9E, 0xF7, 0xFF, 0xEF, 0x7B, 0xFF, 0xC7, 0x39, 0xFF, + 0x7D, 0xEF, 0xFF, 0xF3, 0x9C, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, 0xFF, 0xD7, 0xBD, + 0xFF, 0x2C, 0x63, 0xFF, 0x4D, 0x6B, 0xFF, 0x4D, 0x6B, 0xFF, 0x38, 0xC6, 0xFF, + 0x55, 0xAD, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x10, + 0x84, 0xFF, 0x3C, 0xE7, 0xFF, 0xBE, 0xF7, 0xFF, 0x9A, 0xD6, 0xFF, 0xCF, 0x7B, + 0xFF, 0x24, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x6D, 0x6B, 0xFF, 0x59, 0xCE, + 0xFF, 0xBE, 0xF7, 0xFF, 0x5D, 0xEF, 0xFF, 0xF3, 0x9C, 0xFF, + 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, + 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, + 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, + 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x8E, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0x9E, 0xF7, 0xFF, + 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, + 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x34, 0xA5, 0xFF, 0x1C, 0xE7, 0xFF, 0x6D, 0x6B, 0xFF, 0x9A, 0xD6, 0xFF, + 0x18, 0xC6, 0xFF, 0xCF, 0x7B, 0xFF, 0x7D, 0xEF, 0xFF, 0x51, 0x8C, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, + 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x30, 0x84, 0xFF, 0xBE, 0xF7, 0xFF, 0x8A, + 0x52, 0xFF, 0x61, 0x08, 0xFF, 0x79, 0xCE, 0xFF, 0x9A, 0xD6, 0xFF, 0xE3, 0x18, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, + 0xFB, 0xDE, 0xFF, 0x5D, 0xEF, 0xFF, 0xBE, 0xF7, 0xFF, 0xBE, 0xF7, 0xFF, 0xDF, + 0xFF, 0xFF, 0xDB, 0xDE, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x14, 0xA5, 0xFF, + 0x5D, 0xEF, 0xFF, 0xBE, 0xF7, 0xFF, 0x79, 0xCE, 0xFF, 0x8A, 0x52, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0xAE, 0x73, 0xFF, 0xBA, + 0xD6, 0xFF, 0xDF, 0xFF, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, + 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, + 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x30, 0x84, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, + 0x8C, 0xFF, 0xBE, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x08, + 0x42, 0xFF, 0x71, 0x8C, 0xFF, 0x7D, 0xEF, 0xFF, 0xD7, 0xBD, 0xFF, 0x5D, 0xEF, + 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, + 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0xF7, 0xBD, + 0xFF, 0xDB, 0xDE, 0xFF, 0x65, 0x29, 0xFF, 0x20, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, + 0x7D, 0xEF, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, 0xFF, 0xD7, 0xBD, 0xFF, 0xEB, 0x5A, + 0xFF, 0xEB, 0x5A, 0xFF, 0x2C, 0x63, 0xFF, 0x38, 0xC6, 0xFF, 0x34, 0xA5, 0xFF, + 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x55, 0xAD, 0xFF, 0x7D, 0xEF, + 0xFF, 0x79, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0xBE, 0xF7, 0xFF, 0xEF, 0x7B, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, + 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, + 0xDF, 0xFF, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0xBE, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, + 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, + 0xFF, 0x7D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0xC7, 0x39, 0xFF, + 0x1C, 0xE7, 0xFF, 0x1C, 0xE7, 0xFF, 0x5D, 0xEF, 0xFF, 0x51, 0x8C, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, + 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0xFB, 0xDE, 0xFF, 0xB6, 0xB5, 0xFF, 0x55, + 0xAD, 0xFF, 0x38, 0xC6, 0xFF, 0x7D, 0xEF, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x5D, 0xEF, 0xFF, + 0xD3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x75, + 0xAD, 0xFF, 0x7D, 0xEF, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, + 0xFF, 0xA2, 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0xC3, 0x18, 0xFF, 0x38, 0xC6, 0xFF, 0xFB, 0xDE, 0xFF, 0x45, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x92, 0x94, 0xFF, 0xB6, 0xB5, 0xFF, + 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8A, 0x52, 0xFF, 0xBE, + 0xF7, 0xFF, 0xCF, 0x7B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, + 0xEF, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, + 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xDF, 0xFF, 0xFF, 0x10, 0x84, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x55, 0xAD, 0xFF, 0x55, 0xAD, 0xFF, + 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0xBE, + 0xF7, 0xFF, 0x0C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, + 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x28, + 0x42, 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, + 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x7D, 0xEF, 0xFF, 0xFB, 0xDE, + 0xFF, 0x1C, 0xE7, 0xFF, 0x1C, 0xE7, 0xFF, 0xFB, 0xDE, 0xFF, 0x5D, 0xEF, 0xFF, + 0x96, 0xB5, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, + 0x42, 0xFF, 0x5D, 0xEF, 0xFF, 0xF3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x3C, 0xE7, 0xFF, 0xC7, 0x39, 0xFF, + 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0x18, 0xC6, 0xFF, 0xAE, 0x73, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xB6, 0xB5, 0xFF, 0xFB, 0xDE, + 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x18, + 0xC6, 0xFF, 0x5D, 0xEF, 0xFF, 0x49, 0x4A, 0xFF, 0x24, 0x21, 0xFF, 0x04, 0x21, + 0xFF, 0x6D, 0x6B, 0xFF, 0xBE, 0xF7, 0xFF, 0x10, 0x84, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, + 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, + 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0x8A, 0x52, 0xFF, 0x04, 0x21, 0xFF, + 0x45, 0x29, 0xFF, 0x65, 0x29, 0xFF, 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, + 0x92, 0x94, 0xFF, 0x04, 0x21, 0xFF, 0x24, 0x21, 0xFF, 0x08, 0x42, 0xFF, 0xFB, + 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x92, 0x94, 0xFF, 0xBE, 0xF7, 0xFF, 0xAE, 0x73, 0xFF, + 0x04, 0x21, 0xFF, 0x04, 0x21, 0xFF, 0x8A, 0x52, 0xFF, 0x5D, 0xEF, 0xFF, 0x75, + 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, + 0xFF, 0x5D, 0xEF, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, 0xAA, 0x52, 0xFF, + 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x79, 0xCE, 0xFF, 0x59, + 0xCE, 0xFF, 0xC7, 0x39, 0xFF, 0x24, 0x21, 0xFF, 0x45, 0x29, 0xFF, 0x65, 0x29, + 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, + 0x5D, 0xEF, 0xFF, 0xCB, 0x5A, 0xFF, 0x86, 0x31, 0xFF, 0xA6, 0x31, 0xFF, 0xE7, + 0x39, 0xFF, 0x38, 0xC6, 0xFF, 0x1C, 0xE7, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, 0xFF, 0x34, 0xA5, 0xFF, + 0x24, 0x21, 0xFF, 0x45, 0x29, 0xFF, 0x65, 0x29, 0xFF, 0x96, 0xB5, 0xFF, 0x3C, + 0xE7, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x69, 0x4A, 0xFF, 0xDF, 0xFF, + 0xFF, 0x34, 0xA5, 0xFF, 0x24, 0x21, 0xFF, 0x24, 0x21, 0xFF, + 0x86, 0x31, 0xFF, 0xF7, 0xBD, 0xFF, 0xFB, 0xDE, 0xFF, 0x45, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x9E, 0xF7, 0xFF, 0xDB, 0xDE, 0xFF, + 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xFB, 0xDE, 0xFF, 0x9E, 0xF7, 0xFF, 0x2C, + 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, + 0xFF, 0x3C, 0xE7, 0xFF, 0x79, 0xCE, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x9E, 0xF7, 0xFF, 0xDB, + 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0x3C, 0xE7, 0xFF, 0xF3, 0x9C, + 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0xBE, 0xF7, 0xFF, + 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x69, + 0x4A, 0xFF, 0x5D, 0xEF, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, + 0xFF, 0xDB, 0xDE, 0xFF, 0x9E, 0xF7, 0xFF, 0x96, 0xB5, 0xFF, + 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x9E, + 0xF7, 0xFF, 0xFB, 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, + 0xFF, 0xBE, 0xF7, 0xFF, 0x92, 0x94, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x00, 0xFF, 0x75, 0xAD, 0xFF, 0xBE, 0xF7, 0xFF, 0x49, 0x4A, 0xFF, 0x00, + 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0x18, 0xC6, 0xFF, 0xFF, 0xFF, 0xFF, 0x71, 0x8C, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x04, 0x21, + 0xFF, 0x9A, 0xD6, 0xFF, 0x7D, 0xEF, 0xFF, 0xDB, 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, + 0xDB, 0xDE, 0xFF, 0x1C, 0xE7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x24, + 0x21, 0xFF, 0xFB, 0xDE, 0xFF, 0x9A, 0xD6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xD3, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x5D, + 0xEF, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, 0xDB, 0xDE, + 0xFF, 0x5D, 0xEF, 0xFF, 0x9A, 0xD6, 0xFF, 0x45, 0x29, 0xFF, + 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0x1C, 0xE7, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, + 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, 0x7D, 0xEF, 0xFF, 0x59, 0xCE, + 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x04, 0x21, 0xFF, 0x14, + 0xA5, 0xFF, 0xF7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, + 0xFF, 0x51, 0x8C, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x45, 0x29, 0xFF, 0x96, 0xB5, 0xFF, 0xF3, 0x9C, 0xFF, 0x82, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x30, 0x84, + 0xFF, 0xF7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, + 0x38, 0xC6, 0xFF, 0x51, 0x8C, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xEF, + 0x7B, 0xFF, 0xF7, 0xBD, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x8E, 0x73, 0xFF, + 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, 0x55, + 0xAD, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x82, 0x10, 0xFF, 0x30, 0x84, 0xFF, 0xF7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, + 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, 0xF3, 0x9C, 0xFF, 0x65, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x30, 0x84, 0xFF, 0xF7, 0xBD, + 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x0C, 0x63, 0xFF, + 0x59, 0xCE, 0xFF, 0x6D, 0x6B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0x14, 0xA5, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, + 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0x18, 0xC6, 0xFF, 0xAA, 0x52, + 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x18, 0xC6, 0xFF, 0xEF, 0x7B, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8A, + 0x52, 0xFF, 0x38, 0xC6, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x86, 0x31, 0xFF, 0x96, 0xB5, 0xFF, 0xD7, 0xBD, 0xFF, + 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, 0xB6, 0xB5, 0xFF, 0x8A, + 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x2C, 0x63, + 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, + 0x96, 0xB5, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xA2, 0x10, 0xFF, 0x82, 0x10, 0xFF, + 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, + 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xA2, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x61, 0x08, 0xFF, 0x82, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, 0xFF, 0x82, 0x10, + 0xFF, 0xA2, 0x10, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x20, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x61, 0x08, 0xFF, 0x82, 0x10, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, + 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, + 0xA2, 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xA2, + 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, + 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x82, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, + 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, 0xFF, 0x82, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xB6, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, +}; +const lv_img_dsc_t ui_img_2106501360 = { + .header.always_zero = 0, + .header.w = 134, + .header.h = 76, + .data_size = sizeof(ui_img_2106501360_data), + .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, + .data = ui_img_2106501360_data +}; diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/screens/ui_loader.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/screens/ui_loader.c new file mode 100644 index 00000000..5fddfc27 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/screens/ui_loader.c @@ -0,0 +1,47 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +void ui_loader_screen_init(void) +{ + ui_loader = lv_obj_create(NULL); + lv_obj_clear_flag(ui_loader, LV_OBJ_FLAG_SCROLLABLE); /// Flags + lv_obj_set_style_bg_color(ui_loader, + lv_color_hex(0x000000), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui_loader, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + + ui_logo = lv_img_create(ui_loader); + lv_img_set_src(ui_logo, &ui_img_2106501360); + lv_obj_set_width(ui_logo, LV_SIZE_CONTENT); /// 134 + lv_obj_set_height(ui_logo, LV_SIZE_CONTENT); /// 76 + lv_obj_set_align(ui_logo, LV_ALIGN_CENTER); + lv_obj_add_flag(ui_logo, LV_OBJ_FLAG_ADV_HITTEST); /// Flags + lv_obj_clear_flag(ui_logo, LV_OBJ_FLAG_SCROLLABLE); /// Flags + + ui_Spinner1 = lv_spinner_create(ui_loader, 1000, 90); + lv_obj_set_width(ui_Spinner1, 28); + lv_obj_set_height(ui_Spinner1, 29); + lv_obj_set_x(ui_Spinner1, 3); + lv_obj_set_y(ui_Spinner1, 81); + lv_obj_set_align(ui_Spinner1, LV_ALIGN_CENTER); + lv_obj_clear_flag(ui_Spinner1, LV_OBJ_FLAG_CLICKABLE); /// Flags + lv_obj_set_style_arc_color(ui_Spinner1, + lv_color_hex(0xFFFFFF), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_arc_opa(ui_Spinner1, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_arc_width(ui_Spinner1, 5, LV_PART_MAIN | LV_STATE_DEFAULT); + + lv_obj_set_style_arc_color(ui_Spinner1, + lv_color_hex(0xD50008), + LV_PART_INDICATOR | LV_STATE_DEFAULT); + lv_obj_set_style_arc_opa(ui_Spinner1, + 255, + LV_PART_INDICATOR | LV_STATE_DEFAULT); + lv_obj_set_style_arc_width(ui_Spinner1, + 5, + LV_PART_INDICATOR | LV_STATE_DEFAULT); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/screens/ui_main.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/screens/ui_main.c new file mode 100644 index 00000000..43d89bb9 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/screens/ui_main.c @@ -0,0 +1,100 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +void ui_main_screen_init(void) +{ + ui_main = lv_obj_create(NULL); + lv_obj_clear_flag(ui_main, LV_OBJ_FLAG_SCROLLABLE); /// Flags + lv_obj_set_style_bg_color(ui_main, + lv_color_hex(0x000000), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui_main, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + + ui_Image4 = lv_img_create(ui_main); + lv_img_set_src(ui_Image4, &ui_img_1802009198); + lv_obj_set_width(ui_Image4, LV_SIZE_CONTENT); /// 75 + lv_obj_set_height(ui_Image4, LV_SIZE_CONTENT); /// 43 + lv_obj_set_x(ui_Image4, -119); + lv_obj_set_y(ui_Image4, -95); + lv_obj_set_align(ui_Image4, LV_ALIGN_CENTER); + lv_obj_add_flag(ui_Image4, LV_OBJ_FLAG_ADV_HITTEST); /// Flags + lv_obj_clear_flag(ui_Image4, LV_OBJ_FLAG_SCROLLABLE); /// Flags + + ui_Panel1 = lv_obj_create(ui_main); + lv_obj_set_width(ui_Panel1, 296); + lv_obj_set_height(ui_Panel1, 180); + lv_obj_set_x(ui_Panel1, -2); + lv_obj_set_y(ui_Panel1, 24); + lv_obj_set_align(ui_Panel1, LV_ALIGN_CENTER); + lv_obj_clear_flag(ui_Panel1, LV_OBJ_FLAG_SCROLLABLE); /// Flags + + ui_Label1 = lv_label_create(ui_main); + lv_obj_set_width(ui_Label1, LV_SIZE_CONTENT); /// 1 + lv_obj_set_height(ui_Label1, LV_SIZE_CONTENT); /// 1 + lv_obj_set_x(ui_Label1, 48); + lv_obj_set_y(ui_Label1, -90); + lv_obj_set_align(ui_Label1, LV_ALIGN_CENTER); + lv_label_set_text(ui_Label1, "LVGL Example (DMA)"); + lv_obj_set_style_text_color(ui_Label1, + lv_color_hex(0xFFFFFF), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_opa(ui_Label1, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_decor(ui_Label1, + LV_TEXT_DECOR_NONE, + LV_PART_MAIN | LV_STATE_DEFAULT); + + ui_BTN0 = lv_switch_create(ui_main); + lv_obj_set_width(ui_BTN0, 50); + lv_obj_set_height(ui_BTN0, 25); + lv_obj_set_x(ui_BTN0, 98); + lv_obj_set_y(ui_BTN0, -4); + lv_obj_set_align(ui_BTN0, LV_ALIGN_CENTER); + + lv_obj_set_style_bg_color(ui_BTN0, + lv_color_hex(0xD50008), + LV_PART_KNOB | LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui_BTN0, 255, LV_PART_KNOB | LV_STATE_DEFAULT); + + ui_BTN1 = lv_switch_create(ui_main); + lv_obj_set_width(ui_BTN1, 50); + lv_obj_set_height(ui_BTN1, 25); + lv_obj_set_x(ui_BTN1, 98); + lv_obj_set_y(ui_BTN1, 56); + lv_obj_set_align(ui_BTN1, LV_ALIGN_CENTER); + + lv_obj_set_style_bg_color(ui_BTN1, + lv_color_hex(0xD50008), + LV_PART_KNOB | LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui_BTN1, 255, LV_PART_KNOB | LV_STATE_DEFAULT); + + ui_Led0Label = lv_label_create(ui_main); + lv_obj_set_width(ui_Led0Label, LV_SIZE_CONTENT); /// 1 + lv_obj_set_height(ui_Led0Label, LV_SIZE_CONTENT); /// 1 + lv_obj_set_x(ui_Led0Label, -65); + lv_obj_set_y(ui_Led0Label, -4); + lv_obj_set_align(ui_Led0Label, LV_ALIGN_CENTER); + lv_label_set_text(ui_Led0Label, "LED 0"); + + ui_Led1Label = lv_label_create(ui_main); + lv_obj_set_width(ui_Led1Label, LV_SIZE_CONTENT); /// 1 + lv_obj_set_height(ui_Led1Label, LV_SIZE_CONTENT); /// 1 + lv_obj_set_x(ui_Led1Label, -67); + lv_obj_set_y(ui_Led1Label, 56); + lv_obj_set_align(ui_Led1Label, LV_ALIGN_CENTER); + lv_label_set_text(ui_Led1Label, "LED 1"); + + ui_ControlTitle = lv_label_create(ui_main); + lv_obj_set_width(ui_ControlTitle, LV_SIZE_CONTENT); /// 1 + lv_obj_set_height(ui_ControlTitle, LV_SIZE_CONTENT); /// 1 + lv_obj_set_x(ui_ControlTitle, -11); + lv_obj_set_y(ui_ControlTitle, -49); + lv_obj_set_align(ui_ControlTitle, LV_ALIGN_CENTER); + lv_label_set_text(ui_ControlTitle, "Control Onboard LEDs"); + + lv_obj_add_event_cb(ui_BTN0, ui_event_BTN0, LV_EVENT_ALL, NULL); + lv_obj_add_event_cb(ui_BTN1, ui_event_BTN1, LV_EVENT_ALL, NULL); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui.c new file mode 100644 index 00000000..79f5b2dc --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui.c @@ -0,0 +1,83 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "ui.h" +#include "ui_helpers.h" + +///////////////////// VARIABLES //////////////////// + +// SCREEN: ui_loader +void ui_loader_screen_init(void); + +lv_obj_t *ui_loader; +lv_obj_t *ui_logo; +lv_obj_t *ui_Spinner1; + +// SCREEN: ui_main +void ui_main_screen_init(void); + +lv_obj_t *ui_main; +lv_obj_t *ui_Image4; +lv_obj_t *ui_Panel1; +lv_obj_t *ui_Label1; +void ui_event_BTN0(lv_event_t *e); + +lv_obj_t *ui_BTN0; +void ui_event_BTN1(lv_event_t *e); + +lv_obj_t *ui_BTN1; +lv_obj_t *ui_Led0Label; +lv_obj_t *ui_Led1Label; +lv_obj_t *ui_ControlTitle; +lv_obj_t *ui____initial_actions0; + +///////////////////// TEST LVGL SETTINGS //////////////////// +#if LV_COLOR_DEPTH != 16 +#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings" +#endif +#if LV_COLOR_16_SWAP != 0 +#error "LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings" +#endif + +///////////////////// ANIMATIONS //////////////////// + +///////////////////// FUNCTIONS //////////////////// +void ui_event_BTN0(lv_event_t *e) +{ + lv_event_code_t event_code = lv_event_get_code(e); + lv_obj_t *target = lv_event_get_target(e); + (void)target; + if (event_code == LV_EVENT_PRESSED) { + btn0_pressed_event_cb(e); + } +} + +void ui_event_BTN1(lv_event_t *e) +{ + lv_event_code_t event_code = lv_event_get_code(e); + lv_obj_t *target = lv_event_get_target(e); + (void)target; + if (event_code == LV_EVENT_PRESSED) { + btn1_pressed_event_cb(e); + } +} + +///////////////////// SCREENS //////////////////// + +void ui_init(void) +{ + lv_disp_t *dispp = lv_disp_get_default(); + lv_theme_t *theme = + lv_theme_default_init(dispp, + lv_palette_main(LV_PALETTE_BLUE), + lv_palette_main(LV_PALETTE_RED), + false, + LV_FONT_DEFAULT); + lv_disp_set_theme(dispp, theme); + ui_loader_screen_init(); + ui_main_screen_init(); + ui____initial_actions0 = lv_obj_create(NULL); + lv_disp_load_scr(ui_loader); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui.h new file mode 100644 index 00000000..6a9ccb37 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui.h @@ -0,0 +1,49 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#ifndef _SQUARELINE_PROJECT_UI_H +#define _SQUARELINE_PROJECT_UI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lvgl.h" +#include "ui_helpers.h" +#include "ui_events.h" +// SCREEN: ui_loader +void ui_loader_screen_init(void); + +extern lv_obj_t *ui_loader; +extern lv_obj_t *ui_logo; +extern lv_obj_t *ui_Spinner1; +// SCREEN: ui_main +void ui_main_screen_init(void); + +extern lv_obj_t *ui_main; +extern lv_obj_t *ui_Image4; +extern lv_obj_t *ui_Panel1; +extern lv_obj_t *ui_Label1; +void ui_event_BTN0(lv_event_t *e); + +extern lv_obj_t *ui_BTN0; +void ui_event_BTN1(lv_event_t *e); + +extern lv_obj_t *ui_BTN1; +extern lv_obj_t *ui_Led0Label; +extern lv_obj_t *ui_Led1Label; +extern lv_obj_t *ui_ControlTitle; +extern lv_obj_t *ui____initial_actions0; + +LV_IMG_DECLARE(ui_img_2106501360); // assets\silabs-logo-large.png +LV_IMG_DECLARE(ui_img_1802009198); // assets\silabs-logo.png + +void ui_init(void); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_events.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_events.c new file mode 100644 index 00000000..c0a18fd8 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_events.c @@ -0,0 +1,72 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "ui.h" +#include "sl_si91x_button.h" +#include "sl_si91x_button_pin_config.h" +#include "sl_si91x_button_instances.h" +#include "sl_si91x_led_config.h" +#include "sl_si91x_led_instances.h" +#include "sl_si91x_led.h" + +#define ON 1 +#define OFF 0 + +static volatile bool led0_status = OFF; +static volatile bool led1_status = OFF; + +void btn0_pressed_event_cb(lv_event_t *e) +{ + (void)e; + if (led0_status == ON) { + sl_si91x_led_clear(led_led0.pin); + led0_status = OFF; + } else { + sl_si91x_led_set(led_led0.pin); + led0_status = ON; + } +} + +void btn1_pressed_event_cb(lv_event_t *e) +{ + (void)e; + if (led1_status == ON) { + sl_si91x_led_clear(led_led1.pin); + led1_status = OFF; + } else { + sl_si91x_led_set(led_led1.pin); + led1_status = ON; + } +} + +/***************************************************************************//** + * Callback on button change. + ******************************************************************************/ +void sl_si91x_button_isr(uint8_t pin, int8_t state) +{ + if (state == BUTTON_PRESSED) { + if (pin == button_btn0.pin) { + if (lv_obj_has_state(ui_BTN0, LV_STATE_CHECKED)) { + lv_obj_clear_state(ui_BTN0, LV_STATE_CHECKED); + sl_si91x_led_clear(led_led0.pin); + led0_status = OFF; + } else { + lv_obj_add_state(ui_BTN0, LV_STATE_CHECKED); + sl_si91x_led_set(led_led0.pin); + led0_status = ON; + } + } else if (pin == button_btn1.pin) { + if (lv_obj_has_state(ui_BTN1, LV_STATE_CHECKED)) { + lv_obj_clear_state(ui_BTN1, LV_STATE_CHECKED); + sl_si91x_led_clear(led_led1.pin); + led1_status = OFF; + } else { + lv_obj_add_state(ui_BTN1, LV_STATE_CHECKED); + sl_si91x_led_set(led_led1.pin); + led1_status = ON; + } + } + } +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_events.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_events.h new file mode 100644 index 00000000..e7a38d7d --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_events.h @@ -0,0 +1,20 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#ifndef _UI_EVENTS_H +#define _UI_EVENTS_H + +#ifdef __cplusplus +extern "C" { +#endif + +void btn0_pressed_event_cb(lv_event_t *e); +void btn1_pressed_event_cb(lv_event_t *e); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_helpers.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_helpers.c new file mode 100644 index 00000000..b7aee039 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_helpers.c @@ -0,0 +1,322 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "ui_helpers.h" + +void _ui_bar_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) { + lv_bar_set_value(target, val, LV_ANIM_ON); + } + if (id == _UI_BAR_PROPERTY_VALUE) { + lv_bar_set_value(target, val, LV_ANIM_OFF); + } +} + +void _ui_basic_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_BASIC_PROPERTY_POSITION_X) { + lv_obj_set_x(target, val); + } + if (id == _UI_BASIC_PROPERTY_POSITION_Y) { + lv_obj_set_y(target, val); + } + if (id == _UI_BASIC_PROPERTY_WIDTH) { + lv_obj_set_width(target, val); + } + if (id == _UI_BASIC_PROPERTY_HEIGHT) { + lv_obj_set_height(target, val); + } +} + +void _ui_dropdown_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_DROPDOWN_PROPERTY_SELECTED) { + lv_dropdown_set_selected(target, val); + } +} + +void _ui_image_set_property(lv_obj_t *target, int id, uint8_t *val) +{ + if (id == _UI_IMAGE_PROPERTY_IMAGE) { + lv_img_set_src(target, val); + } +} + +void _ui_label_set_property(lv_obj_t *target, int id, const char *val) +{ + if (id == _UI_LABEL_PROPERTY_TEXT) { + lv_label_set_text(target, val); + } +} + +void _ui_roller_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) { + lv_roller_set_selected(target, val, LV_ANIM_ON); + } + if (id == _UI_ROLLER_PROPERTY_SELECTED) { + lv_roller_set_selected(target, val, LV_ANIM_OFF); + } +} + +void _ui_slider_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) { + lv_slider_set_value(target, val, LV_ANIM_ON); + } + if (id == _UI_SLIDER_PROPERTY_VALUE) { + lv_slider_set_value(target, val, LV_ANIM_OFF); + } +} + +void _ui_screen_change(lv_obj_t **target, + lv_scr_load_anim_t fademode, + int spd, + int delay, + void (*target_init)(void)) +{ + if (*target == NULL) { + target_init(); + } + lv_scr_load_anim(*target, fademode, spd, delay, false); +} + +void _ui_screen_delete(lv_obj_t **target) +{ + if (*target == NULL) { + lv_obj_del(*target); + target = NULL; + } +} + +void _ui_arc_increment(lv_obj_t *target, int val) +{ + int old = lv_arc_get_value(target); + lv_arc_set_value(target, old + val); + lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0); +} + +void _ui_bar_increment(lv_obj_t *target, int val, int anm) +{ + int old = lv_bar_get_value(target); + lv_bar_set_value(target, old + val, anm); +} + +void _ui_slider_increment(lv_obj_t *target, int val, int anm) +{ + int old = lv_slider_get_value(target); + lv_slider_set_value(target, old + val, anm); + lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0); +} + +void _ui_keyboard_set_target(lv_obj_t *keyboard, lv_obj_t *textarea) +{ + lv_keyboard_set_textarea(keyboard, textarea); +} + +void _ui_flag_modify(lv_obj_t *target, int32_t flag, int value) +{ + if (value == _UI_MODIFY_FLAG_TOGGLE) { + if (lv_obj_has_flag(target, flag)) { + lv_obj_clear_flag(target, flag); + } else { + lv_obj_add_flag(target, flag); + } + } else if (value == _UI_MODIFY_FLAG_ADD) { + lv_obj_add_flag(target, flag); + } else { + lv_obj_clear_flag(target, flag); + } +} + +void _ui_state_modify(lv_obj_t *target, int32_t state, int value) +{ + if (value == _UI_MODIFY_STATE_TOGGLE) { + if (lv_obj_has_state(target, state)) { + lv_obj_clear_state(target, state); + } else { + lv_obj_add_state(target, state); + } + } else if (value == _UI_MODIFY_STATE_ADD) { + lv_obj_add_state(target, state); + } else { + lv_obj_clear_state(target, state); + } +} + +void scr_unloaded_delete_cb(lv_event_t *e) +{ + lv_obj_t **var = lv_event_get_user_data(e); + lv_obj_del(*var); + (*var) = NULL; +} + +void _ui_opacity_set(lv_obj_t *target, int val) +{ + lv_obj_set_style_opa(target, val, 0); +} + +void _ui_anim_callback_free_user_data(lv_anim_t *a) +{ + lv_mem_free(a->user_data); + a->user_data = NULL; +} + +void _ui_anim_callback_set_x(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_x(usr->target, v); +} + +void _ui_anim_callback_set_y(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_y(usr->target, v); +} + +void _ui_anim_callback_set_width(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_width(usr->target, v); +} + +void _ui_anim_callback_set_height(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_height(usr->target, v); +} + +void _ui_anim_callback_set_opacity(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_style_opa(usr->target, v, 0); +} + +void _ui_anim_callback_set_image_zoom(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_img_set_zoom(usr->target, v); +} + +void _ui_anim_callback_set_image_angle(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_img_set_angle(usr->target, v); +} + +void _ui_anim_callback_set_image_frame(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + usr->val = v; + if (v < 0) { + v = 0; + } + if (v >= usr->imgset_size) { + v = usr->imgset_size - 1; + } + lv_img_set_src(usr->target, usr->imgset[v]); +} + +int32_t _ui_anim_callback_get_x(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_x_aligned(usr->target); +} + +int32_t _ui_anim_callback_get_y(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_y_aligned(usr->target); +} + +int32_t _ui_anim_callback_get_width(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_width(usr->target); +} + +int32_t _ui_anim_callback_get_height(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_height(usr->target); +} + +int32_t _ui_anim_callback_get_opacity(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_style_opa(usr->target, 0); +} + +int32_t _ui_anim_callback_get_image_zoom(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_img_get_zoom(usr->target); +} + +int32_t _ui_anim_callback_get_image_angle(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_img_get_angle(usr->target); +} + +int32_t _ui_anim_callback_get_image_frame(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return usr->val; +} + +void _ui_arc_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix) +{ + char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; + lv_snprintf(buf, + sizeof(buf), + "%s%d%s", + prefix, + (int)lv_arc_get_value(src), + postfix); + lv_label_set_text(trg, buf); +} + +void _ui_slider_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix) +{ + char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; + lv_snprintf(buf, + sizeof(buf), + "%s%d%s", + prefix, + (int)lv_slider_get_value(src), + postfix); + lv_label_set_text(trg, buf); +} + +void _ui_checked_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *txt_on, + const char *txt_off) +{ + if (lv_obj_has_state(src, LV_STATE_CHECKED)) { + lv_label_set_text(trg, txt_on); + } else { + lv_label_set_text(trg, txt_off); + } +} + +void _ui_spinbox_step(lv_obj_t *target, int val) +{ + if (val > 0) { + lv_spinbox_increment(target); + } else { + lv_spinbox_decrement(target); + } + + lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_helpers.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_helpers.h new file mode 100644 index 00000000..67cf9b50 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/double_buffered_dma/ui_helpers.h @@ -0,0 +1,136 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#ifndef _SQUARELINE_PROJECT_UI_HELPERS_H +#define _SQUARELINE_PROJECT_UI_HELPERS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ui.h" + +#define _UI_TEMPORARY_STRING_BUFFER_SIZE 32 +#define _UI_BAR_PROPERTY_VALUE 0 +#define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1 +void _ui_bar_set_property(lv_obj_t *target, int id, int val); + +#define _UI_BASIC_PROPERTY_POSITION_X 0 +#define _UI_BASIC_PROPERTY_POSITION_Y 1 +#define _UI_BASIC_PROPERTY_WIDTH 2 +#define _UI_BASIC_PROPERTY_HEIGHT 3 +void _ui_basic_set_property(lv_obj_t *target, int id, int val); + +#define _UI_DROPDOWN_PROPERTY_SELECTED 0 +void _ui_dropdown_set_property(lv_obj_t *target, int id, int val); + +#define _UI_IMAGE_PROPERTY_IMAGE 0 +void _ui_image_set_property(lv_obj_t *target, int id, uint8_t *val); + +#define _UI_LABEL_PROPERTY_TEXT 0 +void _ui_label_set_property(lv_obj_t *target, int id, const char *val); + +#define _UI_ROLLER_PROPERTY_SELECTED 0 +#define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1 +void _ui_roller_set_property(lv_obj_t *target, int id, int val); + +#define _UI_SLIDER_PROPERTY_VALUE 0 +#define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1 +void _ui_slider_set_property(lv_obj_t *target, int id, int val); + +void _ui_screen_change(lv_obj_t **target, + lv_scr_load_anim_t fademode, + int spd, + int delay, + void (*target_init)(void)); + +void _ui_screen_delete(lv_obj_t **target); + +void _ui_arc_increment(lv_obj_t *target, int val); + +void _ui_bar_increment(lv_obj_t *target, int val, int anm); + +void _ui_slider_increment(lv_obj_t *target, int val, int anm); + +void _ui_keyboard_set_target(lv_obj_t *keyboard, lv_obj_t *textarea); + +#define _UI_MODIFY_FLAG_ADD 0 +#define _UI_MODIFY_FLAG_REMOVE 1 +#define _UI_MODIFY_FLAG_TOGGLE 2 +void _ui_flag_modify(lv_obj_t *target, int32_t flag, int value); + +#define _UI_MODIFY_STATE_ADD 0 +#define _UI_MODIFY_STATE_REMOVE 1 +#define _UI_MODIFY_STATE_TOGGLE 2 +void _ui_state_modify(lv_obj_t *target, int32_t state, int value); + +void scr_unloaded_delete_cb(lv_event_t *e); + +void _ui_opacity_set(lv_obj_t *target, int val); + +/** Describes an animation*/ +typedef struct _ui_anim_user_data_t { + lv_obj_t *target; + lv_img_dsc_t **imgset; + int32_t imgset_size; + int32_t val; +} ui_anim_user_data_t; +void _ui_anim_callback_free_user_data(lv_anim_t *a); + +void _ui_anim_callback_set_x(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_y(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_width(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_height(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_opacity(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_image_zoom(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_image_angle(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_image_frame(lv_anim_t *a, int32_t v); + +int32_t _ui_anim_callback_get_x(lv_anim_t *a); + +int32_t _ui_anim_callback_get_y(lv_anim_t *a); + +int32_t _ui_anim_callback_get_width(lv_anim_t *a); + +int32_t _ui_anim_callback_get_height(lv_anim_t *a); + +int32_t _ui_anim_callback_get_opacity(lv_anim_t *a); + +int32_t _ui_anim_callback_get_image_zoom(lv_anim_t *a); + +int32_t _ui_anim_callback_get_image_angle(lv_anim_t *a); + +int32_t _ui_anim_callback_get_image_frame(lv_anim_t *a); + +void _ui_arc_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix); + +void _ui_slider_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix); + +void _ui_checked_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *txt_on, + const char *txt_off); + +void _ui_spinbox_step(lv_obj_t *target, int val) +; + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/CMakeLists.txt b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/CMakeLists.txt new file mode 100644 index 00000000..6a69b407 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/CMakeLists.txt @@ -0,0 +1,9 @@ +SET(SOURCES screens/ui_loader.c + screens/ui_main.c + ui.c + components/ui_comp_hook.c + ui_helpers.c + images/ui_img_2106501360.c + images/ui_img_1802009198.c) + +add_library(ui ${SOURCES}) diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/components/ui_comp_hook.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/components/ui_comp_hook.c new file mode 100644 index 00000000..45656b41 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/components/ui_comp_hook.c @@ -0,0 +1,4 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/filelist.txt b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/filelist.txt new file mode 100644 index 00000000..62c979d6 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/filelist.txt @@ -0,0 +1,7 @@ +screens/ui_loader.c +screens/ui_main.c +ui.c +components/ui_comp_hook.c +ui_helpers.c +images/ui_img_2106501360.c +images/ui_img_1802009198.c diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/images/ui_img_1802009198.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/images/ui_img_1802009198.c new file mode 100644 index 00000000..2b184ad5 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/images/ui_img_1802009198.c @@ -0,0 +1,778 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +// IMAGE DATA: assets\silabs-logo.png +const LV_ATTRIBUTE_MEM_ALIGN uint8_t ui_img_1802009198_data[] = { + 0x00, 0x00, 0x59, 0x00, 0x00, 0x98, 0x00, 0x00, 0x95, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, + 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, + 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, 0x94, 0x00, 0x00, + 0x94, 0x00, 0x00, 0x95, 0x00, 0x00, 0x95, 0x00, 0x00, 0x9B, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x10, + 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x18, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, + 0x20, 0x20, 0xFF, 0x41, 0x28, 0xFF, 0x41, 0x28, 0xFF, 0x41, 0x28, 0xFF, 0x21, + 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x18, 0xFF, 0x00, 0x30, 0xFF, 0x00, 0x48, 0xFF, 0x21, 0x58, 0xFF, 0x21, + 0x68, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x68, + 0xFF, 0x21, 0x58, 0xFF, 0x20, 0x40, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x38, 0xFF, 0x41, 0x68, 0xFF, 0x20, 0x38, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x21, 0x38, + 0xFF, 0x41, 0x48, 0xFF, 0x41, 0x48, 0xFF, 0x41, 0x38, 0xFF, + 0x20, 0x20, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x30, + 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xB0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xE0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x21, 0xB8, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x70, 0xFF, 0x20, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, + 0xFF, 0x21, 0x68, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x88, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, + 0x48, 0xFF, 0x21, 0x70, 0xFF, 0x41, 0x70, 0xFF, 0x21, 0x50, 0xFF, 0x20, 0x28, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, + 0x50, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0xC0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xB0, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x21, 0xC0, + 0xFF, 0x02, 0xE8, 0xFF, 0x21, 0xB8, 0xFF, 0x20, 0x40, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, + 0x21, 0x70, 0xFF, 0x42, 0xA0, 0xFF, 0x42, 0x90, 0xFF, 0x21, 0x50, 0xFF, 0x00, + 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x21, 0x50, 0xFF, 0x21, 0xA8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xE8, + 0xFF, 0x41, 0x78, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x22, 0xC0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, + 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x40, + 0xFF, 0x21, 0x88, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xB0, 0xFF, 0x21, 0x58, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x20, 0xFF, 0x21, 0x90, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xA8, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x21, + 0xA0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, + 0xFF, 0x42, 0x98, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, + 0x48, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xE0, 0xFF, 0x21, 0x80, + 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0xB0, 0xFF, 0x01, 0xE0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, + 0xB8, 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x30, 0xFF, + 0x21, 0x70, 0xFF, 0x21, 0xB8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xC0, 0xFF, 0x20, 0x28, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x38, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xE0, 0xFF, 0x21, 0x70, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x41, + 0x98, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xC8, 0xFF, 0x01, + 0xB8, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x68, + 0xFF, 0x22, 0xA0, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x21, 0xC8, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x18, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0x90, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x20, 0xFF, 0x21, 0xC8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xB8, + 0xFF, 0x21, 0xA8, 0xFF, 0x01, 0x90, 0xFF, 0x21, 0x80, 0xFF, 0x21, 0x70, 0xFF, + 0x20, 0x60, 0xFF, 0x20, 0x50, 0xFF, 0x21, 0x48, 0xFF, 0x20, 0x40, 0xFF, 0x20, + 0x40, 0xFF, 0x00, 0x40, 0xFF, 0x00, 0x40, 0xFF, 0x00, 0x40, 0xFF, 0x21, 0x48, + 0xFF, 0x21, 0x50, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x80, 0xFF, + 0x21, 0x98, 0xFF, 0x21, 0xB8, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xE8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xA8, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x22, 0xB0, 0xFF, 0x01, 0xE0, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x21, 0x48, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x10, 0xFF, 0x22, 0x98, 0xFF, 0x01, 0xE8, 0xFF, 0x21, 0xB0, 0xFF, 0x21, + 0x58, 0xFF, 0x20, 0x28, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x10, 0xFF, + 0x20, 0x30, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xC8, 0xFF, 0x01, + 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x22, 0xD8, 0xFF, 0x21, 0x58, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, + 0x58, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0x60, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, + 0x21, 0x90, 0xFF, 0x21, 0xC0, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0x60, 0xFF, 0x00, + 0x40, 0xFF, 0x00, 0x38, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x28, 0xFF, 0x20, 0x20, + 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x42, 0x90, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xB8, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x38, 0xFF, + 0x21, 0x80, 0xFF, 0x21, 0xA0, 0xFF, 0x42, 0xA8, 0xFF, 0x41, 0xA8, 0xFF, 0x21, + 0xA8, 0xFF, 0x21, 0xA0, 0xFF, 0x42, 0xA0, 0xFF, 0x42, 0xA8, 0xFF, 0x42, 0xA8, + 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x90, 0xFF, 0x41, 0x70, 0xFF, 0x20, 0x40, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, + 0xFF, 0x22, 0xA0, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x22, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x22, 0xC0, 0xFF, 0x21, 0x68, 0xFF, 0x20, 0x20, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x18, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x30, 0xFF, 0x00, + 0x30, 0xFF, 0x00, 0x38, 0xFF, 0x20, 0x40, 0xFF, 0x00, 0x48, 0xFF, 0x21, 0x58, + 0xFF, 0x41, 0x80, 0xFF, 0x42, 0xB8, 0xFF, 0x21, 0xA8, 0xFF, + 0x21, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x38, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x21, 0xE0, 0xFF, 0x21, 0x90, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, + 0xFF, 0x22, 0xA8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xE0, + 0xFF, 0x21, 0xB8, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x30, 0xFF, + 0x00, 0x18, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x18, 0xFF, 0x20, 0x20, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x48, 0xFF, 0x21, 0x68, + 0xFF, 0x01, 0xB8, 0xFF, 0x01, 0xE8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x38, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x38, 0xFF, 0x21, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x68, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x48, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE8, 0xFF, 0x01, 0xF0, + 0xFF, 0x01, 0xE0, 0xFF, 0x02, 0xD0, 0xFF, 0x22, 0xB0, 0xFF, + 0x21, 0x98, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x70, 0xFF, 0x21, + 0x68, 0xFF, 0x21, 0x68, 0xFF, 0x20, 0x68, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x68, + 0xFF, 0x21, 0x68, 0xFF, 0x41, 0x70, 0xFF, 0x21, 0x78, 0xFF, 0x21, 0x88, 0xFF, + 0x21, 0x98, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0xB0, 0xFF, 0x21, 0xC0, 0xFF, 0x21, + 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x21, 0xE8, 0xFF, 0x41, 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x21, 0x90, 0xFF, 0x01, 0xE8, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0x98, 0xFF, + 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, + 0x68, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD8, 0xFF, 0x41, 0xA0, 0xFF, 0x21, + 0x50, 0xFF, 0x00, 0x40, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xB0, + 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x38, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x88, 0xFF, 0x22, 0xE0, 0xFF, 0x21, 0xA8, + 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x58, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, 0xC0, 0xFF, + 0x41, 0x60, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, 0xFF, 0x21, 0x60, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x22, + 0xC8, 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x30, 0xFF, 0x42, 0x90, 0xFF, 0x42, + 0xB0, 0xFF, 0x21, 0x60, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x21, 0xB8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x22, 0xA0, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x18, 0xFF, 0x22, 0xA8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, + 0x22, 0xD8, 0xFF, 0x41, 0xA0, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, 0xFF, + 0x41, 0x48, 0xFF, 0x62, 0x78, 0xFF, 0x21, 0x58, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x21, 0x48, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xA0, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x22, 0xC0, 0xFF, 0x01, + 0xE8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, + 0xFF, 0x21, 0xC0, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0x50, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x10, + 0xFF, 0x41, 0x28, 0xFF, 0x41, 0x38, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x48, 0xFF, + 0x21, 0xC0, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x20, + 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0xC0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xE0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, + 0xD0, 0xFF, 0x22, 0xB8, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0x60, 0xFF, 0x20, 0x30, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x80, 0xFF, + 0x21, 0xC0, 0xFF, 0x21, 0xE0, 0xFF, 0x21, 0x98, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x50, 0xFF, 0x21, + 0x78, 0xFF, 0x21, 0x90, 0xFF, 0x21, 0xA0, 0xFF, 0x01, 0xA8, 0xFF, 0x01, 0xA8, + 0xFF, 0x01, 0xA8, 0xFF, 0x01, 0xA0, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0x88, 0xFF, + 0x21, 0x70, 0xFF, 0x20, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x28, 0xFF, + 0x21, 0x68, 0xFF, 0x21, 0xA0, 0xFF, 0x41, 0x80, 0xFF, 0x41, 0x38, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x20, 0x30, 0xFF, 0x41, 0x40, 0xFF, 0x41, 0x30, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x04, 0x21, 0xFF, 0x51, 0x8C, 0xFF, 0x34, 0xA5, 0xFF, 0xB2, + 0x94, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xCF, 0x7B, + 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x2C, 0x63, 0xFF, + 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x2C, + 0x63, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0xD3, 0x9C, + 0xFF, 0x14, 0xA5, 0xFF, 0xCF, 0x7B, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, + 0xE7, 0x39, 0xFF, 0xB2, 0x94, 0xFF, 0x14, 0xA5, 0xFF, 0xEF, 0x7B, 0xFF, 0xA2, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0x8A, 0x52, 0xFF, 0x20, 0x00, + 0xFF, 0x4D, 0x6B, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x24, 0x21, 0xFF, 0xAE, 0x73, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, + 0xEF, 0x7B, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, + 0x42, 0xFF, 0xD3, 0x9C, 0xFF, 0xF3, 0x9C, 0xFF, 0x92, 0x94, 0xFF, 0x86, 0x31, + 0xFF, 0x00, 0x00, 0xFF, 0x49, 0x4A, 0xFF, 0xD3, 0x9C, 0xFF, 0x14, 0xA5, 0xFF, + 0xEF, 0x7B, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x10, 0x84, 0xFF, + 0x18, 0xC6, 0xFF, 0x8E, 0x73, 0xFF, 0x38, 0xC6, 0xFF, 0xB2, 0x94, 0xFF, 0x00, + 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x79, 0xCE, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, + 0xFF, 0xEF, 0x7B, 0xFF, 0x75, 0xAD, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x96, 0xB5, 0xFF, 0x20, 0x00, 0xFF, 0x41, + 0x08, 0xFF, 0xB6, 0xB5, 0xFF, 0x96, 0xB5, 0xFF, 0x30, 0x84, 0xFF, 0xBA, 0xD6, + 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, 0x75, 0xAD, 0xFF, + 0xD7, 0xBD, 0xFF, 0x10, 0x84, 0xFF, 0x9A, 0xD6, 0xFF, 0xAA, 0x52, 0xFF, 0x00, + 0x00, 0xFF, 0x96, 0xB5, 0xFF, 0x38, 0xC6, 0xFF, 0xC3, 0x18, 0xFF, 0x75, 0xAD, + 0xFF, 0xEF, 0x7B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x59, + 0xCE, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x51, 0x8C, 0xFF, 0xDF, 0xFF, 0xFF, 0xC7, 0x39, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xEF, 0x7B, 0xFF, 0x9A, 0xD6, 0xFF, 0xCF, + 0x7B, 0xFF, 0xF7, 0xBD, 0xFF, 0xB2, 0x94, 0xFF, 0x82, 0x10, 0xFF, 0xB6, 0xB5, + 0xFF, 0x14, 0xA5, 0xFF, 0x10, 0x84, 0xFF, 0xDB, 0xDE, 0xFF, 0x69, 0x4A, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0xB6, 0xB5, 0xFF, 0x61, 0x08, 0xFF, + 0xE3, 0x18, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x18, + 0xC6, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0x14, 0xA5, + 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x2C, 0x63, 0xFF, 0x34, 0xA5, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xF7, + 0xBD, 0xFF, 0xAA, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0xE3, 0x18, + 0xFF, 0x61, 0x08, 0xFF, 0xB6, 0xB5, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, + 0x55, 0xAD, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0xBE, + 0xF7, 0xFF, 0x8A, 0x52, 0xFF, 0xD3, 0x9C, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, 0xF7, 0xBD, 0xFF, 0x65, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x55, 0xAD, + 0xFF, 0x1C, 0xE7, 0xFF, 0x4D, 0x6B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x10, 0x84, 0xFF, 0x71, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x34, + 0xA5, 0xFF, 0xC3, 0x18, 0xFF, 0xF7, 0xBD, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, + 0xFF, 0xA6, 0x31, 0xFF, 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x86, 0x31, + 0xFF, 0x96, 0xB5, 0xFF, 0x59, 0xCE, 0xFF, 0x0C, 0x63, 0xFF, + 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x18, 0xC6, 0xFF, 0x28, + 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0x14, 0xA5, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x2C, 0x63, 0xFF, 0x34, 0xA5, 0xFF, + 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xD7, 0xBD, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x96, 0xB5, + 0xFF, 0x2C, 0x63, 0xFF, 0x20, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0x0C, 0x63, 0xFF, + 0x00, 0x00, 0xFF, 0x92, 0x94, 0xFF, 0x1C, 0xE7, 0xFF, 0x14, 0xA5, 0xFF, 0x34, + 0xA5, 0xFF, 0x8E, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, + 0xD7, 0xBD, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x14, 0xA5, 0xFF, 0xCF, 0x7B, 0xFF, 0xF3, 0x9C, + 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0x59, 0xCE, 0xFF, + 0x30, 0x84, 0xFF, 0x75, 0xAD, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x0C, + 0x63, 0xFF, 0x9A, 0xD6, 0xFF, 0x75, 0xAD, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, + 0xFF, 0x6D, 0x6B, 0xFF, 0xBA, 0xD6, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, 0xFF, + 0x24, 0x21, 0xFF, 0x18, 0xC6, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, + 0x73, 0xFF, 0x14, 0xA5, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x2C, 0x63, 0xFF, 0x34, 0xA5, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, + 0xD7, 0xBD, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x96, 0xB5, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, + 0xFF, 0x55, 0xAD, 0xFF, 0x0C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0xB2, 0x94, 0xFF, + 0x92, 0x94, 0xFF, 0xB6, 0xB5, 0xFF, 0xFB, 0xDE, 0xFF, 0x2C, 0x63, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, 0xD7, 0xBD, 0xFF, 0x65, 0x29, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0x55, + 0xAD, 0xFF, 0xCB, 0x5A, 0xFF, 0xF7, 0xBD, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, + 0xFF, 0xAE, 0x73, 0xFF, 0x59, 0xCE, 0xFF, 0x30, 0x84, 0xFF, + 0x75, 0xAD, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x65, + 0x29, 0xFF, 0x14, 0xA5, 0xFF, 0x79, 0xCE, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x49, 0x4A, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x10, 0x84, + 0xFF, 0x14, 0xA5, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0x18, 0xC6, 0xFF, + 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xF3, 0x9C, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0x34, 0xA5, + 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x18, 0xC6, 0xFF, 0x8A, 0x52, 0xFF, + 0x00, 0x00, 0xFF, 0xEB, 0x5A, 0xFF, 0x86, 0x31, 0xFF, 0x41, 0x08, 0xFF, 0xB6, + 0xB5, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0x2C, 0x63, + 0xFF, 0x00, 0x00, 0xFF, 0x14, 0xA5, 0xFF, 0x4D, 0x6B, 0xFF, 0xEF, 0x7B, 0xFF, + 0xFF, 0xFF, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, + 0xFF, 0xD7, 0xBD, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0xDB, 0xDE, 0xFF, 0xD7, + 0xBD, 0xFF, 0xDB, 0xDE, 0xFF, 0x8A, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x10, 0x84, + 0xFF, 0x71, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x55, 0xAD, 0xFF, + 0x82, 0x10, 0xFF, 0xCB, 0x5A, 0xFF, 0xC3, 0x18, 0xFF, 0x20, 0x00, 0xFF, 0xF7, + 0xBD, 0xFF, 0xEB, 0x5A, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x51, 0x8C, 0xFF, 0x9A, + 0xD6, 0xFF, 0xCF, 0x7B, 0xFF, 0xF7, 0xBD, 0xFF, 0x71, 0x8C, 0xFF, 0x00, 0x00, + 0xFF, 0x45, 0x29, 0xFF, 0x79, 0xCE, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, + 0xAE, 0x73, 0xFF, 0xBA, 0xD6, 0xFF, 0x30, 0x84, 0xFF, 0x10, 0x84, 0xFF, 0xE3, + 0x18, 0xFF, 0x2C, 0x63, 0xFF, 0x96, 0xB5, 0xFF, 0x20, 0x00, 0xFF, 0x61, 0x08, + 0xFF, 0xB6, 0xB5, 0xFF, 0x96, 0xB5, 0xFF, 0x10, 0x84, 0xFF, 0xFB, 0xDE, 0xFF, + 0xAA, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0xB6, 0xB5, 0xFF, 0xEF, + 0x7B, 0xFF, 0x9A, 0xD6, 0xFF, 0xAA, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x96, 0xB5, + 0xFF, 0x8E, 0x73, 0xFF, 0x65, 0x29, 0xFF, 0x7D, 0xEF, 0xFF, + 0xAE, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xBA, 0xD6, + 0xFF, 0xD3, 0x9C, 0xFF, 0x30, 0x84, 0xFF, 0xE7, 0x39, 0xFF, 0x24, 0x21, 0xFF, + 0x38, 0xC6, 0xFF, 0x0C, 0x63, 0xFF, 0x65, 0x29, 0xFF, 0x55, 0xAD, 0xFF, 0xD3, + 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0xCF, 0x7B, 0xFF, 0x79, 0xCE, 0xFF, 0xCF, 0x7B, + 0xFF, 0xF7, 0xBD, 0xFF, 0xB2, 0x94, 0xFF, 0xA2, 0x10, 0xFF, 0xF7, 0xBD, 0xFF, + 0x55, 0xAD, 0xFF, 0x10, 0x84, 0xFF, 0x79, 0xCE, 0xFF, 0x49, 0x4A, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x45, 0x29, 0xFF, 0x51, 0x8C, 0xFF, 0x14, 0xA5, 0xFF, 0x92, + 0x94, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xAE, 0x73, + 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0xB2, 0x94, 0xFF, + 0xF3, 0x9C, 0xFF, 0xD3, 0x9C, 0xFF, 0x24, 0x21, 0xFF, 0xA6, 0x31, 0xFF, 0x2C, + 0x63, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0xD3, 0x9C, + 0xFF, 0x14, 0xA5, 0xFF, 0xCF, 0x7B, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0xB2, 0x94, 0xFF, 0x14, 0xA5, 0xFF, 0xEF, + 0x7B, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x2C, 0x63, 0xFF, 0x28, 0x42, + 0xFF, 0x20, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x10, 0x84, 0xFF, 0xF3, 0x9C, 0xFF, 0x14, 0xA5, + 0xFF, 0x49, 0x4A, 0xFF, 0x45, 0x29, 0xFF, 0x8E, 0x73, 0xFF, 0x61, 0x08, 0xFF, + 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x6D, 0x6B, 0xFF, 0x20, 0x00, 0xFF, 0xE7, + 0x39, 0xFF, 0xB2, 0x94, 0xFF, 0xF3, 0x9C, 0xFF, 0x92, 0x94, 0xFF, 0xA6, 0x31, + 0xFF, 0x00, 0x00, 0xFF, 0x8A, 0x52, 0xFF, 0xF3, 0x9C, 0xFF, 0xF3, 0x9C, 0xFF, + 0x8E, 0x73, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x93, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x95, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0x96, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, +}; +const lv_img_dsc_t ui_img_1802009198 = { + .header.always_zero = 0, + .header.w = 75, + .header.h = 43, + .data_size = sizeof(ui_img_1802009198_data), + .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, + .data = ui_img_1802009198_data +}; diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/images/ui_img_2106501360.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/images/ui_img_2106501360.c new file mode 100644 index 00000000..b38ba0c1 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/images/ui_img_2106501360.c @@ -0,0 +1,2409 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +#ifndef LV_ATTRIBUTE_MEM_ALIGN +#define LV_ATTRIBUTE_MEM_ALIGN +#endif + +// IMAGE DATA: assets\silabs-logo-large.png +const LV_ATTRIBUTE_MEM_ALIGN uint8_t ui_img_2106501360_data[] = { + 0x00, 0x00, 0x73, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xB7, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x01, 0x10, 0xFF, 0x00, 0x10, + 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x20, 0x18, 0xFF, 0x41, 0x20, + 0xFF, 0x21, 0x28, 0xFF, 0x21, 0x28, 0xFF, 0x21, 0x20, 0xFF, 0x20, 0x18, 0xFF, + 0x01, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x41, 0x30, 0xFF, 0x20, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, + 0xFF, 0x41, 0x30, 0xFF, 0x62, 0x40, 0xFF, 0x62, 0x40, 0xFF, 0x82, 0x38, 0xFF, + 0x41, 0x28, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x28, 0xFF, 0x20, 0x40, 0xFF, 0x21, 0x50, + 0xFF, 0x21, 0x60, 0xFF, 0x42, 0x68, 0xFF, 0x41, 0x68, 0xFF, 0x41, 0x68, 0xFF, + 0x41, 0x68, 0xFF, 0x41, 0x68, 0xFF, 0x42, 0x60, 0xFF, 0x21, 0x50, 0xFF, 0x20, + 0x40, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, + 0x28, 0xFF, 0x82, 0x68, 0xFF, 0x42, 0x78, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x41, 0x38, 0xFF, 0x62, 0x58, 0xFF, + 0x62, 0x58, 0xFF, 0x82, 0x48, 0xFF, 0x61, 0x38, 0xFF, 0x21, 0x20, 0xFF, 0x20, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0x40, 0xFF, 0x41, 0x68, + 0xFF, 0x42, 0x88, 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0xB8, 0xFF, 0x02, 0xC0, 0xFF, + 0x22, 0xC8, 0xFF, 0x21, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x21, 0xD0, 0xFF, 0x21, + 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x02, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x42, 0xC0, 0xFF, 0x42, 0xB8, 0xFF, 0x21, 0xB0, 0xFF, + 0x21, 0x98, 0xFF, 0x61, 0x78, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x30, 0xFF, 0x00, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x22, 0x88, 0xFF, + 0x43, 0xC0, 0xFF, 0x41, 0x98, 0xFF, 0x41, 0x50, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, + 0x20, 0x30, 0xFF, 0x41, 0x58, 0xFF, 0x82, 0x70, 0xFF, 0x83, 0x70, 0xFF, 0x62, + 0x58, 0xFF, 0x41, 0x38, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, + 0xFF, 0x21, 0x40, 0xFF, 0x21, 0x70, 0xFF, 0x42, 0x98, 0xFF, 0x42, 0xB8, 0xFF, + 0x22, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0x70, 0xFF, + 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x22, 0xA0, 0xFF, 0x01, 0xE0, 0xFF, 0x42, 0xD0, + 0xFF, 0x63, 0x90, 0xFF, 0x21, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x40, 0xFF, 0x21, + 0x70, 0xFF, 0x42, 0x98, 0xFF, 0x82, 0x90, 0xFF, 0x62, 0x68, 0xFF, 0x20, 0x38, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x38, 0xFF, + 0x21, 0x70, 0xFF, 0x42, 0xA8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x02, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0xB0, 0xFF, 0x21, 0x58, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x50, 0xFF, + 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, + 0x70, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x38, 0xFF, 0x01, 0x78, 0xFF, 0x42, 0xA8, + 0xFF, 0x62, 0xB0, 0xFF, 0x62, 0x88, 0xFF, 0x21, 0x48, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x58, 0xFF, 0x22, + 0x98, 0xFF, 0x22, 0xC0, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x43, 0xC0, 0xFF, 0x41, 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x38, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x42, 0xD0, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x70, 0xFF, 0x42, 0xA0, 0xFF, 0x63, 0xC8, 0xFF, + 0x63, 0xC0, 0xFF, 0x42, 0x78, 0xFF, 0x20, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x41, 0x58, 0xFF, 0x42, 0xA8, + 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x62, 0xA0, 0xFF, 0x00, 0x10, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x58, 0xFF, 0x02, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x22, + 0xD8, 0xFF, 0x42, 0x98, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, + 0x21, 0x48, 0xFF, 0x42, 0x90, 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xD8, 0xFF, 0x42, + 0xC0, 0xFF, 0x41, 0x78, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x42, 0xA0, 0xFF, + 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD8, 0xFF, + 0x62, 0xA8, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x41, + 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0x80, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x41, + 0x68, 0xFF, 0x41, 0xA8, 0xFF, 0x22, 0xD0, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xC8, + 0xFF, 0x41, 0x78, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x42, 0x78, 0xFF, 0x22, + 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x00, 0xC8, 0xFF, 0x00, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x23, 0xC8, 0xFF, 0x42, 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, + 0xFF, 0x42, 0x80, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x62, 0xC0, 0xFF, 0x41, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x38, 0xFF, 0x41, 0x80, + 0xFF, 0x22, 0xC0, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x42, 0xD8, 0xFF, + 0x41, 0x98, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x38, 0xFF, 0x62, 0xA8, + 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x42, 0xA0, 0xFF, 0x21, 0x40, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x30, 0xFF, 0x41, 0x90, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x62, 0x78, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x21, 0x90, 0xFF, + 0x42, 0xC8, 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x42, + 0xC8, 0xFF, 0x41, 0x70, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x40, 0xFF, 0x62, 0xB0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x41, 0xA0, 0xFF, 0x20, 0x38, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, + 0x40, 0xFF, 0x21, 0x88, 0xFF, 0x21, 0xC0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x40, 0xFF, 0x22, 0x90, 0xFF, 0x22, + 0xC0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x60, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, 0xA8, 0xFF, 0x02, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xC0, + 0xFF, 0x42, 0xA8, 0xFF, 0x42, 0x98, 0xFF, 0x21, 0x80, 0xFF, 0x41, 0x68, 0xFF, + 0x41, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x21, 0x48, 0xFF, 0x21, 0x80, + 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x62, 0xA8, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x42, 0x88, 0xFF, 0x22, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, 0x60, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x62, 0x70, 0xFF, 0x42, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x02, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x41, 0xC8, 0xFF, 0x42, 0xC0, 0xFF, 0x22, 0xB8, + 0xFF, 0x42, 0xA8, 0xFF, 0x41, 0x90, 0xFF, 0x41, 0x88, 0xFF, + 0x22, 0xB0, 0xFF, 0x22, 0xC8, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x41, 0x70, 0xFF, 0x22, 0xC0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x42, 0x78, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x61, + 0xA0, 0xFF, 0x00, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x02, + 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xB8, + 0xFF, 0x21, 0xB0, 0xFF, 0x41, 0xA8, 0xFF, 0x41, 0x98, 0xFF, 0x62, 0x90, 0xFF, + 0x62, 0x88, 0xFF, 0x42, 0x80, 0xFF, 0x41, 0x78, 0xFF, 0x21, 0x78, 0xFF, 0x41, + 0x70, 0xFF, 0x41, 0x70, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x70, 0xFF, 0x21, 0x70, + 0xFF, 0x21, 0x78, 0xFF, 0x42, 0x80, 0xFF, 0x42, 0x88, 0xFF, 0x42, 0x88, 0xFF, + 0x42, 0x90, 0xFF, 0x41, 0xA0, 0xFF, 0x41, 0xB0, 0xFF, 0x42, 0xB8, 0xFF, 0x21, + 0xC0, 0xFF, 0x21, 0xC8, 0xFF, 0x21, 0xD0, 0xFF, 0x41, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0x78, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x48, 0xFF, 0x42, 0xA8, 0xFF, 0x22, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x42, 0xB8, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x10, 0xFF, 0x42, 0xA8, 0xFF, 0x00, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x22, + 0xD0, 0xFF, 0x62, 0xC0, 0xFF, 0x62, 0xB0, 0xFF, 0x62, 0xA8, 0xFF, 0x42, 0x90, + 0xFF, 0x22, 0x80, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x50, 0xFF, 0x21, 0x38, 0xFF, + 0x21, 0x30, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x10, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x18, + 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x30, 0xFF, 0x20, 0x40, 0xFF, + 0x40, 0x58, 0xFF, 0x41, 0x78, 0xFF, 0x21, 0x88, 0xFF, 0x42, 0xA0, 0xFF, 0x62, + 0xB8, 0xFF, 0x22, 0xC8, 0xFF, 0x02, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x43, 0xC8, 0xFF, 0x41, + 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x22, 0x80, 0xFF, 0x22, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x41, 0x80, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x42, 0x80, 0xFF, 0x22, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xB8, 0xFF, 0x41, 0x88, + 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x28, 0xFF, 0x21, 0x48, 0xFF, 0x41, 0x70, 0xFF, + 0x42, 0xA0, 0xFF, 0x41, 0xC0, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, + 0xFF, 0x62, 0x90, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x38, 0xFF, + 0x63, 0x98, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x41, 0x70, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x28, 0xFF, 0x42, 0xA8, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, + 0x22, 0xB8, 0xFF, 0x21, 0x50, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x38, 0xFF, 0x21, 0x80, + 0xFF, 0x22, 0xB8, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x42, 0xC0, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x48, 0xFF, 0x22, 0xB8, 0xFF, 0x02, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x42, 0x90, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, + 0x90, 0xFF, 0x42, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x42, 0xA8, + 0xFF, 0x41, 0x70, 0xFF, 0x20, 0x50, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x18, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x61, 0x80, 0xFF, 0x42, + 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x43, 0xC8, 0xFF, 0x41, 0x60, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x21, 0x58, 0xFF, 0x42, 0xC0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xC0, 0xFF, 0x21, 0x40, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x48, 0xFF, 0x41, 0x88, 0xFF, + 0x41, 0xB8, 0xFF, 0x42, 0xD8, 0xFF, 0x42, 0xD8, 0xFF, 0x42, 0xD0, 0xFF, 0x22, + 0xC0, 0xFF, 0x42, 0xB0, 0xFF, 0x22, 0xA8, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0x88, + 0xFF, 0x21, 0x80, 0xFF, 0x41, 0x78, 0xFF, 0x41, 0x70, 0xFF, + 0x61, 0x70, 0xFF, 0x41, 0x68, 0xFF, 0x21, 0x68, 0xFF, 0x21, 0x60, 0xFF, 0x21, + 0x58, 0xFF, 0x00, 0x48, 0xFF, 0x20, 0x28, 0xFF, 0x20, 0x20, 0xFF, 0x00, 0x10, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x60, 0xFF, 0x22, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0x80, 0xFF, + 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x50, 0xFF, 0x42, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x43, 0xB0, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0x58, 0xFF, 0x21, 0x80, + 0xFF, 0x42, 0xA0, 0xFF, 0x42, 0xB8, 0xFF, 0x42, 0xC8, 0xFF, + 0x41, 0xC8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x22, + 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xD8, 0xFF, 0x42, 0xD8, 0xFF, 0x22, 0xD8, + 0xFF, 0x21, 0xD8, 0xFF, 0x42, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xC8, 0xFF, + 0x42, 0xB8, 0xFF, 0x41, 0x98, 0xFF, 0x41, 0x78, 0xFF, 0x21, 0x48, 0xFF, 0x20, + 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x70, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD0, 0xFF, 0x42, + 0x88, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x38, 0xFF, 0x63, 0xB8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x63, 0xB8, 0xFF, + 0x42, 0x58, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x20, 0xFF, 0x00, 0x30, 0xFF, 0x20, 0x38, 0xFF, 0x20, 0x40, 0xFF, 0x21, 0x40, + 0xFF, 0x21, 0x48, 0xFF, 0x01, 0x48, 0xFF, 0x01, 0x50, 0xFF, 0x00, 0x50, 0xFF, + 0x41, 0x58, 0xFF, 0x41, 0x68, 0xFF, 0x41, 0x70, 0xFF, 0x41, 0x80, 0xFF, 0x41, + 0x88, 0xFF, 0x02, 0xA0, 0xFF, 0x21, 0xB8, 0xFF, 0x41, 0xC8, 0xFF, 0x62, 0xD8, + 0xFF, 0x63, 0xD0, 0xFF, 0x42, 0xB0, 0xFF, 0x42, 0x78, 0xFF, 0x20, 0x28, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x20, 0xFF, 0x41, 0xB0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x22, 0xD0, + 0xFF, 0x42, 0x80, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x42, 0xA0, 0xFF, + 0x02, 0xE0, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xA0, 0xFF, 0x41, 0x50, + 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x10, 0xFF, + 0x00, 0x20, 0xFF, 0x21, 0x50, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD0, 0xFF, 0x21, + 0xD8, 0xFF, 0x42, 0xB8, 0xFF, 0x41, 0x60, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x22, + 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x00, 0xD8, 0xFF, 0x62, 0xC0, 0xFF, 0x21, 0x68, 0xFF, 0x00, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x68, 0xFF, 0x42, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x21, 0xD8, 0xFF, 0x42, 0xD0, 0xFF, 0x42, 0xA8, 0xFF, 0x41, 0x80, 0xFF, 0x21, + 0x50, 0xFF, 0x01, 0x28, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x18, 0xFF, 0x20, 0x28, 0xFF, 0x20, 0x40, 0xFF, 0x21, 0x80, + 0xFF, 0x02, 0xC0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x42, 0xD0, 0xFF, + 0x42, 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x98, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x22, 0xA8, 0xFF, 0x21, 0x40, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x28, 0xFF, 0x62, 0xB0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x00, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xB8, 0xFF, + 0x42, 0xA0, 0xFF, 0x42, 0x78, 0xFF, 0x41, 0x50, 0xFF, 0x21, 0x38, 0xFF, 0x00, + 0x20, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x28, 0xFF, 0x21, 0x38, 0xFF, 0x41, 0x40, 0xFF, 0x41, 0x50, 0xFF, 0x21, 0x70, + 0xFF, 0x41, 0x88, 0xFF, 0x42, 0x98, 0xFF, 0x22, 0xB0, 0xFF, 0x22, 0xC0, 0xFF, + 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x42, 0xB8, 0xFF, 0x21, 0x28, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x41, + 0xB8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x23, 0xC0, 0xFF, 0x42, 0x80, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x58, 0xFF, 0x42, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xD8, 0xFF, 0x22, 0xD0, + 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xB8, 0xFF, 0x42, 0xA0, 0xFF, 0x41, 0x90, 0xFF, + 0x41, 0x88, 0xFF, 0x21, 0x78, 0xFF, 0x41, 0x70, 0xFF, 0x41, 0x68, 0xFF, 0x41, + 0x60, 0xFF, 0x41, 0x58, 0xFF, 0x41, 0x50, 0xFF, 0x40, 0x50, 0xFF, 0x20, 0x50, + 0xFF, 0x00, 0x50, 0xFF, 0x20, 0x50, 0xFF, 0x41, 0x50, 0xFF, 0x41, 0x50, 0xFF, + 0x40, 0x58, 0xFF, 0x61, 0x60, 0xFF, 0x61, 0x60, 0xFF, 0x61, 0x68, 0xFF, 0x41, + 0x70, 0xFF, 0x41, 0x80, 0xFF, 0x42, 0x90, 0xFF, 0x41, 0x98, 0xFF, 0x41, 0xA8, + 0xFF, 0x42, 0xB0, 0xFF, 0x42, 0xB8, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, + 0x22, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x62, 0xC8, 0xFF, + 0x22, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x41, 0x78, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xA0, 0xFF, 0x21, 0x48, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x62, 0x80, + 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x42, + 0xC0, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0xB0, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, + 0xFF, 0x21, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD8, + 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, + 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x22, + 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, + 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x62, 0xB8, 0xFF, 0x41, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x50, 0xFF, 0x42, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x42, 0xB0, 0xFF, 0x22, 0x60, 0xFF, 0x00, 0x18, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x62, 0x90, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x42, 0xC0, + 0xFF, 0x62, 0x80, 0xFF, 0x41, 0x38, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x18, 0xFF, + 0x21, 0x38, 0xFF, 0x41, 0x60, 0xFF, 0x41, 0x88, 0xFF, 0x41, 0xA0, 0xFF, 0x42, + 0xC0, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x62, 0x78, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x21, 0x58, 0xFF, 0x41, 0xC0, 0xFF, 0x01, 0xE0, + 0xFF, 0x21, 0xD8, 0xFF, 0x42, 0xB0, 0xFF, 0x22, 0x70, 0xFF, 0x00, 0x20, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x88, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, + 0x62, 0x90, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x20, 0x30, 0xFF, 0x21, 0x58, 0xFF, 0x21, 0x78, 0xFF, + 0x21, 0xB0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD8, 0xFF, 0x62, + 0x98, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x68, 0xFF, 0x42, 0xD0, 0xFF, + 0x22, 0xD8, 0xFF, 0x62, 0xB8, 0xFF, 0x62, 0x78, 0xFF, 0x20, 0x28, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x70, 0xFF, 0x22, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x21, 0xD0, 0xFF, 0x62, + 0xB8, 0xFF, 0x41, 0x60, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x20, 0x20, 0xFF, 0x21, 0xA0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD0, + 0xFF, 0x62, 0x88, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, 0x90, 0xFF, 0x63, + 0xD0, 0xFF, 0x62, 0xB0, 0xFF, 0x42, 0x70, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x30, 0xFF, 0x42, 0xC0, + 0xFF, 0x00, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x22, 0xD0, + 0xFF, 0x22, 0xA0, 0xFF, 0x21, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x30, 0xFF, 0x42, 0xA8, 0xFF, 0x22, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x41, 0xD0, 0xFF, + 0x42, 0xC0, 0xFF, 0x21, 0x68, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x61, 0x68, 0xFF, 0x83, 0xB0, + 0xFF, 0x43, 0xA8, 0xFF, 0x21, 0x60, 0xFF, 0x20, 0x18, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x78, 0xFF, 0x42, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, + 0x42, 0xC8, 0xFF, 0x42, 0x70, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x42, 0x88, 0xFF, 0x22, + 0xE0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD8, 0xFF, 0x22, + 0xC8, 0xFF, 0x41, 0x88, 0xFF, 0x20, 0x30, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x41, 0x50, 0xFF, 0x83, 0x80, 0xFF, + 0x62, 0x80, 0xFF, 0x41, 0x48, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x18, 0xFF, 0x62, 0x98, + 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x21, 0xC8, 0xFF, 0x41, 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x42, 0x70, 0xFF, 0x42, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xD0, 0xFF, 0x42, 0xB8, + 0xFF, 0x42, 0x88, 0xFF, 0x20, 0x40, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x21, 0x18, 0xFF, 0x62, 0x48, 0xFF, 0x82, 0x60, 0xFF, 0x61, + 0x50, 0xFF, 0x00, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x28, 0xFF, 0x42, 0xA0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xC8, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x62, 0x98, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x42, 0x80, 0xFF, 0x42, + 0xC8, 0xFF, 0x21, 0xD0, 0xFF, 0x00, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x21, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x22, 0xC0, 0xFF, 0x42, 0x98, 0xFF, + 0x21, 0x58, 0xFF, 0x20, 0x28, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x21, 0x18, 0xFF, 0x62, 0x28, 0xFF, 0x62, 0x30, 0xFF, 0x41, 0x20, + 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, + 0xFF, 0x41, 0x88, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x02, 0xD0, 0xFF, 0x21, 0xD8, 0xFF, 0x41, + 0x68, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x58, 0xFF, 0x42, 0xA0, 0xFF, + 0x42, 0xC8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, 0xFF, 0x01, + 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD0, + 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x02, 0xD8, 0xFF, + 0x42, 0xC8, 0xFF, 0x42, 0xB0, 0xFF, 0x42, 0x88, 0xFF, 0x21, 0x58, 0xFF, 0x21, + 0x30, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x08, 0xFF, 0x20, 0x10, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x21, 0x58, 0xFF, 0x22, + 0xB0, 0xFF, 0x42, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD0, 0xFF, 0x01, 0xC8, + 0xFF, 0x21, 0xD0, 0xFF, 0x41, 0x80, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x21, 0x40, 0xFF, 0x21, 0x78, 0xFF, 0x22, 0xA8, + 0xFF, 0x22, 0xC0, 0xFF, 0x22, 0xC8, 0xFF, 0x22, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, + 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, + 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, + 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x21, 0xD8, 0xFF, 0x21, 0xD0, 0xFF, + 0x01, 0xD0, 0xFF, 0x21, 0xC0, 0xFF, 0x42, 0xB0, 0xFF, 0x41, 0xA0, 0xFF, 0x42, + 0x80, 0xFF, 0x21, 0x60, 0xFF, 0x21, 0x38, 0xFF, 0x00, 0x20, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x41, 0x68, 0xFF, 0x42, 0xB0, 0xFF, + 0x21, 0xD0, 0xFF, 0x01, 0xD8, 0xFF, 0x01, 0xD8, 0xFF, 0x22, 0xC8, 0xFF, 0x21, + 0x50, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x10, 0xFF, 0x20, 0x28, 0xFF, 0x41, 0x48, 0xFF, 0x41, + 0x68, 0xFF, 0x21, 0x80, 0xFF, 0x21, 0x98, 0xFF, 0x41, 0xA0, 0xFF, 0x42, 0xA0, + 0xFF, 0x21, 0xA8, 0xFF, 0x21, 0xA8, 0xFF, 0x22, 0xA8, 0xFF, 0x22, 0xA8, 0xFF, + 0x21, 0xA0, 0xFF, 0x21, 0xA0, 0xFF, 0x21, 0x98, 0xFF, 0x21, 0x90, 0xFF, 0x41, + 0x78, 0xFF, 0x61, 0x60, 0xFF, 0x21, 0x50, 0xFF, 0x20, 0x38, 0xFF, 0x20, 0x20, + 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x18, 0xFF, 0x21, 0x58, 0xFF, 0x42, 0x90, 0xFF, 0x41, 0xC0, + 0xFF, 0x22, 0xD8, 0xFF, 0x43, 0xC0, 0xFF, 0x41, 0x60, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, + 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x18, 0xFF, 0x00, + 0x18, 0xFF, 0x00, 0x18, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x10, 0xFF, 0x00, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x30, 0xFF, 0x21, 0x60, 0xFF, 0x41, + 0x90, 0xFF, 0x82, 0xB0, 0xFF, 0x82, 0x90, 0xFF, 0x61, 0x50, 0xFF, 0x00, 0x20, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x20, 0xFF, 0x41, 0x48, 0xFF, + 0x62, 0x60, 0xFF, 0x62, 0x60, 0xFF, 0x81, 0x40, 0xFF, 0x41, 0x20, 0xFF, 0x00, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x08, 0xFF, 0x20, 0x10, + 0xFF, 0x21, 0x18, 0xFF, 0x00, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xE3, + 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x41, 0x08, 0xFF, 0xC3, 0x18, 0xFF, 0xA2, 0x10, 0xFF, 0x20, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xC3, 0x18, + 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xE3, + 0x18, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, + 0xC3, 0x18, 0xFF, 0xE3, 0x18, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, + 0xC3, 0x18, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0xE3, 0x18, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xE3, 0x18, 0xFF, + 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x82, 0x10, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, + 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, 0xC3, 0x18, 0xFF, + 0xE3, 0x18, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0xE3, 0x18, + 0xFF, 0xC3, 0x18, 0xFF, 0xE3, 0x18, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, + 0xFF, 0xF3, 0x9C, 0xFF, 0x59, 0xCE, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, + 0x38, 0xC6, 0xFF, 0xF3, 0x9C, 0xFF, 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x65, 0x29, 0xFF, 0xF7, 0xBD, 0xFF, 0x34, 0xA5, + 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, + 0x71, 0x8C, 0xFF, 0x38, 0xC6, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x30, 0x84, 0xFF, 0x38, 0xC6, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x18, + 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x75, 0xAD, + 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0x30, 0x84, 0xFF, 0x38, 0xC6, 0xFF, 0x38, + 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0xF3, 0x9C, 0xFF, 0x45, 0x29, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x71, 0x8C, 0xFF, + 0x79, 0xCE, 0xFF, 0x8A, 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAA, + 0x52, 0xFF, 0x9A, 0xD6, 0xFF, 0x8E, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x96, 0xB5, 0xFF, 0x55, 0xAD, + 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xF3, 0x9C, 0xFF, 0x59, 0xCE, 0xFF, 0x28, 0x42, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xD7, 0xBD, 0xFF, 0x18, 0xC6, 0xFF, 0x38, + 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0xB6, 0xB5, 0xFF, 0x69, 0x4A, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, + 0x2C, 0x63, 0xFF, 0xF7, 0xBD, 0xFF, 0x38, 0xC6, 0xFF, 0x38, 0xC6, 0xFF, 0x38, + 0xC6, 0xFF, 0xF7, 0xBD, 0xFF, 0x0C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x9E, 0xF7, 0xFF, 0xDB, 0xDE, 0xFF, 0xBA, + 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xFB, 0xDE, 0xFF, 0xBE, 0xF7, 0xFF, 0x6D, 0x6B, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, + 0x3C, 0xE7, 0xFF, 0x59, 0xCE, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x9E, 0xF7, 0xFF, 0xC7, 0x39, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x14, 0xA5, 0xFF, 0x9E, 0xF7, 0xFF, 0xC7, + 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8A, 0x52, + 0xFF, 0x7D, 0xEF, 0xFF, 0x1C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, + 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, 0x9E, 0xF7, 0xFF, 0x96, 0xB5, 0xFF, 0x61, + 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xBE, 0xF7, + 0xFF, 0xFB, 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, + 0xBE, 0xF7, 0xFF, 0x92, 0x94, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, + 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0xFF, 0xFF, 0xFF, 0x75, 0xAD, 0xFF, 0x41, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0xFF, 0xFF, 0xFF, 0x71, 0x8C, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, + 0xBA, 0xD6, 0xFF, 0x79, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x86, 0x31, 0xFF, 0x1C, 0xE7, 0xFF, + 0xDF, 0xFF, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, + 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, + 0xBA, 0xD6, 0xFF, 0x5D, 0xEF, 0xFF, 0xBA, 0xD6, 0xFF, 0x45, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0x1C, 0xE7, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, + 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0x5D, 0xEF, 0xFF, 0xBA, 0xD6, 0xFF, + 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xD7, 0xBD, 0xFF, 0x1C, 0xE7, + 0xFF, 0x28, 0x42, 0xFF, 0x04, 0x21, 0xFF, 0x04, 0x21, 0xFF, 0x6D, 0x6B, 0xFF, + 0xFF, 0xFF, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, + 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, + 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x71, + 0x8C, 0xFF, 0x04, 0x21, 0xFF, 0x24, 0x21, 0xFF, 0xE7, 0x39, 0xFF, 0x1C, 0xE7, + 0xFF, 0x79, 0xCE, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x92, 0x94, 0xFF, 0xBE, 0xF7, 0xFF, 0xAE, 0x73, 0xFF, 0x04, 0x21, 0xFF, 0x04, + 0x21, 0xFF, 0x8A, 0x52, 0xFF, 0x3C, 0xE7, 0xFF, 0x75, 0xAD, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x7D, 0xEF, 0xFF, + 0x1C, 0xE7, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0x2C, 0x63, 0xFF, 0xBE, + 0xF7, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x2C, + 0x63, 0xFF, 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, 0xFF, 0x96, 0xB5, 0xFF, 0x61, 0x08, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x5D, 0xEF, 0xFF, 0x34, 0xA5, 0xFF, 0x24, + 0x21, 0xFF, 0x24, 0x21, 0xFF, 0x65, 0x29, 0xFF, 0x96, 0xB5, 0xFF, 0x3C, 0xE7, + 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x49, 0x4A, 0xFF, 0x7D, 0xEF, 0xFF, + 0xF3, 0x9C, 0xFF, 0x04, 0x21, 0xFF, 0x24, 0x21, 0xFF, 0x86, 0x31, 0xFF, 0x59, + 0xCE, 0xFF, 0x5D, 0xEF, 0xFF, 0x65, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, + 0xD7, 0xBD, 0xFF, 0x1C, 0xE7, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x45, 0x29, 0xFF, 0x10, 0x84, 0xFF, 0x08, 0x42, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, + 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, + 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, + 0xFF, 0xBE, 0xF7, 0xFF, 0x10, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x61, 0x08, 0xFF, 0x8E, 0x73, 0xFF, 0x2C, 0x63, 0xFF, 0x41, 0x08, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0x9E, 0xF7, 0xFF, 0x0C, 0x63, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, + 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, + 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, 0xFF, 0x92, 0x94, 0xFF, 0x00, 0x00, + 0xFF, 0x2C, 0x63, 0xFF, 0xBE, 0xF7, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, + 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x00, 0xFF, 0x14, 0xA5, 0xFF, 0x3C, 0xE7, 0xFF, + 0x9A, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x5D, 0xEF, + 0xFF, 0xF3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, + 0x75, 0xAD, 0xFF, 0x3C, 0xE7, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x28, + 0x42, 0xFF, 0x9E, 0xF7, 0xFF, 0xD3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x0C, 0x63, 0xFF, 0xAE, 0x73, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x34, 0xA5, 0xFF, 0xBE, 0xF7, 0xFF, 0x75, 0xAD, + 0xFF, 0x28, 0x42, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, + 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, + 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, + 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x30, 0x84, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, + 0x9E, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, + 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x3C, 0xE7, 0xFF, + 0xDB, 0xDE, 0xFF, 0x24, 0x21, 0xFF, 0xCB, 0x5A, 0xFF, 0xBE, 0xF7, 0xFF, 0x51, + 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, + 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x24, 0x21, 0xFF, 0xBA, + 0xD6, 0xFF, 0xD7, 0xBD, 0xFF, 0x10, 0x84, 0xFF, 0x9E, 0xF7, 0xFF, 0x0C, 0x63, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x08, 0x42, 0xFF, 0x5D, 0xEF, 0xFF, 0xD3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x55, 0xAD, 0xFF, 0x7D, 0xEF, 0xFF, 0xE7, 0x39, + 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0xFB, 0xDE, 0xFF, + 0xEF, 0x7B, 0xFF, 0x24, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, + 0xF7, 0xBD, 0xFF, 0xBE, 0xF7, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x28, + 0x42, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, + 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, + 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xBE, 0xF7, + 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0x9E, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0xFB, + 0xDE, 0xFF, 0xD7, 0xBD, 0xFF, 0x7D, 0xEF, 0xFF, 0xCF, 0x7B, 0xFF, 0xEB, 0x5A, + 0xFF, 0xBE, 0xF7, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, + 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x8A, 0x52, 0xFF, 0x9E, 0xF7, 0xFF, 0xEF, 0x7B, 0xFF, 0xC7, 0x39, 0xFF, + 0x7D, 0xEF, 0xFF, 0xF3, 0x9C, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, 0xFF, 0xD7, 0xBD, + 0xFF, 0x2C, 0x63, 0xFF, 0x4D, 0x6B, 0xFF, 0x4D, 0x6B, 0xFF, 0x38, 0xC6, 0xFF, + 0x55, 0xAD, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x10, + 0x84, 0xFF, 0x3C, 0xE7, 0xFF, 0xBE, 0xF7, 0xFF, 0x9A, 0xD6, 0xFF, 0xCF, 0x7B, + 0xFF, 0x24, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x6D, 0x6B, 0xFF, 0x59, 0xCE, + 0xFF, 0xBE, 0xF7, 0xFF, 0x5D, 0xEF, 0xFF, 0xF3, 0x9C, 0xFF, + 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, + 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, + 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, + 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x8E, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0x9E, 0xF7, 0xFF, + 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, + 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x34, 0xA5, 0xFF, 0x1C, 0xE7, 0xFF, 0x6D, 0x6B, 0xFF, 0x9A, 0xD6, 0xFF, + 0x18, 0xC6, 0xFF, 0xCF, 0x7B, 0xFF, 0x7D, 0xEF, 0xFF, 0x51, 0x8C, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, + 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x30, 0x84, 0xFF, 0xBE, 0xF7, 0xFF, 0x8A, + 0x52, 0xFF, 0x61, 0x08, 0xFF, 0x79, 0xCE, 0xFF, 0x9A, 0xD6, 0xFF, 0xE3, 0x18, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, + 0xFB, 0xDE, 0xFF, 0x5D, 0xEF, 0xFF, 0xBE, 0xF7, 0xFF, 0xBE, 0xF7, 0xFF, 0xDF, + 0xFF, 0xFF, 0xDB, 0xDE, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x14, 0xA5, 0xFF, + 0x5D, 0xEF, 0xFF, 0xBE, 0xF7, 0xFF, 0x79, 0xCE, 0xFF, 0x8A, 0x52, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0xAE, 0x73, 0xFF, 0xBA, + 0xD6, 0xFF, 0xDF, 0xFF, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, + 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, + 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, 0x30, 0x84, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, + 0x8C, 0xFF, 0xBE, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x08, + 0x42, 0xFF, 0x71, 0x8C, 0xFF, 0x7D, 0xEF, 0xFF, 0xD7, 0xBD, 0xFF, 0x5D, 0xEF, + 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, + 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0xF7, 0xBD, + 0xFF, 0xDB, 0xDE, 0xFF, 0x65, 0x29, 0xFF, 0x20, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, + 0x7D, 0xEF, 0xFF, 0x28, 0x42, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, 0xFF, 0xD7, 0xBD, 0xFF, 0xEB, 0x5A, + 0xFF, 0xEB, 0x5A, 0xFF, 0x2C, 0x63, 0xFF, 0x38, 0xC6, 0xFF, 0x34, 0xA5, 0xFF, + 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x55, 0xAD, 0xFF, 0x7D, 0xEF, + 0xFF, 0x79, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x4D, 0x6B, 0xFF, 0xBE, 0xF7, 0xFF, 0xEF, 0x7B, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, + 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0xA6, 0x31, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8E, 0x73, 0xFF, + 0xDF, 0xFF, 0xFF, 0x30, 0x84, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0xBE, 0xF7, 0xFF, 0x2C, 0x63, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE7, 0x39, 0xFF, 0x5D, 0xEF, 0xFF, 0x55, + 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, + 0xFF, 0x7D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0xC7, 0x39, 0xFF, + 0x1C, 0xE7, 0xFF, 0x1C, 0xE7, 0xFF, 0x5D, 0xEF, 0xFF, 0x51, 0x8C, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x9A, + 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0xFB, 0xDE, 0xFF, 0xB6, 0xB5, 0xFF, 0x55, + 0xAD, 0xFF, 0x38, 0xC6, 0xFF, 0x7D, 0xEF, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x5D, 0xEF, 0xFF, + 0xD3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x75, + 0xAD, 0xFF, 0x7D, 0xEF, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, + 0xFF, 0xA2, 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0xC3, 0x18, 0xFF, 0x38, 0xC6, 0xFF, 0xFB, 0xDE, 0xFF, 0x45, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x92, 0x94, 0xFF, 0xB6, 0xB5, 0xFF, + 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8A, 0x52, 0xFF, 0xBE, + 0xF7, 0xFF, 0xCF, 0x7B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, 0xC6, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x55, 0xAD, 0xFF, 0x5D, + 0xEF, 0xFF, 0x86, 0x31, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, + 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x8E, 0x73, 0xFF, 0xDF, 0xFF, 0xFF, 0x10, 0x84, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0xC3, 0x18, 0xFF, 0x55, 0xAD, 0xFF, 0x55, 0xAD, 0xFF, + 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x71, 0x8C, 0xFF, 0xBE, + 0xF7, 0xFF, 0x0C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, + 0xFF, 0x5D, 0xEF, 0xFF, 0x55, 0xAD, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0x5D, 0xEF, 0xFF, 0x28, + 0x42, 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, + 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0xE3, 0x18, 0xFF, 0x9A, 0xD6, 0xFF, 0x59, 0xCE, 0xFF, 0xA2, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x7D, 0xEF, 0xFF, 0xFB, 0xDE, + 0xFF, 0x1C, 0xE7, 0xFF, 0x1C, 0xE7, 0xFF, 0xFB, 0xDE, 0xFF, 0x5D, 0xEF, 0xFF, + 0x96, 0xB5, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x08, + 0x42, 0xFF, 0x5D, 0xEF, 0xFF, 0xF3, 0x9C, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x3C, 0xE7, 0xFF, 0xC7, 0x39, 0xFF, + 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0x18, 0xC6, 0xFF, 0xAE, 0x73, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xB6, 0xB5, 0xFF, 0xFB, 0xDE, + 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x18, + 0xC6, 0xFF, 0x5D, 0xEF, 0xFF, 0x49, 0x4A, 0xFF, 0x24, 0x21, 0xFF, 0x04, 0x21, + 0xFF, 0x6D, 0x6B, 0xFF, 0xBE, 0xF7, 0xFF, 0x10, 0x84, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0xFB, 0xDE, 0xFF, 0x18, + 0xC6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, + 0xFF, 0x55, 0xAD, 0xFF, 0x5D, 0xEF, 0xFF, 0x8A, 0x52, 0xFF, 0x04, 0x21, 0xFF, + 0x45, 0x29, 0xFF, 0x65, 0x29, 0xFF, 0x04, 0x21, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x5D, 0xEF, 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xAE, 0x73, 0xFF, 0xBE, 0xF7, 0xFF, + 0x92, 0x94, 0xFF, 0x04, 0x21, 0xFF, 0x24, 0x21, 0xFF, 0x08, 0x42, 0xFF, 0xFB, + 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x92, 0x94, 0xFF, 0xBE, 0xF7, 0xFF, 0xAE, 0x73, 0xFF, + 0x04, 0x21, 0xFF, 0x04, 0x21, 0xFF, 0x8A, 0x52, 0xFF, 0x5D, 0xEF, 0xFF, 0x75, + 0xAD, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, + 0xFF, 0x5D, 0xEF, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, 0xAA, 0x52, 0xFF, + 0x5D, 0xEF, 0xFF, 0x7D, 0xEF, 0xFF, 0x51, 0x8C, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xE3, 0x18, 0xFF, 0x79, 0xCE, 0xFF, 0x59, + 0xCE, 0xFF, 0xC7, 0x39, 0xFF, 0x24, 0x21, 0xFF, 0x45, 0x29, 0xFF, 0x65, 0x29, + 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x34, 0xA5, 0xFF, + 0x5D, 0xEF, 0xFF, 0xCB, 0x5A, 0xFF, 0x86, 0x31, 0xFF, 0xA6, 0x31, 0xFF, 0xE7, + 0x39, 0xFF, 0x38, 0xC6, 0xFF, 0x1C, 0xE7, 0xFF, 0xA6, 0x31, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x3C, 0xE7, 0xFF, 0x34, 0xA5, 0xFF, + 0x24, 0x21, 0xFF, 0x45, 0x29, 0xFF, 0x65, 0x29, 0xFF, 0x96, 0xB5, 0xFF, 0x3C, + 0xE7, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x69, 0x4A, 0xFF, 0xDF, 0xFF, + 0xFF, 0x34, 0xA5, 0xFF, 0x24, 0x21, 0xFF, 0x24, 0x21, 0xFF, + 0x86, 0x31, 0xFF, 0xF7, 0xBD, 0xFF, 0xFB, 0xDE, 0xFF, 0x45, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x20, 0x00, 0xFF, 0xF3, 0x9C, 0xFF, 0x9E, 0xF7, 0xFF, 0xDB, 0xDE, 0xFF, + 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xFB, 0xDE, 0xFF, 0x9E, 0xF7, 0xFF, 0x2C, + 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC7, 0x39, + 0xFF, 0x3C, 0xE7, 0xFF, 0x79, 0xCE, 0xFF, 0xC3, 0x18, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0x75, 0xAD, 0xFF, 0x9E, 0xF7, 0xFF, 0xDB, + 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0x3C, 0xE7, 0xFF, 0xF3, 0x9C, + 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x34, 0xA5, 0xFF, 0xBE, 0xF7, 0xFF, + 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x69, + 0x4A, 0xFF, 0x5D, 0xEF, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, + 0xFF, 0xDB, 0xDE, 0xFF, 0x9E, 0xF7, 0xFF, 0x96, 0xB5, 0xFF, + 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x6D, 0x6B, 0xFF, 0x9E, + 0xF7, 0xFF, 0xFB, 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, + 0xFF, 0xBE, 0xF7, 0xFF, 0x92, 0x94, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x20, 0x00, 0xFF, 0x75, 0xAD, 0xFF, 0xBE, 0xF7, 0xFF, 0x49, 0x4A, 0xFF, 0x00, + 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0x18, 0xC6, 0xFF, 0xFF, 0xFF, 0xFF, 0x71, 0x8C, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x04, 0x21, + 0xFF, 0x9A, 0xD6, 0xFF, 0x7D, 0xEF, 0xFF, 0xDB, 0xDE, 0xFF, 0xBA, 0xD6, 0xFF, + 0xDB, 0xDE, 0xFF, 0x1C, 0xE7, 0xFF, 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x24, + 0x21, 0xFF, 0xFB, 0xDE, 0xFF, 0x9A, 0xD6, 0xFF, 0xA2, 0x10, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xD3, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, + 0x2C, 0x63, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x28, 0x42, 0xFF, 0x5D, + 0xEF, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, 0xDB, 0xDE, + 0xFF, 0x5D, 0xEF, 0xFF, 0x9A, 0xD6, 0xFF, 0x45, 0x29, 0xFF, + 0x00, 0x00, 0xFF, 0xA6, 0x31, 0xFF, 0x1C, 0xE7, 0xFF, 0x3C, 0xE7, 0xFF, 0xBA, + 0xD6, 0xFF, 0xBA, 0xD6, 0xFF, 0xDB, 0xDE, 0xFF, 0x7D, 0xEF, 0xFF, 0x59, 0xCE, + 0xFF, 0xE3, 0x18, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x04, 0x21, 0xFF, 0x14, + 0xA5, 0xFF, 0xF7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, + 0xFF, 0x51, 0x8C, 0xFF, 0x82, 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x45, 0x29, 0xFF, 0x96, 0xB5, 0xFF, 0xF3, 0x9C, 0xFF, 0x82, + 0x10, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x30, 0x84, + 0xFF, 0xF7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, + 0x38, 0xC6, 0xFF, 0x51, 0x8C, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xEF, + 0x7B, 0xFF, 0xF7, 0xBD, 0xFF, 0x45, 0x29, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x8E, 0x73, 0xFF, + 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, 0x55, + 0xAD, 0xFF, 0xE7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x82, 0x10, 0xFF, 0x30, 0x84, 0xFF, 0xF7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, + 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, 0xF3, 0x9C, 0xFF, 0x65, 0x29, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x30, 0x84, 0xFF, 0xF7, 0xBD, + 0xFF, 0xC7, 0x39, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x0C, 0x63, 0xFF, + 0x59, 0xCE, 0xFF, 0x6D, 0x6B, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0xA2, 0x10, 0xFF, 0x14, 0xA5, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, + 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0x18, 0xC6, 0xFF, 0xAA, 0x52, + 0xFF, 0x00, 0x00, 0xFF, 0x08, 0x42, 0xFF, 0x18, 0xC6, 0xFF, 0xEF, 0x7B, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x8A, + 0x52, 0xFF, 0x38, 0xC6, 0xFF, 0xAE, 0x73, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x86, 0x31, 0xFF, 0x96, 0xB5, 0xFF, 0xD7, 0xBD, 0xFF, + 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, 0xB6, 0xB5, 0xFF, 0x8A, + 0x52, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x2C, 0x63, + 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xD7, 0xBD, 0xFF, 0xF7, 0xBD, 0xFF, + 0x96, 0xB5, 0xFF, 0x49, 0x4A, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xA2, 0x10, 0xFF, 0x82, 0x10, 0xFF, + 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, + 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x61, 0x08, 0xFF, 0xA2, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x61, 0x08, 0xFF, 0x82, 0x10, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, 0xFF, 0x82, 0x10, + 0xFF, 0xA2, 0x10, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xA2, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x20, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x61, 0x08, 0xFF, 0x82, 0x10, 0xFF, 0x20, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, + 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, + 0xA2, 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x41, 0x08, 0xFF, 0xA2, + 0x10, 0xFF, 0x41, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x82, 0x10, 0xFF, + 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x20, 0x00, 0xFF, 0x82, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, + 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x82, 0x10, 0xFF, 0xA2, 0x10, 0xFF, 0x82, + 0x10, 0xFF, 0x82, 0x10, 0xFF, 0x61, 0x08, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xAB, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xB6, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, +}; +const lv_img_dsc_t ui_img_2106501360 = { + .header.always_zero = 0, + .header.w = 134, + .header.h = 76, + .data_size = sizeof(ui_img_2106501360_data), + .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, + .data = ui_img_2106501360_data +}; diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/screens/ui_loader.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/screens/ui_loader.c new file mode 100644 index 00000000..5fddfc27 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/screens/ui_loader.c @@ -0,0 +1,47 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +void ui_loader_screen_init(void) +{ + ui_loader = lv_obj_create(NULL); + lv_obj_clear_flag(ui_loader, LV_OBJ_FLAG_SCROLLABLE); /// Flags + lv_obj_set_style_bg_color(ui_loader, + lv_color_hex(0x000000), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui_loader, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + + ui_logo = lv_img_create(ui_loader); + lv_img_set_src(ui_logo, &ui_img_2106501360); + lv_obj_set_width(ui_logo, LV_SIZE_CONTENT); /// 134 + lv_obj_set_height(ui_logo, LV_SIZE_CONTENT); /// 76 + lv_obj_set_align(ui_logo, LV_ALIGN_CENTER); + lv_obj_add_flag(ui_logo, LV_OBJ_FLAG_ADV_HITTEST); /// Flags + lv_obj_clear_flag(ui_logo, LV_OBJ_FLAG_SCROLLABLE); /// Flags + + ui_Spinner1 = lv_spinner_create(ui_loader, 1000, 90); + lv_obj_set_width(ui_Spinner1, 28); + lv_obj_set_height(ui_Spinner1, 29); + lv_obj_set_x(ui_Spinner1, 3); + lv_obj_set_y(ui_Spinner1, 81); + lv_obj_set_align(ui_Spinner1, LV_ALIGN_CENTER); + lv_obj_clear_flag(ui_Spinner1, LV_OBJ_FLAG_CLICKABLE); /// Flags + lv_obj_set_style_arc_color(ui_Spinner1, + lv_color_hex(0xFFFFFF), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_arc_opa(ui_Spinner1, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_arc_width(ui_Spinner1, 5, LV_PART_MAIN | LV_STATE_DEFAULT); + + lv_obj_set_style_arc_color(ui_Spinner1, + lv_color_hex(0xD50008), + LV_PART_INDICATOR | LV_STATE_DEFAULT); + lv_obj_set_style_arc_opa(ui_Spinner1, + 255, + LV_PART_INDICATOR | LV_STATE_DEFAULT); + lv_obj_set_style_arc_width(ui_Spinner1, + 5, + LV_PART_INDICATOR | LV_STATE_DEFAULT); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/screens/ui_main.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/screens/ui_main.c new file mode 100644 index 00000000..5e4668bc --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/screens/ui_main.c @@ -0,0 +1,79 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "../ui.h" + +void ui_main_screen_init(void) +{ + ui_main = lv_obj_create(NULL); + lv_obj_clear_flag(ui_main, LV_OBJ_FLAG_SCROLLABLE); /// Flags + lv_obj_set_style_bg_color(ui_main, + lv_color_hex(0x000000), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui_main, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + + ui_Image4 = lv_img_create(ui_main); + lv_img_set_src(ui_Image4, &ui_img_1802009198); + lv_obj_set_width(ui_Image4, LV_SIZE_CONTENT); /// 75 + lv_obj_set_height(ui_Image4, LV_SIZE_CONTENT); /// 43 + lv_obj_set_x(ui_Image4, -119); + lv_obj_set_y(ui_Image4, -95); + lv_obj_set_align(ui_Image4, LV_ALIGN_CENTER); + lv_obj_add_flag(ui_Image4, LV_OBJ_FLAG_ADV_HITTEST); /// Flags + lv_obj_clear_flag(ui_Image4, LV_OBJ_FLAG_SCROLLABLE); /// Flags + + ui_Panel1 = lv_obj_create(ui_main); + lv_obj_set_width(ui_Panel1, 296); + lv_obj_set_height(ui_Panel1, 180); + lv_obj_set_x(ui_Panel1, -2); + lv_obj_set_y(ui_Panel1, 24); + lv_obj_set_align(ui_Panel1, LV_ALIGN_CENTER); + lv_obj_clear_flag(ui_Panel1, LV_OBJ_FLAG_SCROLLABLE); /// Flags + + ui_Label1 = lv_label_create(ui_main); + lv_obj_set_width(ui_Label1, LV_SIZE_CONTENT); /// 1 + lv_obj_set_height(ui_Label1, LV_SIZE_CONTENT); /// 1 + lv_obj_set_x(ui_Label1, 48); + lv_obj_set_y(ui_Label1, -90); + lv_obj_set_align(ui_Label1, LV_ALIGN_CENTER); + lv_label_set_text(ui_Label1, "LVGL Example"); + lv_obj_set_style_text_color(ui_Label1, + lv_color_hex(0xFFFFFF), + LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_opa(ui_Label1, 255, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_set_style_text_decor(ui_Label1, + LV_TEXT_DECOR_NONE, + LV_PART_MAIN | LV_STATE_DEFAULT); + + ui_BTN0 = lv_switch_create(ui_main); + lv_obj_set_width(ui_BTN0, 50); + lv_obj_set_height(ui_BTN0, 25); + lv_obj_set_x(ui_BTN0, 98); + lv_obj_set_y(ui_BTN0, -4); + lv_obj_set_align(ui_BTN0, LV_ALIGN_CENTER); + + lv_obj_set_style_bg_color(ui_BTN0, + lv_color_hex(0xD50008), + LV_PART_KNOB | LV_STATE_DEFAULT); + lv_obj_set_style_bg_opa(ui_BTN0, 255, LV_PART_KNOB | LV_STATE_DEFAULT); + + ui_Led0Label = lv_label_create(ui_main); + lv_obj_set_width(ui_Led0Label, LV_SIZE_CONTENT); /// 1 + lv_obj_set_height(ui_Led0Label, LV_SIZE_CONTENT); /// 1 + lv_obj_set_x(ui_Led0Label, -65); + lv_obj_set_y(ui_Led0Label, -4); + lv_obj_set_align(ui_Led0Label, LV_ALIGN_CENTER); + lv_label_set_text(ui_Led0Label, "LED 0"); + + ui_ControlTitle = lv_label_create(ui_main); + lv_obj_set_width(ui_ControlTitle, LV_SIZE_CONTENT); /// 1 + lv_obj_set_height(ui_ControlTitle, LV_SIZE_CONTENT); /// 1 + lv_obj_set_x(ui_ControlTitle, -11); + lv_obj_set_y(ui_ControlTitle, -49); + lv_obj_set_align(ui_ControlTitle, LV_ALIGN_CENTER); + lv_label_set_text(ui_ControlTitle, "Control Onboard LEDs"); + + lv_obj_add_event_cb(ui_BTN0, ui_event_BTN0, LV_EVENT_ALL, NULL); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui.c new file mode 100644 index 00000000..26b33e14 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui.c @@ -0,0 +1,69 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "ui.h" +#include "ui_helpers.h" + +///////////////////// VARIABLES //////////////////// + +// SCREEN: ui_loader +void ui_loader_screen_init(void); + +lv_obj_t *ui_loader; +lv_obj_t *ui_logo; +lv_obj_t *ui_Spinner1; + +// SCREEN: ui_main +void ui_main_screen_init(void); + +lv_obj_t *ui_main; +lv_obj_t *ui_Image4; +lv_obj_t *ui_Panel1; +lv_obj_t *ui_Label1; +void ui_event_BTN0(lv_event_t *e); + +lv_obj_t *ui_BTN0; +lv_obj_t *ui_Led0Label; +lv_obj_t *ui_ControlTitle; +lv_obj_t *ui____initial_actions0; + +///////////////////// TEST LVGL SETTINGS //////////////////// +#if LV_COLOR_DEPTH != 16 +#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings" +#endif +#if LV_COLOR_16_SWAP != 0 +#error "LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings" +#endif + +///////////////////// ANIMATIONS //////////////////// + +///////////////////// FUNCTIONS //////////////////// +void ui_event_BTN0(lv_event_t *e) +{ + lv_event_code_t event_code = lv_event_get_code(e); + lv_obj_t *target = lv_event_get_target(e); + (void)target; + if (event_code == LV_EVENT_PRESSED) { + btn0_pressed_event_cb(e); + } +} + +///////////////////// SCREENS //////////////////// + +void ui_init(void) +{ + lv_disp_t *dispp = lv_disp_get_default(); + lv_theme_t *theme = + lv_theme_default_init(dispp, + lv_palette_main(LV_PALETTE_BLUE), + lv_palette_main(LV_PALETTE_RED), + false, + LV_FONT_DEFAULT); + lv_disp_set_theme(dispp, theme); + ui_loader_screen_init(); + ui_main_screen_init(); + ui____initial_actions0 = lv_obj_create(NULL); + lv_disp_load_scr(ui_loader); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui.h new file mode 100644 index 00000000..ca2e07ed --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui.h @@ -0,0 +1,45 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#ifndef _SQUARELINE_PROJECT_UI_H +#define _SQUARELINE_PROJECT_UI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lvgl.h" +#include "ui_helpers.h" +#include "ui_events.h" +// SCREEN: ui_loader +void ui_loader_screen_init(void); + +extern lv_obj_t *ui_loader; +extern lv_obj_t *ui_logo; +extern lv_obj_t *ui_Spinner1; +// SCREEN: ui_main +void ui_main_screen_init(void); + +extern lv_obj_t *ui_main; +extern lv_obj_t *ui_Image4; +extern lv_obj_t *ui_Panel1; +extern lv_obj_t *ui_Label1; +void ui_event_BTN0(lv_event_t *e); + +extern lv_obj_t *ui_BTN0; +extern lv_obj_t *ui_Led0Label; +extern lv_obj_t *ui_ControlTitle; +extern lv_obj_t *ui____initial_actions0; + +LV_IMG_DECLARE(ui_img_2106501360); // assets\silabs-logo-large.png +LV_IMG_DECLARE(ui_img_1802009198); // assets\silabs-logo.png + +void ui_init(void); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_events.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_events.c new file mode 100644 index 00000000..fb9b6491 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_events.c @@ -0,0 +1,26 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "ui.h" +#include "sl_si91x_led_config.h" +#include "sl_si91x_led_instances.h" +#include "sl_si91x_led.h" + +#define ON 1 +#define OFF 0 + +static volatile bool led0_status = OFF; + +void btn0_pressed_event_cb(lv_event_t *e) +{ + (void)e; + if (led0_status == ON) { + sl_si91x_led_clear(led_led0.pin); + led0_status = OFF; + } else { + sl_si91x_led_set(led_led0.pin); + led0_status = ON; + } +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_events.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_events.h new file mode 100644 index 00000000..da50e69b --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_events.h @@ -0,0 +1,19 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#ifndef _UI_EVENTS_H +#define _UI_EVENTS_H + +#ifdef __cplusplus +extern "C" { +#endif + +void btn0_pressed_event_cb(lv_event_t *e); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_helpers.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_helpers.c new file mode 100644 index 00000000..b7aee039 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_helpers.c @@ -0,0 +1,322 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#include "ui_helpers.h" + +void _ui_bar_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) { + lv_bar_set_value(target, val, LV_ANIM_ON); + } + if (id == _UI_BAR_PROPERTY_VALUE) { + lv_bar_set_value(target, val, LV_ANIM_OFF); + } +} + +void _ui_basic_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_BASIC_PROPERTY_POSITION_X) { + lv_obj_set_x(target, val); + } + if (id == _UI_BASIC_PROPERTY_POSITION_Y) { + lv_obj_set_y(target, val); + } + if (id == _UI_BASIC_PROPERTY_WIDTH) { + lv_obj_set_width(target, val); + } + if (id == _UI_BASIC_PROPERTY_HEIGHT) { + lv_obj_set_height(target, val); + } +} + +void _ui_dropdown_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_DROPDOWN_PROPERTY_SELECTED) { + lv_dropdown_set_selected(target, val); + } +} + +void _ui_image_set_property(lv_obj_t *target, int id, uint8_t *val) +{ + if (id == _UI_IMAGE_PROPERTY_IMAGE) { + lv_img_set_src(target, val); + } +} + +void _ui_label_set_property(lv_obj_t *target, int id, const char *val) +{ + if (id == _UI_LABEL_PROPERTY_TEXT) { + lv_label_set_text(target, val); + } +} + +void _ui_roller_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) { + lv_roller_set_selected(target, val, LV_ANIM_ON); + } + if (id == _UI_ROLLER_PROPERTY_SELECTED) { + lv_roller_set_selected(target, val, LV_ANIM_OFF); + } +} + +void _ui_slider_set_property(lv_obj_t *target, int id, int val) +{ + if (id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) { + lv_slider_set_value(target, val, LV_ANIM_ON); + } + if (id == _UI_SLIDER_PROPERTY_VALUE) { + lv_slider_set_value(target, val, LV_ANIM_OFF); + } +} + +void _ui_screen_change(lv_obj_t **target, + lv_scr_load_anim_t fademode, + int spd, + int delay, + void (*target_init)(void)) +{ + if (*target == NULL) { + target_init(); + } + lv_scr_load_anim(*target, fademode, spd, delay, false); +} + +void _ui_screen_delete(lv_obj_t **target) +{ + if (*target == NULL) { + lv_obj_del(*target); + target = NULL; + } +} + +void _ui_arc_increment(lv_obj_t *target, int val) +{ + int old = lv_arc_get_value(target); + lv_arc_set_value(target, old + val); + lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0); +} + +void _ui_bar_increment(lv_obj_t *target, int val, int anm) +{ + int old = lv_bar_get_value(target); + lv_bar_set_value(target, old + val, anm); +} + +void _ui_slider_increment(lv_obj_t *target, int val, int anm) +{ + int old = lv_slider_get_value(target); + lv_slider_set_value(target, old + val, anm); + lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0); +} + +void _ui_keyboard_set_target(lv_obj_t *keyboard, lv_obj_t *textarea) +{ + lv_keyboard_set_textarea(keyboard, textarea); +} + +void _ui_flag_modify(lv_obj_t *target, int32_t flag, int value) +{ + if (value == _UI_MODIFY_FLAG_TOGGLE) { + if (lv_obj_has_flag(target, flag)) { + lv_obj_clear_flag(target, flag); + } else { + lv_obj_add_flag(target, flag); + } + } else if (value == _UI_MODIFY_FLAG_ADD) { + lv_obj_add_flag(target, flag); + } else { + lv_obj_clear_flag(target, flag); + } +} + +void _ui_state_modify(lv_obj_t *target, int32_t state, int value) +{ + if (value == _UI_MODIFY_STATE_TOGGLE) { + if (lv_obj_has_state(target, state)) { + lv_obj_clear_state(target, state); + } else { + lv_obj_add_state(target, state); + } + } else if (value == _UI_MODIFY_STATE_ADD) { + lv_obj_add_state(target, state); + } else { + lv_obj_clear_state(target, state); + } +} + +void scr_unloaded_delete_cb(lv_event_t *e) +{ + lv_obj_t **var = lv_event_get_user_data(e); + lv_obj_del(*var); + (*var) = NULL; +} + +void _ui_opacity_set(lv_obj_t *target, int val) +{ + lv_obj_set_style_opa(target, val, 0); +} + +void _ui_anim_callback_free_user_data(lv_anim_t *a) +{ + lv_mem_free(a->user_data); + a->user_data = NULL; +} + +void _ui_anim_callback_set_x(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_x(usr->target, v); +} + +void _ui_anim_callback_set_y(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_y(usr->target, v); +} + +void _ui_anim_callback_set_width(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_width(usr->target, v); +} + +void _ui_anim_callback_set_height(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_height(usr->target, v); +} + +void _ui_anim_callback_set_opacity(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_obj_set_style_opa(usr->target, v, 0); +} + +void _ui_anim_callback_set_image_zoom(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_img_set_zoom(usr->target, v); +} + +void _ui_anim_callback_set_image_angle(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + lv_img_set_angle(usr->target, v); +} + +void _ui_anim_callback_set_image_frame(lv_anim_t *a, int32_t v) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + usr->val = v; + if (v < 0) { + v = 0; + } + if (v >= usr->imgset_size) { + v = usr->imgset_size - 1; + } + lv_img_set_src(usr->target, usr->imgset[v]); +} + +int32_t _ui_anim_callback_get_x(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_x_aligned(usr->target); +} + +int32_t _ui_anim_callback_get_y(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_y_aligned(usr->target); +} + +int32_t _ui_anim_callback_get_width(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_width(usr->target); +} + +int32_t _ui_anim_callback_get_height(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_height(usr->target); +} + +int32_t _ui_anim_callback_get_opacity(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_obj_get_style_opa(usr->target, 0); +} + +int32_t _ui_anim_callback_get_image_zoom(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_img_get_zoom(usr->target); +} + +int32_t _ui_anim_callback_get_image_angle(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return lv_img_get_angle(usr->target); +} + +int32_t _ui_anim_callback_get_image_frame(lv_anim_t *a) +{ + ui_anim_user_data_t *usr = (ui_anim_user_data_t *)a->user_data; + return usr->val; +} + +void _ui_arc_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix) +{ + char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; + lv_snprintf(buf, + sizeof(buf), + "%s%d%s", + prefix, + (int)lv_arc_get_value(src), + postfix); + lv_label_set_text(trg, buf); +} + +void _ui_slider_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix) +{ + char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; + lv_snprintf(buf, + sizeof(buf), + "%s%d%s", + prefix, + (int)lv_slider_get_value(src), + postfix); + lv_label_set_text(trg, buf); +} + +void _ui_checked_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *txt_on, + const char *txt_off) +{ + if (lv_obj_has_state(src, LV_STATE_CHECKED)) { + lv_label_set_text(trg, txt_on); + } else { + lv_label_set_text(trg, txt_off); + } +} + +void _ui_spinbox_step(lv_obj_t *target, int val) +{ + if (val > 0) { + lv_spinbox_increment(target); + } else { + lv_spinbox_decrement(target); + } + + lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0); +} diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_helpers.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_helpers.h new file mode 100644 index 00000000..67cf9b50 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/app_ui/brd4338a/single_buffer_without_dma/ui_helpers.h @@ -0,0 +1,136 @@ +// This file was generated by SquareLine Studio +// SquareLine Studio version: SquareLine Studio 1.3.2 +// LVGL version: 8.3.6 +// Project name: SquareLine_Project + +#ifndef _SQUARELINE_PROJECT_UI_HELPERS_H +#define _SQUARELINE_PROJECT_UI_HELPERS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ui.h" + +#define _UI_TEMPORARY_STRING_BUFFER_SIZE 32 +#define _UI_BAR_PROPERTY_VALUE 0 +#define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1 +void _ui_bar_set_property(lv_obj_t *target, int id, int val); + +#define _UI_BASIC_PROPERTY_POSITION_X 0 +#define _UI_BASIC_PROPERTY_POSITION_Y 1 +#define _UI_BASIC_PROPERTY_WIDTH 2 +#define _UI_BASIC_PROPERTY_HEIGHT 3 +void _ui_basic_set_property(lv_obj_t *target, int id, int val); + +#define _UI_DROPDOWN_PROPERTY_SELECTED 0 +void _ui_dropdown_set_property(lv_obj_t *target, int id, int val); + +#define _UI_IMAGE_PROPERTY_IMAGE 0 +void _ui_image_set_property(lv_obj_t *target, int id, uint8_t *val); + +#define _UI_LABEL_PROPERTY_TEXT 0 +void _ui_label_set_property(lv_obj_t *target, int id, const char *val); + +#define _UI_ROLLER_PROPERTY_SELECTED 0 +#define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1 +void _ui_roller_set_property(lv_obj_t *target, int id, int val); + +#define _UI_SLIDER_PROPERTY_VALUE 0 +#define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1 +void _ui_slider_set_property(lv_obj_t *target, int id, int val); + +void _ui_screen_change(lv_obj_t **target, + lv_scr_load_anim_t fademode, + int spd, + int delay, + void (*target_init)(void)); + +void _ui_screen_delete(lv_obj_t **target); + +void _ui_arc_increment(lv_obj_t *target, int val); + +void _ui_bar_increment(lv_obj_t *target, int val, int anm); + +void _ui_slider_increment(lv_obj_t *target, int val, int anm); + +void _ui_keyboard_set_target(lv_obj_t *keyboard, lv_obj_t *textarea); + +#define _UI_MODIFY_FLAG_ADD 0 +#define _UI_MODIFY_FLAG_REMOVE 1 +#define _UI_MODIFY_FLAG_TOGGLE 2 +void _ui_flag_modify(lv_obj_t *target, int32_t flag, int value); + +#define _UI_MODIFY_STATE_ADD 0 +#define _UI_MODIFY_STATE_REMOVE 1 +#define _UI_MODIFY_STATE_TOGGLE 2 +void _ui_state_modify(lv_obj_t *target, int32_t state, int value); + +void scr_unloaded_delete_cb(lv_event_t *e); + +void _ui_opacity_set(lv_obj_t *target, int val); + +/** Describes an animation*/ +typedef struct _ui_anim_user_data_t { + lv_obj_t *target; + lv_img_dsc_t **imgset; + int32_t imgset_size; + int32_t val; +} ui_anim_user_data_t; +void _ui_anim_callback_free_user_data(lv_anim_t *a); + +void _ui_anim_callback_set_x(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_y(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_width(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_height(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_opacity(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_image_zoom(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_image_angle(lv_anim_t *a, int32_t v); + +void _ui_anim_callback_set_image_frame(lv_anim_t *a, int32_t v); + +int32_t _ui_anim_callback_get_x(lv_anim_t *a); + +int32_t _ui_anim_callback_get_y(lv_anim_t *a); + +int32_t _ui_anim_callback_get_width(lv_anim_t *a); + +int32_t _ui_anim_callback_get_height(lv_anim_t *a); + +int32_t _ui_anim_callback_get_opacity(lv_anim_t *a); + +int32_t _ui_anim_callback_get_image_zoom(lv_anim_t *a); + +int32_t _ui_anim_callback_get_image_angle(lv_anim_t *a); + +int32_t _ui_anim_callback_get_image_frame(lv_anim_t *a); + +void _ui_arc_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix); + +void _ui_slider_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *prefix, + const char *postfix); + +void _ui_checked_set_text_value(lv_obj_t *trg, + lv_obj_t *src, + const char *txt_on, + const char *txt_off); + +void _ui_spinbox_step(lv_obj_t *target, int val) +; + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/gecko/app.c similarity index 51% rename from app/example/adafruit_tft_lcd_ili9341_lvgl/app.c rename to app/example/adafruit_tft_lcd_ili9341_lvgl/gecko/app.c index beaac001..147c9664 100644 --- a/app/example/adafruit_tft_lcd_ili9341_lvgl/app.c +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/gecko/app.c @@ -3,26 +3,41 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include "sl_sleeptimer.h" #include "sl_component_catalog.h" -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_DMA_PRESENT) -#include "sl_spidrv_instances.h" -#endif +#include "adafruit_ili9341_spi_config.h" #include "adafruit_ili9341.h" #include "lv_port_disp.h" #include "lv_port_indev.h" @@ -31,6 +46,23 @@ #define LVGL_TIMER_PERIOD 1 #define LVGL_LOADER_DELAY 3000 +MIPI_DBI_SPI_INTERFACE_DEFINE(ili9341_config, + ADAFRUIT_ILI9341_PERIPHERAL, + ADAFRUIT_ILI9341_PERIPHERAL_NO, + ADAFRUIT_ILI9341_BITRATE, + ADAFRUIT_ILI9341_CLOCK_MODE, + ADAFRUIT_ILI9341_CS_CONTROL, + ADAFRUIT_ILI9341_CLK_PORT, + ADAFRUIT_ILI9341_CLK_PIN, + ADAFRUIT_ILI9341_TX_PORT, + ADAFRUIT_ILI9341_TX_PIN, + ADAFRUIT_ILI9341_RX_PORT, + ADAFRUIT_ILI9341_RX_PIN, + ADAFRUIT_ILI9341_CS_PORT, + ADAFRUIT_ILI9341_CS_PIN, + ADAFRUIT_ILI9341_DC_PORT, + ADAFRUIT_ILI9341_DC_PIN); + static volatile bool app_timer_expire = false; static sl_sleeptimer_timer_handle_t main_timer; static sl_sleeptimer_timer_handle_t lvgl_tick_timer; @@ -42,11 +74,7 @@ static void app_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, void app_init(void) { -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_PRESENT) - adafruit_ili9341_init(); -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_DMA_PRESENT) - adafruit_ili9341_init(sl_spidrv_ili9341_handle); -#endif + adafruit_ili9341_init(&ili9341_config); lv_init(); lv_port_disp_init(); lv_port_indev_init(); diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/app.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/gecko/app.h similarity index 100% rename from app/example/adafruit_tft_lcd_ili9341_lvgl/app.h rename to app/example/adafruit_tft_lcd_ili9341_lvgl/gecko/app.h diff --git a/app/example/adafruit_tft_lcd_ili9341_lvgl/si91x/app.c b/app/example/adafruit_tft_lcd_ili9341_lvgl/si91x/app.c new file mode 100644 index 00000000..16e0df13 --- /dev/null +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/si91x/app.c @@ -0,0 +1,130 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "sl_sleeptimer.h" +#include "sl_component_catalog.h" +#include "adafruit_ili9341_spi_config.h" +#include "adafruit_ili9341.h" +#include "lv_port_disp.h" +#include "lv_port_indev.h" +#include "ui.h" + +#define LVGL_TIMER_PERIOD 1 +#define LVGL_LOADER_DELAY 3000 + +MIPI_DBI_SPI_INTERFACE_DEFINE(ili9341_config, + ADAFRUIT_ILI9341_BITRATE, + ADAFRUIT_ILI9341_CLOCK_MODE, + ADAFRUIT_ILI9341_CS_CONTROL, + RTE_GSPI_MASTER_CLK_PORT, + RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MOSI_PORT, + RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_CS0_PORT, + RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_4, + ADAFRUIT_ILI9341_DC_PORT, + ADAFRUIT_ILI9341_DC_PIN, + SL_GPIO_MODE_0); + +static volatile bool app_timer_expire = false; +static sl_sleeptimer_timer_handle_t main_timer; +static sl_sleeptimer_timer_handle_t lvgl_tick_timer; + +static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data); +static void app_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data); + +void app_init(void) +{ + adafruit_ili9341_init(&ili9341_config); + lv_init(); + lv_port_disp_init(); + lv_port_indev_init(); + + sl_sleeptimer_start_periodic_timer_ms(&lvgl_tick_timer, + LVGL_TIMER_PERIOD, + lvgl_tick_timer_callback, + NULL, + 0, + 0); + + ui_init(); + sl_sleeptimer_start_timer_ms(&main_timer, + LVGL_LOADER_DELAY, + app_sleeptimer_callback, + NULL, + 0, + 0); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + lv_timer_handler_run_in_period(5); + + if (app_timer_expire == true) { + app_timer_expire = false; + lv_disp_load_scr(ui_main); + } +} + +static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data) +{ + (void)timer; + (void)data; + + lv_tick_inc(LVGL_TIMER_PERIOD); +} + +static void app_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data) +{ + (void)timer; + (void)data; + + app_timer_expire = true; +} diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_dma_config.h b/app/example/adafruit_tft_lcd_ili9341_lvgl/si91x/app.h similarity index 59% rename from driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_dma_config.h rename to app/example/adafruit_tft_lcd_ili9341_lvgl/si91x/app.h index 08b3d350..d11707e6 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_dma_config.h +++ b/app/example/adafruit_tft_lcd_ili9341_lvgl/si91x/app.h @@ -1,17 +1,16 @@ /***************************************************************************//** - * @file adafruit_hxd8357d_config.h - * @brief Configuration file for Adafruit HXD8357D board. - * @version 1.0.0 + * @file + * @brief Application interface provided to main(). ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib * * The licensor of this software is Silicon Laboratories Inc. * - * This software is provided \'as-is\', without any express or implied + * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * @@ -27,33 +26,19 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. ******************************************************************************/ -#ifndef ADAFRUIT_HXD8357D_CONFIG_H_ -#define ADAFRUIT_HXD8357D_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#warning "HXD8357D SPI DC Pin not configured" -// [GPIO_HXD8357D_SPI_DC]$ +#ifndef APP_H +#define APP_H -// <<< sl:end pin_tool >>> +/**************************************************************************//** + * Application Init. + *****************************************************************************/ +void app_init(void); -#ifdef __cplusplus -extern "C" -} -#endif +/**************************************************************************//** + * Application Process Action. + *****************************************************************************/ +void app_process_action(void); -#endif /* ADAFRUIT_HXD8357D_CONFIG_H_ */ +#endif // APP_H diff --git a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp index a8a9b1e8..381575d6 100644 --- a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp +++ b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789.slcp @@ -18,7 +18,7 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_st7789/README.md source: -- path: app.c +- path: gecko/app.c - path: main.c - path: bird_image.c - path: cactus_plants_image.c @@ -27,7 +27,7 @@ source: - path: nature_image.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h @@ -49,19 +49,23 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/create_example.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/demo.gif - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/intro.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/st7789_display.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/log.png - directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/create_example.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/demo.gif + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/intro.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/st7789_display.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/log.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/gspi.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/gspi_dma.png + directory: image ui_hints: highlight: diff --git a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp index e6b83461..64a12a03 100644 --- a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp +++ b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma.slcp @@ -18,7 +18,7 @@ readme: - path: ../../documentation/example/adafruit_tft_lcd_st7789/README.md source: -- path: app.c +- path: gecko/app.c - path: main.c - path: bird_image.c - path: cactus_plants_image.c @@ -27,7 +27,7 @@ source: - path: nature_image.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h @@ -50,19 +50,23 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/create_example.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/demo.gif - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/intro.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/st7789_display.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789/image/log.png - directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/create_example.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/demo.gif + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/intro.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/st7789_display.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/log.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/gspi.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/gspi_dma.png + directory: image ui_hints: highlight: diff --git a/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma_si91x.slcp b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma_si91x.slcp new file mode 100644 index 00000000..8d765a75 --- /dev/null +++ b/app/example/adafruit_tft_lcd_st7789/adafruit_tft_lcd_st7789_dma_si91x.slcp @@ -0,0 +1,85 @@ +project_name: adafruit_tft_lcd_st7789_dma_si91x +package: platform +label: Third Party Hardware Drivers - ST7789 - TFT LCD (Adafruit) - SPI with DMA +description: | + This example project shows an example for Adafruit TFT LCD using SPI with DMA support. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_tft_lcd_st7789/README.md + +source: +- path: si91x/app.c +- path: main.c +- path: bird_image.c +- path: cactus_plants_image.c +- path: cat_image.c +- path: cute_image.c +- path: nature_image.c + +include: +- path: 'si91x' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: tft_lcd_st7789_dma + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers + + +define: +- name: DEBUG_EFM + + +configuration: +- name: SL_GSPI_DMA_CONFIG_ENABLE + value: "1" +- name: "GSPI_UC" + value: "0" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/create_example.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/demo.gif + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/intro.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/st7789_display.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/log.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/gspi.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789/image/gspi_dma.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_tft_lcd_st7789/app.c b/app/example/adafruit_tft_lcd_st7789/gecko/app.c similarity index 77% rename from app/example/adafruit_tft_lcd_st7789/app.c rename to app/example/adafruit_tft_lcd_st7789/gecko/app.c index 02d78b9e..e9979b55 100644 --- a/app/example/adafruit_tft_lcd_st7789/app.c +++ b/app/example/adafruit_tft_lcd_st7789/gecko/app.c @@ -3,30 +3,44 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include "app_log.h" #include "app_assert.h" -#include "adafruit_st7789.h" #include "glib.h" #include "sl_sleeptimer.h" - -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ST7789_DMA_PRESENT) -#include "sl_spidrv_instances.h" -#endif +#include "adafruit_st7789_spi_config.h" +#include "adafruit_st7789.h" #define APP_TIMER_SMALL 500 #define APP_TIMER_MEDIUM 2000 @@ -35,6 +49,23 @@ static glib_context_t g_context; static uint8_t demo_index = 0; +MIPI_DBI_SPI_INTERFACE_DEFINE(st7789_config, + ADAFRUIT_ST7789_PERIPHERAL, + ADAFRUIT_ST7789_PERIPHERAL_NO, + ADAFRUIT_ST7789_BITRATE, + ADAFRUIT_ST7789_CLOCK_MODE, + ADAFRUIT_ST7789_CS_CONTROL, + ADAFRUIT_ST7789_CLK_PORT, + ADAFRUIT_ST7789_CLK_PIN, + ADAFRUIT_ST7789_TX_PORT, + ADAFRUIT_ST7789_TX_PIN, + ADAFRUIT_ST7789_RX_PORT, + ADAFRUIT_ST7789_RX_PIN, + ADAFRUIT_ST7789_CS_PORT, + ADAFRUIT_ST7789_CS_PIN, + ADAFRUIT_ST7789_DC_PORT, + ADAFRUIT_ST7789_DC_PIN); + static volatile bool app_timer_expire = false; static sl_sleeptimer_timer_handle_t app_sleep_timer; static void app_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, @@ -58,15 +89,11 @@ void app_init(void) { sl_status_t sc = SL_STATUS_OK; -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ST7789_PRESENT) - sc = adafruit_st7789_init(); -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ST7789_DMA_PRESENT) - sc = adafruit_st7789_init(sl_spidrv_st7789_handle); -#endif - adafruit_st7789_set_rotation(adafruit_st7789_rotation_none); - + sc = adafruit_st7789_init(&st7789_config); app_assert_status(sc); + adafruit_st7789_set_rotation(adafruit_st7789_rotation_none); + sc = glib_init(&g_context); app_assert_status(sc); diff --git a/app/example/mikroe_e_paper_154_inch/app.h b/app/example/adafruit_tft_lcd_st7789/gecko/app.h similarity index 100% rename from app/example/mikroe_e_paper_154_inch/app.h rename to app/example/adafruit_tft_lcd_st7789/gecko/app.h diff --git a/app/example/adafruit_tft_lcd_st7789/si91x/app.c b/app/example/adafruit_tft_lcd_st7789/si91x/app.c new file mode 100644 index 00000000..aa55de0f --- /dev/null +++ b/app/example/adafruit_tft_lcd_st7789/si91x/app.c @@ -0,0 +1,268 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "app_assert.h" +#include "adafruit_st7789_spi_config.h" +#include "adafruit_st7789.h" +#include "glib.h" +#include "sl_sleeptimer.h" + +#define APP_TIMER_SMALL 500 +#define APP_TIMER_MEDIUM 2000 +#define APP_TIMER_LARGE 4000 + +#define app_log printf + +static glib_context_t g_context; +static uint8_t demo_index = 0; + +static volatile bool app_timer_expire = false; +static sl_sleeptimer_timer_handle_t app_sleep_timer; +static void app_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data); + +extern const unsigned char gImage_cat_image[64808]; +extern const unsigned char gImage_bird_image[64808]; +extern const unsigned char gImage_cute_image[64808]; +extern const unsigned char gImage_cactus_plants[64808]; +extern const unsigned char gImage_nature_image[64808]; + +const uint8_t *img_arr[5] = { + gImage_cat_image, + gImage_bird_image, + gImage_cute_image, + gImage_cactus_plants, + gImage_nature_image +}; + +MIPI_DBI_SPI_INTERFACE_DEFINE(st7789_config, + ADAFRUIT_ST7789_BITRATE, + ADAFRUIT_ST7789_CLOCK_MODE, + ADAFRUIT_ST7789_CS_CONTROL, + RTE_GSPI_MASTER_CLK_PORT, + RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MOSI_PORT, + RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_CS0_PORT, + RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_4, + ADAFRUIT_ST7789_DC_PORT, + ADAFRUIT_ST7789_DC_PIN, + SL_GPIO_MODE_0); + +void app_init(void) +{ + sl_status_t sc = SL_STATUS_OK; + + sc = adafruit_st7789_init(&st7789_config); + app_assert_status(sc); + + adafruit_st7789_set_rotation(adafruit_st7789_rotation_none); + + sc = glib_init(&g_context); + + app_log("Adafruit ST7789 TFT init done\r\n"); + app_log("GLIB init done\r\n"); + + sl_sleeptimer_restart_periodic_timer_ms(&app_sleep_timer, + APP_TIMER_SMALL, + app_sleeptimer_callback, + NULL, + 0, + 0); + app_log("Start sleep timer %dms\r\n", APP_TIMER_SMALL); + + g_context.textsize_x = 2; + g_context.textsize_y = 2; + g_context.wrap = false; + + glib_set_color(&g_context, ST7789_WHITE, ST7789_BLACK); + glib_fill(&g_context, ST7789_BLACK); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + if (app_timer_expire) { + app_timer_expire = false; + + switch (demo_index) { + case 0: + glib_fill(&g_context, ST7789_WHITE); + app_log("glib_fill --> WHITE color\r\n"); + sl_sleeptimer_restart_periodic_timer_ms(&app_sleep_timer, + APP_TIMER_SMALL, + app_sleeptimer_callback, + NULL, + 0, + 0); + app_log("Start sleep timer %dms\r\n", APP_TIMER_SMALL); + break; + case 1: + glib_fill(&g_context, ST7789_RED); + app_log("glib_fill --> RED color\r\n"); + break; + case 2: + glib_fill(&g_context, ST7789_GREEN); + app_log("glib_fill --> GREEN color\r\n"); + break; + case 3: + glib_fill(&g_context, ST7789_BLUE); + app_log("glib_fill --> BLUE color\r\n"); + break; + case 4: + glib_fill(&g_context, ST7789_CYAN); + app_log("glib_fill --> CYAN color\r\n"); + break; + case 5: + glib_fill(&g_context, ST7789_MAGENTA); + app_log("glib_fill --> MAGENTA color\r\n"); + break; + case 6: + glib_fill(&g_context, ST7789_YELLOW); + app_log("glib_fill --> YELLOW color\r\n"); + break; + case 7: + glib_fill(&g_context, ST7789_ORANGE); + app_log("glib_fill --> ORANGE color\r\n"); + break; + case 8: + glib_fill(&g_context, ST7789_BLACK); + app_log("glib_fill --> BLACK color\r\n"); + break; + case 9: + + glib_set_color(&g_context, ST7789_GREEN, ST7789_BLACK); + glib_draw_string(&g_context, "HELLO WORLD", 0, 0); + glib_set_color(&g_context, ST7789_RED, ST7789_BLACK); + glib_draw_string(&g_context, "Adafruit", 0, 25); + glib_set_color(&g_context, ST7789_YELLOW, ST7789_BLACK); + glib_draw_string(&g_context, "1.14\" TFT", 0, 50); + + app_log("glib_draw_string --> HELLO WORLD\r\n"); + app_log("glib_draw_string --> Adafruit\r\n"); + app_log("glib_draw_string --> 1.14\" TFT\r\n"); + + sl_sleeptimer_restart_periodic_timer_ms(&app_sleep_timer, + APP_TIMER_MEDIUM, + app_sleeptimer_callback, + NULL, + 0, + 0); + app_log("Start sleep timer %dms\r\n", APP_TIMER_MEDIUM); + break; + case 10: + glib_set_invert_color(); + app_log("glib_set_invert_color --> true\r\n"); + break; + case 11: + glib_set_normal_color(); + app_log("glib_set_invert_color --> false\r\n"); + break; + case 12: + glib_enable_display(false); + app_log("glib_enable_display --> false\r\n"); + break; + case 13: + glib_enable_display(true); + app_log("glib_enable_display --> true\r\n"); + break; + case 14: + adafruit_st7789_draw_rgb_bitmap(0, 0, (uint16_t *)img_arr[0], 135, 240); + app_log("adafruit_st7789_draw_rgb_bitmap idx = 0\r\n"); + sl_sleeptimer_restart_periodic_timer_ms(&app_sleep_timer, + APP_TIMER_LARGE, + app_sleeptimer_callback, + NULL, + 0, + 0); + app_log("Start sleep timer %dms\r\n", APP_TIMER_LARGE); + break; + case 15: + adafruit_st7789_draw_rgb_bitmap(0, 0, (uint16_t *)img_arr[1], 135, 240); + app_log("adafruit_st7789_draw_rgb_bitmap idx = 1\r\n"); + break; + case 16: + adafruit_st7789_draw_rgb_bitmap(0, 0, (uint16_t *)img_arr[2], 135, 240); + app_log("adafruit_st7789_draw_rgb_bitmap idx = 2\r\n"); + break; + case 17: + adafruit_st7789_draw_rgb_bitmap(0, 0, (uint16_t *)img_arr[3], 135, 240); + app_log("adafruit_st7789_draw_rgb_bitmap idx = 3\r\n"); + break; + case 18: + adafruit_st7789_draw_rgb_bitmap(0, 0, (uint16_t *)img_arr[4], 135, 240); + app_log("adafruit_st7789_draw_rgb_bitmap idx = 4\r\n"); + break; + case 19: + glib_fill(&g_context, ST7789_BLACK); + + glib_draw_circle(&g_context, 25, 25, 25, ST7789_MAGENTA); + glib_fill_circle(&g_context, 90, 25, 25, ST7789_BLUE); + glib_draw_triangle(&g_context, 80, 60, 130, 60, 130, 90, ST7789_YELLOW); + glib_fill_triangle(&g_context, 0, 60, 80, 80, 45, 116, ST7789_ORANGE); + glib_draw_round_rect(&g_context, 0, 125, 50, 65, 10, ST7789_CYAN); + glib_fill_rect(&g_context, 70, 125, 50, 65, ST7789_GREEN); + app_log("glib_draw_circle, glib_fill_circle\r\n"); + app_log("glib_draw_triangle, glib_fill_triangle\r\n"); + app_log("glib_draw_round_rect, glib_fill_rect\r\n"); + break; + default: + break; + } + + if (demo_index++ > 19) { + demo_index = 0; + } + } +} + +static void app_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data) +{ + (void)timer; + (void)data; + + app_timer_expire = true; +} diff --git a/app/example/silabs_pir_ira_s210st01/app.h b/app/example/adafruit_tft_lcd_st7789/si91x/app.h similarity index 100% rename from app/example/silabs_pir_ira_s210st01/app.h rename to app/example/adafruit_tft_lcd_st7789/si91x/app.h diff --git a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp index 2fe11d7d..80461e92 100644 --- a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp +++ b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma.slcp @@ -19,7 +19,7 @@ readme: source: - path: main.c -- path: app.c +- path: gecko/app.c - path: app_ui/ui.c - path: app_ui/ui_events.c - path: app_ui/ui_helpers.c @@ -30,9 +30,11 @@ source: - path: app_ui/screens/ui_screenmain.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h +- path: '' + file_list: - path: app_ui/ui.h - path: app_ui/ui_helpers.h - path: app_ui/ui_events.h @@ -59,23 +61,27 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - - path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/create_example.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/demo.gif - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/hw.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/intro.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/log.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/lvgl_config.png - directory: image - - path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/st7789_display.png - directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/create_example.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/demo.gif + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/hw.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/intro.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/log.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/lvgl_config.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/st7789_display.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi_dma.png + directory: image ui_hints: highlight: diff --git a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma_si91x.slcp b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma_si91x.slcp new file mode 100644 index 00000000..dd658777 --- /dev/null +++ b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/adafruit_tft_lcd_st7789_lvgl_dma_si91x.slcp @@ -0,0 +1,105 @@ +project_name: adafruit_tft_lcd_st7789_lvgl_dma_si91x +package: platform +label: Third Party Hardware Drivers - ST7789 - TFT LCD (Adafruit) - with LVGL + SPI DMA (SI91X) +description: | + This example project shows an example for Adafruit TFT LCD with LVGL library using SPI DMA. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/README.md + +source: +- path: main.c +- path: si91x/app.c +- path: app_ui/ui.c +- path: app_ui/ui_events.c +- path: app_ui/ui_helpers.c +- path: app_ui/components/ui_comp_hook.c +- path: app_ui/images/ui_img_1258193662.c +- path: app_ui/images/ui_img_1258194689.c +- path: app_ui/images/ui_img_1802009198.c +- path: app_ui/screens/ui_screenmain.c + +include: +- path: 'si91x' + file_list: + - path: app.h +- path: '' + file_list: + - path: app_ui/ui.h + - path: app_ui/ui_helpers.h + - path: app_ui/ui_events.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: app_assert +- id: tft_lcd_st7789 + from: third_party_hw_drivers +- id: services_lvgl + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: sl_si91x_button_917 + instance: [btn0, btn1] + from: wiseconnect3_sdk +- id: sl_si91x_led_917 + instance: [led0, led1] + from: wiseconnect3_sdk + +define: +- name: DEBUG_EFM + +configuration: +- name: SL_GSPI_DMA_CONFIG_ENABLE + value: "1" +- name: LV_BUFFER_MODE + value: "1" +- name: "GSPI_UC" + value: "0" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/create_example.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/demo.gif + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/hw.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/intro.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/log.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/lvgl_config.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/st7789_display.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi.png + directory: image +- path: ../../documentation/example/adafruit_tft_lcd_st7789_lvgl_dma/image/gspi_dma.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/app.c b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/gecko/app.c similarity index 59% rename from app/example/adafruit_tft_lcd_st7789_lvgl_dma/app.c rename to app/example/adafruit_tft_lcd_st7789_lvgl_dma/gecko/app.c index 48d7bc48..640e58ed 100644 --- a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/app.c +++ b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/gecko/app.c @@ -3,34 +3,68 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "adafruit_st7789.h" #include "lv_port_disp.h" #include "app_ui/ui.h" #include "app_log.h" #include "sl_sleeptimer.h" -#include "sl_spidrv_instances.h" #include "sl_simple_button_instances.h" #include "sl_simple_led_instances.h" +#include "adafruit_st7789_spi_config.h" +#include "adafruit_st7789.h" #define LVGL_TIMER_PERIOD 1 static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, void *data); +MIPI_DBI_SPI_INTERFACE_DEFINE(st7789_config, + ADAFRUIT_ST7789_PERIPHERAL, + ADAFRUIT_ST7789_PERIPHERAL_NO, + ADAFRUIT_ST7789_BITRATE, + ADAFRUIT_ST7789_CLOCK_MODE, + ADAFRUIT_ST7789_CS_CONTROL, + ADAFRUIT_ST7789_CLK_PORT, + ADAFRUIT_ST7789_CLK_PIN, + ADAFRUIT_ST7789_TX_PORT, + ADAFRUIT_ST7789_TX_PIN, + ADAFRUIT_ST7789_RX_PORT, + ADAFRUIT_ST7789_RX_PIN, + ADAFRUIT_ST7789_CS_PORT, + ADAFRUIT_ST7789_CS_PIN, + ADAFRUIT_ST7789_DC_PORT, + ADAFRUIT_ST7789_DC_PIN); + static sl_sleeptimer_timer_handle_t lvgl_tick_timer; static bool led0_state = false; @@ -42,7 +76,7 @@ static bool btn1_trigger = false; void app_init(void) { app_log("Hello World Adafruit 1.14\" TFT LCD with LVGL Demo\r\n"); - adafruit_st7789_init(sl_spidrv_st7789_handle); + adafruit_st7789_init(&st7789_config); adafruit_st7789_set_rotation(adafruit_st7789_rotation_90); app_log("adafruit_st7789_init done\r\n"); diff --git a/app/example/silabs_triac/app.h b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/gecko/app.h similarity index 100% rename from app/example/silabs_triac/app.h rename to app/example/adafruit_tft_lcd_st7789_lvgl_dma/gecko/app.h diff --git a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/si91x/app.c b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/si91x/app.c new file mode 100644 index 00000000..89a2c15d --- /dev/null +++ b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/si91x/app.c @@ -0,0 +1,168 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "lv_port_disp.h" +#include "app_ui/ui.h" +#include "sl_sleeptimer.h" +#include "sl_si91x_led.h" +#include "sl_si91x_button.h" +#include "sl_si91x_button_pin_config.h" +#include "sl_si91x_led_config.h" +#include "sl_si91x_button_instances.h" +#include "sl_si91x_led_instances.h" +#include "adafruit_st7789_spi_config.h" +#include "adafruit_st7789.h" + +#define LVGL_TIMER_PERIOD 1 +static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data); + +MIPI_DBI_SPI_INTERFACE_DEFINE(st7789_config, + ADAFRUIT_ST7789_BITRATE, + ADAFRUIT_ST7789_CLOCK_MODE, + ADAFRUIT_ST7789_CS_CONTROL, + RTE_GSPI_MASTER_CLK_PORT, + RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MOSI_PORT, + RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_CS0_PORT, + RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_4, + ADAFRUIT_ST7789_DC_PORT, + ADAFRUIT_ST7789_DC_PIN, + SL_GPIO_MODE_0); + +static sl_sleeptimer_timer_handle_t lvgl_tick_timer; + +static bool led0_state = false; +static bool led1_state = false; + +static bool btn0_trigger = false; +static bool btn1_trigger = false; + +void app_init(void) +{ + printf("Hello World Adafruit 1.14\" TFT LCD with LVGL Demo\r\n"); + adafruit_st7789_init(&st7789_config); + adafruit_st7789_set_rotation(adafruit_st7789_rotation_90); + + printf("adafruit_st7789_init done\r\n"); + + lv_init(); + lv_port_disp_init(); + + sl_sleeptimer_start_periodic_timer_ms(&lvgl_tick_timer, + LVGL_TIMER_PERIOD, + lvgl_tick_timer_callback, + NULL, + 0, + 0); + printf("lvgl init done\r\n"); + + ui_init(); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + lv_timer_handler_run_in_period(5); + + if (btn0_trigger) { + btn0_trigger = false; + + if (sl_si91x_button_state_get(button_btn0.pin)) { + led0_state = !led0_state; + printf("led0 state = %d\r\n", (uint8_t)led0_state); + if (led0_state) { + sl_si91x_led_set(led_led0.pin); + lv_obj_add_flag(ui_imgled0off, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_imgled0on, LV_OBJ_FLAG_HIDDEN); + } else { + sl_si91x_led_clear(led_led0.pin); + lv_obj_add_flag(ui_imgled0on, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_imgled0off, LV_OBJ_FLAG_HIDDEN); + } + } + } + + if (btn1_trigger) { + btn1_trigger = false; + + if (sl_si91x_button_state_get(button_btn1.pin)) { + led1_state = !led1_state; + printf("led1 state = %d\r\n", (uint8_t)led1_state); + if (led1_state) { + sl_si91x_led_set(led_led1.pin); + lv_obj_add_flag(ui_imgled1off, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_imgled1on, LV_OBJ_FLAG_HIDDEN); + } else { + sl_si91x_led_clear(led_led1.pin); + lv_obj_add_flag(ui_imgled1on, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(ui_imgled1off, LV_OBJ_FLAG_HIDDEN); + } + } + } +} + +static void lvgl_tick_timer_callback(sl_sleeptimer_timer_handle_t *timer, + void *data) +{ + (void)timer; + (void)data; + + lv_tick_inc(LVGL_TIMER_PERIOD); +} + +void sl_si91x_button_isr(uint8_t pin, int8_t state) +{ + if (pin == button_btn0.pin) { + if (state == BUTTON_PRESSED) { + btn0_trigger = true; + } + } else if (pin == button_btn1.pin) { + if (state == BUTTON_PRESSED) { + btn1_trigger = true; + } + } +} diff --git a/app/example/adafruit_tft_lcd_st7789_lvgl_dma/si91x/app.h b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/si91x/app.h new file mode 100644 index 00000000..02bedf57 --- /dev/null +++ b/app/example/adafruit_tft_lcd_st7789_lvgl_dma/si91x/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp b/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp index fabdad20..6ad6870c 100644 --- a/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp +++ b/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007.slcp @@ -18,11 +18,11 @@ readme: - path: ../../documentation/example/adafruit_touchscreen_tsc2007/README.md source: -- path: app.c +- path: gecko/app.c - path: main.c include: -- path: '' +- path: 'gecko' file_list: - path: app.h @@ -33,6 +33,8 @@ component: instance: [vcom] - id: app_assert - id: app_log +- id: i2cspm + instance: [qwiic] - id: adafruit_touchscreen_tsc2007 from: third_party_hw_drivers - id: services_oled_glib @@ -45,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/adafruit_touchscreen_tsc2007/image/calib.png diff --git a/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007_si91x.slcp b/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007_si91x.slcp new file mode 100644 index 00000000..0fd64713 --- /dev/null +++ b/app/example/adafruit_touchscreen_tsc2007/adafruit_touchscreen_tsc2007_si91x.slcp @@ -0,0 +1,73 @@ +project_name: adafruit_touchscreen_tsc2007_si91x +package: platform +label: Third Party Hardware Drivers - TSC2007 - Resistive Touch Screen Controller (Adafruit) +description: | + This example project shows an example for Adafruit Resistive Touch Screen Controller driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/adafruit_touchscreen_tsc2007/README.md + +source: +- path: si91x/app.c +- path: main.c + +include: +- path: 'si91x' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: adafruit_touchscreen_tsc2007 + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers +- id: adafruit_tft_lcd_ili9341_dma + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/adafruit_touchscreen_tsc2007/image/calib.png + directory: image + - path: ../../documentation/example/adafruit_touchscreen_tsc2007/image/hardware_connection.png + directory: image + - path: ../../documentation/example/adafruit_touchscreen_tsc2007/image/create_example.png + directory: image + - path: ../../documentation/example/adafruit_touchscreen_tsc2007/image/output.png + directory: image + - path: ../../documentation/example/adafruit_touchscreen_tsc2007/image/tsc2007_configuration.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/adafruit_touchscreen_tsc2007/app.c b/app/example/adafruit_touchscreen_tsc2007/app.c deleted file mode 100644 index d7b83606..00000000 --- a/app/example/adafruit_touchscreen_tsc2007/app.c +++ /dev/null @@ -1,120 +0,0 @@ -/***************************************************************************//** - * @file - * @brief Top level application functions - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" -#include "app_assert.h" -#include "adafruit_ili9341.h" -#include "adafruit_tsc2007.h" -#include "glib.h" -#include "sl_i2cspm_instances.h" - -#define PRESSURE_THRESH 500 - -static glib_context_t g_context; -static bool touch_detected = false; - -static void screen_print( - int16_t glib_y_ofset, - int32_t x, int32_t y, int32_t rtouch, - uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw); -static void touch_detect_isr_callback(void); - -void app_init(void) -{ - sl_status_t sc; - - sc = adafruit_ili9341_init(); - app_assert_status(sc); - app_log("\rAdafruit ILI9341 Init done\n"); - - sc = adafruit_tsc2007_init(sl_i2cspm_qwiic); - app_assert_status(sc); - app_log("\rTouch Screen Init done\n"); - - adafruit_tsc2007_register_touch_detect_isr_callback( - touch_detect_isr_callback); - - glib_init(&g_context); - app_assert_status(sc); - app_log("\rGLIB Init done\n"); - glib_set_bg_color(&g_context, ILI9341_BLACK); - glib_set_text_color(&g_context, ILI9341_WHITE); - glib_set_text_size(&g_context, 2, 2); - glib_enable_wrap(&g_context, false); - - glib_fill(&g_context, ILI9341_BLACK); - glib_draw_string(&g_context, "~TSC2007~", 65, 10); - screen_print(40, - 0, 0, 0, - 0, 0, 0, 0); -} - -/***************************************************************************//** - * App ticking function. - ******************************************************************************/ -void app_process_action(void) -{ - int32_t x, y, rtouch; - uint16_t x_raw, y_raw, z1_raw, z2_raw; - - if (touch_detected) { - touch_detected = false; - - adafruit_tsc2007_read_touch(); - adafruit_tsc2007_get_touch(&x_raw, &y_raw, &z1_raw, &z2_raw); - adafruit_tsc2007_get_touch_point(&x, &y, &rtouch); - app_log("x: %ld, y: %ld, rtouch: %ld\r\n", x, y, rtouch); - if (rtouch < PRESSURE_THRESH) { - screen_print(40, - x, y, rtouch, - x_raw, y_raw, z1_raw, z2_raw); - } - } -} - -static void screen_print( - int16_t glib_y_ofset, - int32_t x, int32_t y, int32_t rtouch, - uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw) -{ - char string_buf[32]; - - snprintf(string_buf, sizeof(string_buf), "X: %3ld ", x); - glib_draw_string(&g_context, string_buf, 0, glib_y_ofset); - snprintf(string_buf, sizeof(string_buf), "X_RAW: %4d ", x_raw); - glib_draw_string(&g_context, string_buf, 95, glib_y_ofset); - - snprintf(string_buf, sizeof(string_buf), "Y: %3ld", y); - glib_draw_string(&g_context, string_buf, 0, glib_y_ofset + 20); - snprintf(string_buf, sizeof(string_buf), "Y_RAW: %4d", y_raw); - glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 20); - - snprintf(string_buf, sizeof(string_buf), "RT: %3ld ", rtouch); - glib_draw_string(&g_context, string_buf, 0, glib_y_ofset + 40); - snprintf(string_buf, sizeof(string_buf), "Z1_RAW: %4d ", z1_raw); - glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 40); - snprintf(string_buf, sizeof(string_buf), "Z2_RAW: %4d ", z2_raw); - glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 60); -} - -static void touch_detect_isr_callback(void) -{ - touch_detected = true; -} diff --git a/app/example/adafruit_touchscreen_tsc2007/gecko/app.c b/app/example/adafruit_touchscreen_tsc2007/gecko/app.c new file mode 100644 index 00000000..f7fb931f --- /dev/null +++ b/app/example/adafruit_touchscreen_tsc2007/gecko/app.c @@ -0,0 +1,146 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "app_log.h" +#include "app_assert.h" +#include "adafruit_ili9341.h" +#include "adafruit_tsc2007.h" +#include "adafruit_ili9341_spi_config.h" +#include "glib.h" +#include "sl_i2cspm.h" +#include "sl_i2cspm_qwiic_config.h" + +#define PRESSURE_THRESH 500 + +static glib_context_t g_context; + +static const struct adafruit_tsc2007_config adafruit_tsc2007_config = { + .mikroe_drv_i2c_handle = SL_I2CSPM_QWIIC_PERIPHERAL +}; + +MIPI_DBI_SPI_INTERFACE_DEFINE(ili9341_config, + ADAFRUIT_ILI9341_PERIPHERAL, + ADAFRUIT_ILI9341_PERIPHERAL_NO, + ADAFRUIT_ILI9341_BITRATE, + ADAFRUIT_ILI9341_CLOCK_MODE, + ADAFRUIT_ILI9341_CS_CONTROL, + ADAFRUIT_ILI9341_CLK_PORT, + ADAFRUIT_ILI9341_CLK_PIN, + ADAFRUIT_ILI9341_TX_PORT, + ADAFRUIT_ILI9341_TX_PIN, + ADAFRUIT_ILI9341_RX_PORT, + ADAFRUIT_ILI9341_RX_PIN, + ADAFRUIT_ILI9341_CS_PORT, + ADAFRUIT_ILI9341_CS_PIN, + ADAFRUIT_ILI9341_DC_PORT, + ADAFRUIT_ILI9341_DC_PIN); + +static void screen_print( + int16_t glib_y_ofset, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw); + +void app_init(void) +{ + sl_status_t sc; + + sc = adafruit_ili9341_init(&ili9341_config); + app_assert_status(sc); + app_log("\rAdafruit ILI9341 Init done\n"); + + sc = adafruit_tsc2007_init(&adafruit_tsc2007_config); + app_assert_status(sc); + app_log("\rTouch Screen Init done\n"); + + glib_init(&g_context); + app_assert_status(sc); + app_log("\rGLIB Init done\n"); + glib_set_bg_color(&g_context, ILI9341_BLACK); + glib_set_text_color(&g_context, ILI9341_WHITE); + glib_set_text_size(&g_context, 2, 2); + glib_enable_wrap(&g_context, false); + + glib_fill(&g_context, ILI9341_BLACK); + glib_draw_string(&g_context, "~TSC2007~", 65, 10); + screen_print(40, + 0, 0, 0, + 0, 0, 0, 0); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + int32_t x, y, rtouch; + uint16_t x_raw, y_raw, z1_raw, z2_raw; + + adafruit_tsc2007_read_touch(); + adafruit_tsc2007_get_touch(&x_raw, &y_raw, &z1_raw, &z2_raw); + adafruit_tsc2007_get_touch_point(&x, &y, &rtouch); + app_log("x: %ld, y: %ld, rtouch: %ld\r\n", x, y, rtouch); + if (rtouch < PRESSURE_THRESH) { + screen_print(40, + x, y, rtouch, + x_raw, y_raw, z1_raw, z2_raw); + } +} + +static void screen_print( + int16_t glib_y_ofset, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw) +{ + char string_buf[32]; + + snprintf(string_buf, sizeof(string_buf), "X: %3ld ", x); + glib_draw_string(&g_context, string_buf, 0, glib_y_ofset); + snprintf(string_buf, sizeof(string_buf), "X_RAW: %4d ", x_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset); + + snprintf(string_buf, sizeof(string_buf), "Y: %3ld", y); + glib_draw_string(&g_context, string_buf, 0, glib_y_ofset + 20); + snprintf(string_buf, sizeof(string_buf), "Y_RAW: %4d", y_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 20); + + snprintf(string_buf, sizeof(string_buf), "RT: %3ld ", rtouch); + glib_draw_string(&g_context, string_buf, 0, glib_y_ofset + 40); + snprintf(string_buf, sizeof(string_buf), "Z1_RAW: %4d ", z1_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 40); + snprintf(string_buf, sizeof(string_buf), "Z2_RAW: %4d ", z2_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 60); +} diff --git a/app/example/adafruit_touchscreen_tsc2007/gecko/app.h b/app/example/adafruit_touchscreen_tsc2007/gecko/app.h new file mode 100644 index 00000000..02bedf57 --- /dev/null +++ b/app/example/adafruit_touchscreen_tsc2007/gecko/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/app/example/adafruit_touchscreen_tsc2007/si91x/app.c b/app/example/adafruit_touchscreen_tsc2007/si91x/app.c new file mode 100644 index 00000000..3bf9d01c --- /dev/null +++ b/app/example/adafruit_touchscreen_tsc2007/si91x/app.c @@ -0,0 +1,149 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "app_assert.h" +#include "rsi_debug.h" +#include "sl_si91x_i2c.h" +#include "adafruit_ili9341.h" +#include "adafruit_tsc2007.h" +#include "adafruit_ili9341_spi_config.h" +#include "glib.h" + +#define PRESSURE_THRESH 500 + +static glib_context_t g_context; + +static sl_i2c_instance_t i2c_instance = SL_I2C2; +static const struct adafruit_tsc2007_config adafruit_tsc2007_config = { + .mikroe_drv_i2c_handle = (void *)&i2c_instance +}; + +MIPI_DBI_SPI_INTERFACE_DEFINE(ili9341_config, + ADAFRUIT_ILI9341_BITRATE, + ADAFRUIT_ILI9341_CLOCK_MODE, + ADAFRUIT_ILI9341_CS_CONTROL, + RTE_GSPI_MASTER_CLK_PORT, + RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MOSI_PORT, + RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN, + SL_GPIO_MODE_4, + RTE_GSPI_MASTER_CS0_PORT, + RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_4, + ADAFRUIT_ILI9341_DC_PORT, + ADAFRUIT_ILI9341_DC_PIN, + SL_GPIO_MODE_0); + +static void screen_print( + int16_t glib_y_ofset, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw); + +void app_init(void) +{ + sl_status_t sc; + + sc = adafruit_ili9341_init(&ili9341_config); + app_assert_status(sc); + DEBUGOUT("\rAdafruit ILI9341 Init done\n"); + + sc = adafruit_tsc2007_init(&adafruit_tsc2007_config); + app_assert_status(sc); + DEBUGOUT("\rTouch Screen Init done\n"); + + glib_init(&g_context); + app_assert_status(sc); + DEBUGOUT("\rGLIB Init done\n"); + glib_set_bg_color(&g_context, ILI9341_BLACK); + glib_set_text_color(&g_context, ILI9341_WHITE); + glib_set_text_size(&g_context, 2, 2); + glib_enable_wrap(&g_context, false); + + glib_fill(&g_context, ILI9341_BLACK); + glib_draw_string(&g_context, "~TSC2007~", 65, 10); + screen_print(40, + 0, 0, 0, + 0, 0, 0, 0); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + int32_t x, y, rtouch; + uint16_t x_raw, y_raw, z1_raw, z2_raw; + + adafruit_tsc2007_read_touch(); + adafruit_tsc2007_get_touch(&x_raw, &y_raw, &z1_raw, &z2_raw); + adafruit_tsc2007_get_touch_point(&x, &y, &rtouch); + DEBUGOUT("x: %ld, y: %ld, rtouch: %ld\r\n", x, y, rtouch); + if (rtouch < PRESSURE_THRESH) { + screen_print(40, + x, y, rtouch, + x_raw, y_raw, z1_raw, z2_raw); + } +} + +static void screen_print( + int16_t glib_y_ofset, + int32_t x, int32_t y, int32_t rtouch, + uint16_t x_raw, uint16_t y_raw, uint16_t z1_raw, uint16_t z2_raw) +{ + char string_buf[32]; + + snprintf(string_buf, sizeof(string_buf), "X: %3ld ", x); + glib_draw_string(&g_context, string_buf, 0, glib_y_ofset); + snprintf(string_buf, sizeof(string_buf), "X_RAW: %4d ", x_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset); + + snprintf(string_buf, sizeof(string_buf), "Y: %3ld", y); + glib_draw_string(&g_context, string_buf, 0, glib_y_ofset + 20); + snprintf(string_buf, sizeof(string_buf), "Y_RAW: %4d", y_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 20); + + snprintf(string_buf, sizeof(string_buf), "RT: %3ld ", rtouch); + glib_draw_string(&g_context, string_buf, 0, glib_y_ofset + 40); + snprintf(string_buf, sizeof(string_buf), "Z1_RAW: %4d ", z1_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 40); + snprintf(string_buf, sizeof(string_buf), "Z2_RAW: %4d ", z2_raw); + glib_draw_string(&g_context, string_buf, 95, glib_y_ofset + 60); +} diff --git a/app/example/adafruit_touchscreen_tsc2007/si91x/app.h b/app/example/adafruit_touchscreen_tsc2007/si91x/app.h new file mode 100644 index 00000000..02bedf57 --- /dev/null +++ b/app/example/adafruit_touchscreen_tsc2007/si91x/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/app/example/bthome_v2/bthome_v2.slcp b/app/example/bthome_v2/bthome_v2.slcp index fd8136e2..3310f58f 100644 --- a/app/example/bthome_v2/bthome_v2.slcp +++ b/app/example/bthome_v2/bthome_v2.slcp @@ -60,7 +60,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 2.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/bthome_v2/image/app1.png diff --git a/app/example/bthome_v2_server/bthome_v2_server.slcp b/app/example/bthome_v2_server/bthome_v2_server.slcp index eec1b6bb..d6c6cf8a 100644 --- a/app/example/bthome_v2_server/bthome_v2_server.slcp +++ b/app/example/bthome_v2_server/bthome_v2_server.slcp @@ -66,7 +66,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/bthome_v2_server/image/connection.png diff --git a/driver/public/silabs/air_quality_sgp40/src/sparkfun_sgp40_i2c.c b/app/example/epaper_ext3_1/app.c similarity index 59% rename from driver/public/silabs/air_quality_sgp40/src/sparkfun_sgp40_i2c.c rename to app/example/epaper_ext3_1/app.c index 12d2972b..c6465065 100644 --- a/driver/public/silabs/air_quality_sgp40/src/sparkfun_sgp40_i2c.c +++ b/app/example/epaper_ext3_1/app.c @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file sparkfun_sgp40_i2c.c - * @brief sparkfun_sgp40_i2c source file. + * @file + * @brief Top level application functions ******************************************************************************* * # License * Copyright 2022 Silicon Laboratories Inc. www.silabs.com @@ -27,56 +27,48 @@ * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * ******************************************************************************/ -#include "sparkfun_sgp40_i2c.h" -#include "em_i2c.h" -/***************************************************************************//** - * Function to perform I2C write to the air quality sensor - ******************************************************************************/ -sl_status_t i2c_write_blocking(sl_i2cspm_t *i2c_instance, - uint8_t *src, - uint32_t len) -{ - I2C_TransferSeq_TypeDef seq; +#include "app.h" +#include "epaper_display.h" +#include "sl_sleeptimer.h" - seq.addr = SGP40_ADDRESS << 1; - seq.flags = I2C_FLAG_WRITE; +#include "glib.h" +#include "glib_font.h" +#include "silabs_logo.h" - /*Write buffer*/ - seq.buf[0].data = src; - seq.buf[0].len = len; +static glib_context_t glib_context; +const char *about_silabs = "Silicon Labs is a leader in secure, " + "intelligent wireless technology for a more connected world."; - if (I2CSPM_Transfer(i2c_instance, &seq) != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void) +{ + glib_init(&glib_context); + glib_clear(&glib_context); + // draw silabs logo + glib_draw_xbitmap(&glib_context, + 0, 20, silabs_logo, + SILABS_LOGO_WIDTH, SILABS_LOGO_HEIGHT, 1); - return SL_STATUS_OK; + glib_set_font(&glib_context, &glib_font_free_sans_9pt7b); + glib_draw_string(&glib_context, about_silabs, + 20, 20 + SILABS_LOGO_HEIGHT + 100); + glib_update_display(); } /***************************************************************************//** - * Function to perform I2C read from the air quality sensor + * App ticking function. ******************************************************************************/ -sl_status_t i2c_read_blocking(sl_i2cspm_t *i2c_instance, - uint8_t *dest, - uint32_t len) +void app_process_action(void) { - I2C_TransferSeq_TypeDef seq; - - seq.addr = SGP40_ADDRESS << 1; - seq.flags = I2C_FLAG_READ; - - /*Read buffer*/ - seq.buf[0].data = dest; - seq.buf[0].len = len; - - if (I2CSPM_Transfer(i2c_instance, &seq) != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - - return SL_STATUS_OK; } diff --git a/app/example/epaper_ext3_1/app.h b/app/example/epaper_ext3_1/app.h new file mode 100644 index 00000000..02bedf57 --- /dev/null +++ b/app/example/epaper_ext3_1/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/app/example/epaper_ext3_1/epaper_ext3_1.slcp b/app/example/epaper_ext3_1/epaper_ext3_1.slcp new file mode 100644 index 00000000..bc6a6a63 --- /dev/null +++ b/app/example/epaper_ext3_1/epaper_ext3_1.slcp @@ -0,0 +1,55 @@ +project_name: epaper_ext3_1 +package: platform +label: Third Party Hardware Drivers - E-paper EXT3-1 +description: | + This example project shows an example using EXT3-1 Kit to control an E-Paper Display (EPD). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/epaper_ext3_1/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + - path: silabs_logo.h + +component: +- id: sl_system +- id: device_init +- id: epaper_ext3_1 + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 + +other_file: + - path: ../../documentation/example/epaper_ext3_1/image/create_example.png + directory: image + - path: ../../documentation/example/epaper_ext3_1/image/result.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + diff --git a/app/example/epaper_ext3_1/epaper_ext3_1_si91x.slcp b/app/example/epaper_ext3_1/epaper_ext3_1_si91x.slcp new file mode 100644 index 00000000..6bef26cb --- /dev/null +++ b/app/example/epaper_ext3_1/epaper_ext3_1_si91x.slcp @@ -0,0 +1,71 @@ +project_name: epaper_ext3_1_si91x +package: platform +label: Third Party Hardware Drivers - E-paper EXT3-1 +description: | + This example project shows an example using EXT3-1 Kit to control an E-Paper Display (EPD). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/epaper_ext3_1/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + - path: silabs_logo.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: epaper_ext3_1 + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +configuration: +- name: RTE_GSPI_MASTER_CS0_PORT_ID + value: 2 +- name: RTE_GSPI_MASTER_CLK_PORT_ID + value: 2 +- name: RTE_GSPI_MASTER_MOSI_PORT_ID + value: 2 +- name: RTE_GSPI_MASTER_MISO_PORT_ID + value: 2 + +other_file: + - path: ../../documentation/example/epaper_ext3_1/image/create_example.png + directory: image + - path: ../../documentation/example/epaper_ext3_1/image/result.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_e_paper_154_inch/main.c b/app/example/epaper_ext3_1/main.c similarity index 100% rename from app/example/mikroe_e_paper_154_inch/main.c rename to app/example/epaper_ext3_1/main.c diff --git a/app/example/epaper_ext3_1/silabs_logo.h b/app/example/epaper_ext3_1/silabs_logo.h new file mode 100644 index 00000000..ee0aa97b --- /dev/null +++ b/app/example/epaper_ext3_1/silabs_logo.h @@ -0,0 +1,357 @@ +#define SILABS_LOGO_WIDTH 256 +#define SILABS_LOGO_HEIGHT 132 + +const unsigned char silabs_logo[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, + 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, + 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, + 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, + 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, + 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, + 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01, + 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xc0, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfe, + 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, + 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, + 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, + 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfe, 0xff, + 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x07, 0x00, + 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, + 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, + 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, + 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, + 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, + 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0x00, + 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, + 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, + 0xff, 0x1f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, + 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, + 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, + 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, + 0x0f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, + 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfc, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xff, 0x07, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x07, 0x00, 0xff, 0x03, + 0x80, 0xff, 0x03, 0xe0, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0x78, 0x00, 0xc0, 0xff, 0x03, 0xf0, 0xff, 0x00, 0x80, 0xff, 0x0f, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0x80, 0xff, 0x07, 0xc0, 0xff, 0x07, 0xe0, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x78, 0x00, 0xc0, 0xff, + 0x07, 0xf0, 0xff, 0x01, 0xc0, 0xff, 0x0f, 0x80, 0x03, 0xe0, 0x00, 0x00, + 0x0f, 0xc0, 0xff, 0x0f, 0xc0, 0xff, 0x0f, 0xe0, 0x01, 0x07, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0x7c, 0x00, 0xc0, 0xff, 0x0f, 0xf8, 0xff, 0x01, + 0xc0, 0x01, 0x0e, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x0e, + 0xe0, 0x01, 0x0e, 0xe0, 0x01, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0x7c, 0x00, 0xc0, 0x01, 0x0e, 0x38, 0xc0, 0x01, 0xc0, 0x01, 0x0e, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x0e, 0xe0, 0x00, 0x0e, 0xe0, + 0x03, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 0x00, 0xc0, 0x00, + 0x1e, 0x38, 0xc0, 0x01, 0xc0, 0x01, 0x0e, 0x80, 0x03, 0xe0, 0x00, 0x00, + 0x0f, 0xc0, 0x01, 0x0e, 0xe0, 0x00, 0x0e, 0xe0, 0x03, 0x07, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0xfe, 0x00, 0xc0, 0x00, 0x1e, 0x38, 0xc0, 0x01, + 0xc0, 0x01, 0x0c, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x1c, + 0xe0, 0x00, 0x0e, 0xe0, 0x07, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0xfe, 0x00, 0xc0, 0x00, 0x1e, 0x38, 0x80, 0x01, 0xc0, 0x01, 0x00, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0xe0, + 0x07, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xee, 0x00, 0xc0, 0x00, + 0x1e, 0x78, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x80, 0x03, 0xe0, 0x00, 0x00, + 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0xe0, 0x07, 0x07, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0xcf, 0x01, 0xc0, 0x00, 0x1e, 0x78, 0x00, 0x00, + 0xc0, 0x0f, 0x00, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, + 0xe0, 0x00, 0x0e, 0xe0, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0xc7, 0x01, 0xc0, 0x00, 0x1e, 0xf8, 0x01, 0x00, 0x80, 0x3f, 0x00, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0x60, + 0x0e, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xc7, 0x03, 0xc0, 0x01, + 0x0e, 0xf0, 0x07, 0x00, 0x00, 0x7e, 0x00, 0x80, 0x03, 0xe0, 0x00, 0x00, + 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0x60, 0x1e, 0x07, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0x87, 0x03, 0xc0, 0x01, 0x06, 0xc0, 0x0f, 0x00, + 0x00, 0xf8, 0x01, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, + 0xe0, 0x00, 0x0e, 0x60, 0x1e, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, + 0x83, 0x03, 0xc0, 0xff, 0x03, 0x00, 0x3f, 0x00, 0x00, 0xf0, 0x07, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0x60, + 0x3c, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x80, 0x83, 0x03, 0xc0, 0xff, + 0x03, 0x00, 0xfe, 0x00, 0x00, 0xc0, 0x0f, 0x80, 0x03, 0xe0, 0x00, 0x00, + 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0x60, 0x3c, 0x07, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x80, 0x83, 0x07, 0xc0, 0xff, 0x07, 0x00, 0xf8, 0x01, + 0x00, 0x00, 0x0f, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, + 0xe0, 0x00, 0x0e, 0x60, 0x78, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x80, + 0x03, 0x07, 0xc0, 0x00, 0x0e, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x1e, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0x60, + 0x70, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x80, 0x03, 0x07, 0xc0, 0x00, + 0x0e, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x1e, 0x80, 0x03, 0xe0, 0x00, 0x00, + 0x0f, 0xc0, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0x60, 0xf0, 0x07, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0xc0, 0x03, 0x07, 0xc0, 0x00, 0x1e, 0x00, 0xc0, 0x03, + 0x00, 0x00, 0x1e, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x00, + 0xe0, 0x00, 0x0e, 0x60, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0xc0, + 0xff, 0x07, 0xc0, 0x00, 0x1e, 0x00, 0xc0, 0x03, 0xc0, 0x01, 0x1e, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x1e, 0xe0, 0x00, 0x0e, 0x60, + 0xe0, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0xe0, 0xff, 0x0f, 0xc0, 0x00, + 0x1e, 0x38, 0xc0, 0x03, 0xc0, 0x01, 0x1e, 0x80, 0x03, 0xe0, 0x00, 0x00, + 0x0f, 0xc0, 0x01, 0x0e, 0xe0, 0x00, 0x0e, 0x60, 0xe0, 0x07, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0xe0, 0x00, 0x0e, 0xc0, 0x00, 0x1e, 0x38, 0xc0, 0x03, + 0xc0, 0x01, 0x1e, 0x80, 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x0e, + 0xe0, 0x00, 0x0e, 0x60, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0xe0, + 0x00, 0x0e, 0xc0, 0x00, 0x1e, 0x38, 0xc0, 0x03, 0xc0, 0x01, 0x1e, 0x80, + 0x03, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0x0e, 0xe0, 0x00, 0x0e, 0x60, + 0xc0, 0x07, 0x00, 0x00, 0x00, 0x0e, 0x00, 0xe0, 0x00, 0x1e, 0xc0, 0x00, + 0x1e, 0x38, 0xc0, 0x03, 0xc0, 0xff, 0x1f, 0x80, 0x03, 0xe0, 0xff, 0x03, + 0x0f, 0xc0, 0xff, 0x0f, 0xe0, 0xff, 0x0f, 0x60, 0xc0, 0x07, 0x00, 0x00, + 0x00, 0xfe, 0x3f, 0xf0, 0x00, 0x1e, 0xc0, 0xff, 0x0f, 0xf8, 0xff, 0x03, + 0xc0, 0xff, 0x0f, 0x80, 0x03, 0xe0, 0xff, 0x03, 0x0f, 0xc0, 0xff, 0x0f, + 0xc0, 0xff, 0x0f, 0x60, 0x80, 0x07, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x70, + 0x00, 0x1c, 0xc0, 0xff, 0x0f, 0xf8, 0xff, 0x01, 0x80, 0xff, 0x0f, 0x80, + 0x03, 0xe0, 0xff, 0x03, 0x0f, 0x80, 0xff, 0x0f, 0xc0, 0xff, 0x07, 0x60, + 0x00, 0x07, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x70, 0x00, 0x3c, 0xc0, 0xff, + 0x07, 0xf0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/app/example/maxim_fuel_gauge_max17048/app.c b/app/example/maxim_fuel_gauge_max17048/app.c index 09b5f85c..be610b63 100644 --- a/app/example/maxim_fuel_gauge_max17048/app.c +++ b/app/example/maxim_fuel_gauge_max17048/app.c @@ -1,42 +1,66 @@ /***************************************************************************//** -* @file app.c -* @brief MAX17048 driver demonstration. -******************************************************************************* -* # License -* Copyright 2022 Silicon Laboratories Inc. www.silabs.com -******************************************************************************* -* -* SPDX-License-Identifier: Zlib -* -* The licensor of this software is Silicon Laboratories Inc. -* -* This software is provided \'as-is\', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -* -******************************************************************************* -* # Evaluation Quality -* This code has been minimally tested to ensure that it builds and is suitable -* as a demonstration for evaluation purposes only. This code will be maintained -* at the sole discretion of Silicon Labs. -*******************************************************************************/ + * @file app.c + * @brief Example application + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include +#include "maxim_fuel_gauge_max17048.h" +#include "app_assert.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" #include "app_log.h" +#endif -#include "maxim_fuel_gauge_max17048.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif +extern bool update_rcom; +static bool handle_interrupt = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void max17048_soc_callback(sl_max17048_irq_source_t source, void *data); @@ -51,38 +75,56 @@ void app_init(void) uint8_t id; uint16_t version; +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_fuel_gauge; +#endif + // Initialize the max17048 - status = max17048_init(sl_i2cspm_fuel_gauge); - app_log_status(status); + status = max17048_init(app_i2c_instance); + app_assert_status(status); + +#if (defined(SLI_SI917)) + + /** + * Due to calling trim_efuse API on ADC init in driver + * it will change the clock frequency, + * if we are not initialize the debug again + * it will print the garbage data in console output. + */ + DEBUGINIT(); +#endif // Read and print the device ID status = max17048_get_id(&id); - app_log_status(status); - app_log("\nID: 0x%x\r\n", id); + app_printf("status: 0x%x ", (int)status); + app_printf("ID: 0x%x\r\n", id); // Read and print the device version status = max17048_get_production_version(&version); - app_log_status(status); - app_log("Device version: 0x%x\r\n", version); + app_printf("status: 0x%x ", (int)status); + app_printf("Device version: 0x%x\r\n", version); // Read and print the battery voltage status = max17048_get_vcell(&vcell); - app_log_status(status); - app_log("vcell: %ld mV\r\n", vcell); + app_printf("status: 0x%x ", (int)status); + app_printf("vcell: %ld mV\r\n", vcell); // Read and print the battery state of charge status = max17048_get_soc(&soc); - app_log_status(status); - app_log("soc: %ld%%\r\n", soc); + app_printf("status: 0x%x ", (int)status); + app_printf("soc: %ld%%\r\n", soc); // Read and print the average SOC rate of change status = max17048_get_crate(&crate); - app_log_status(status); - app_log("crate: %f%%\r\n", crate); + app_printf("status: 0x%x ", (int)status); + app_printf("crate: %f%%\r\n", crate); // Enables the MAX17048 state-of-charge (SOC) interrupt status = max17048_enable_soc_interrupt(max17048_soc_callback, &cb_data); - app_log_status(status); + app_printf("status: 0x%x ", (int)status); + app_printf("enable SOC interrupt\n"); } /***************************************************************************//** @@ -90,6 +132,36 @@ void app_init(void) ******************************************************************************/ void app_process_action(void) { + // Update rcom value + if (update_rcom) { + max17048_update_rcom(); + update_rcom = false; + } + + // Handle SoC interrupt + if (handle_interrupt) { + sl_status_t status; + uint32_t soc, vcell; + float crate; + + app_printf("\nSOC interrupt >\r\n"); + // Read and print the battery state of charge + status = max17048_get_soc(&soc); + app_printf("status: 0x%x ", (int)status); + app_printf("SOC is now: %ld%%\r\n", soc); + + // Read and print the battery voltage + status = max17048_get_vcell(&vcell); + app_printf("status: 0x%x ", (int)status); + app_printf("vcell is now: %ld mV\r\n", vcell); + + // Read and print the average SOC rate of change + status = max17048_get_crate(&crate); + app_printf("status: 0x%x ", (int)status); + app_printf("crate is now: %f%%\r\n", crate); + + handle_interrupt = false; + } } static void max17048_soc_callback(sl_max17048_irq_source_t source, @@ -97,23 +169,6 @@ static void max17048_soc_callback(sl_max17048_irq_source_t source, { (void)source; (void)data; - sl_status_t status; - uint32_t soc, vcell; - float crate; - - app_log("\nSOC interrupt >\r\n"); - // Read and print the battery state of charge - status = max17048_get_soc(&soc); - app_log_status(status); - app_log("SOC is now: %ld%%\r\n", soc); - // Read and print the battery voltage - status = max17048_get_vcell(&vcell); - app_log_status(status); - app_log("vcell is now: %ld mV\r\n", vcell); - - // Read and print the average SOC rate of change - status = max17048_get_crate(&crate); - app_log_status(status); - app_log("crate is now: %f%%\r\n", crate); + handle_interrupt = true; } diff --git a/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp b/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp index 67d1afbe..ab7c59dd 100644 --- a/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp +++ b/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048.slcp @@ -37,6 +37,7 @@ component: instance: [fuel_gauge] - id: sleeptimer - id: app_log +- id: app_assert toolchain_settings: - option: gcc_linker_option @@ -47,7 +48,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/overview.png @@ -64,8 +65,6 @@ other_file: directory: "image" - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/create_example.png directory: "image" - - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/float.png - directory: "image" configuration: - name: SL_BOARD_ENABLE_VCOM diff --git a/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048_si91x.slcp b/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048_si91x.slcp new file mode 100644 index 00000000..654eefa6 --- /dev/null +++ b/app/example/maxim_fuel_gauge_max17048/maxim_fuel_gauge_max17048_si91x.slcp @@ -0,0 +1,81 @@ +project_name: maxim_fuel_gauge_max17048 +package: platform +label: Third Party Hardware Drivers - MAX17048 - MAX17048EVKIT Evaluation Kits (Maxim) +description: | + This example project shows an example for MAX17048EVKIT Evalue Kit driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/maxim_fuel_gauge_max17048/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sl_adc + from: wiseconnect3_sdk +- id: sl_bjt_temperature_sensor + from: wiseconnect3_sdk +- id: maxim_fuel_gauge_max17048 + from: third_party_hw_drivers +- id: app_assert + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/overview.png + directory: "image" + - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/log.png + directory: "image" + - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/connection.png + directory: "image" + - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/workflow.png + directory: "image" + - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/vcom.png + directory: "image" + - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/max17048_config.png + directory: "image" + - path: ../../documentation/example/maxim_fuel_gauge_max17048/image/create_example.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_accel5_bma400/app.c b/app/example/mikroe_accel5_bma400/app.c index ea86fb1f..f153fb96 100644 --- a/app/example/mikroe_accel5_bma400/app.c +++ b/app/example/mikroe_accel5_bma400/app.c @@ -32,16 +32,44 @@ * It is not suitable for production environments. * This code will not be maintained. ******************************************************************************/ +#include "sl_component_catalog.h" +#include "sl_sleeptimer.h" #include "bma400.h" -#include "printf.h" #define MIKROE_BMA400_READ_MODE_INTERRUPT // #define MIKROE_BMA400_READ_MODE_POLLING -#ifdef MIKROE_BMA400_READ_MODE_POLLING -#include "sl_sleeptimer.h" +#if (defined(SLI_SI917)) +#include "rsi_debug.h" + +#ifdef SL_CATALOG_MIKROE_ACCEL5_BMA400_SPI_PRESENT +#include "mikroe_bma400_spi.h" +#include "mikroe_bma400_spi_config.h" +#include "sl_si91x_gspi.h" + +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; #endif +#ifdef SL_CATALOG_MIKROE_ACCEL5_BMA400_I2C_PRESENT +#include "mikroe_bma400_i2c.h" +#include "mikroe_bma400_i2c_config.h" +#include "sl_i2c_instances.h" + +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) + +#ifdef MIKROE_BMA400_READ_MODE_INTERRUPT +#include "sl_driver_gpio.h" +#define GPIO_M4_INTR 7 // M4 Pin interrupt number +#define AVL_INTR_NO 0 // available interrupt number +#endif + +#else /* None Si91x device */ +#include "app_log.h" + #ifdef MIKROE_BMA400_READ_MODE_INTERRUPT #include "gpiointerrupt.h" #include "em_gpio.h" @@ -59,6 +87,9 @@ #include "mikroe_bma400_i2c_config.h" #endif +#define app_printf(...) app_log(__VA_ARGS__) +#endif + #define READING_INTERVAL_MSEC 200 // Earth's gravity in m/s^2 #define GRAVITY_EARTH (9.80665f) @@ -84,13 +115,20 @@ static sl_status_t app_bma400_init(void); static sl_status_t app_bma400_read_data(void); static float lsb_to_ms2(int16_t accel_data, uint8_t g_range, uint8_t bit_width); +#ifdef SL_CATALOG_MIKROE_ACCEL5_BMA400_SPI_PRESENT +mikroe_spi_handle_t app_spi_instance = NULL; +#endif +#ifdef SL_CATALOG_MIKROE_ACCEL5_BMA400_I2C_PRESENT +static mikroe_i2c_handle_t app_i2c_instance = NULL; +#endif + /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { if (app_bma400_init() != SL_STATUS_OK) { - printf("Initialization error. Please check again ...\r\n"); + app_printf("Initialization error. Please check again ...\r\n"); } } @@ -102,7 +140,7 @@ void app_process_action(void) if (enable_reading_data) { enable_reading_data = false; if (app_bma400_read_data() != SL_STATUS_OK) { - printf("Reading error. Please check again ...\r\n"); + app_printf("Reading error. Please check again ...\r\n"); } } } @@ -146,16 +184,28 @@ static sl_status_t app_bma400_init(void) struct bma400_int_enable int_en; #ifdef SL_CATALOG_MIKROE_ACCEL5_BMA400_SPI_PRESENT - // Initialize an I2C interface for BMA400 - rslt = bma400_spi_init(sl_spidrv_mikroe_handle, &bma); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + + // Initialize an SPI interface for BMA400 + rslt = bma400_spi_init(app_spi_instance, &bma); if (rslt != BMA400_OK) { return SL_STATUS_FAIL; } #endif #ifdef SL_CATALOG_MIKROE_ACCEL5_BMA400_I2C_PRESENT +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + // Initialize an I2C interface for BMA400 - rslt = bma400_i2c_init(sl_i2cspm_mikroe, MIKROE_BMA400_ADDR, &bma); + rslt = bma400_i2c_init(app_i2c_instance, MIKROE_BMA400_ADDR, &bma); if (rslt != BMA400_OK) { return SL_STATUS_FAIL; } @@ -204,19 +254,29 @@ static sl_status_t app_bma400_init(void) return SL_STATUS_FAIL; } - printf("Accel Gravity data in m/s^2\r\n"); + app_printf("Accel Gravity data in m/s^2\r\n"); #ifdef MIKROE_BMA400_READ_MODE_POLLING // Start timer used for periodic indications. - sl_sleeptimer_start_periodic_timer(&app_periodic_timer, - READING_INTERVAL_MSEC, - app_periodic_timer_cb, - (void *) NULL, - 0, - 0); + sl_sleeptimer_start_periodic_timer_ms(&app_periodic_timer, + READING_INTERVAL_MSEC, + app_periodic_timer_cb, + (void *) NULL, + 0, + 0); #endif #ifdef MIKROE_BMA400_READ_MODE_INTERRUPT +#if (defined(SLI_SI917)) + sl_gpio_t gpio_port_pin = + { MIKROE_BMA400_INT1_PIN / 16, MIKROE_BMA400_INT1_PIN % 16 }; + sl_gpio_driver_configure_interrupt(&gpio_port_pin, + GPIO_M4_INTR, + SL_GPIO_INTERRUPT_RISING_EDGE, + (void *)&app_gpio_int_cb, + AVL_INTR_NO); +#else + GPIO_PinModeSet(MIKROE_BMA400_INT1_PORT, MIKROE_BMA400_INT1_PIN, gpioModeInputPullFilter, @@ -224,11 +284,11 @@ static sl_status_t app_bma400_init(void) GPIO_ExtIntConfig(MIKROE_BMA400_INT1_PORT, MIKROE_BMA400_INT1_PIN, MIKROE_BMA400_INT1_PIN, - 1, - 0, - 1); + true, + false, + true); GPIOINT_CallbackRegister(MIKROE_BMA400_INT1_PIN, app_gpio_int_cb); - GPIO_IntEnable(MIKROE_BMA400_INT1_PIN); +#endif #endif return SL_STATUS_OK; @@ -257,8 +317,8 @@ static sl_status_t app_bma400_read_data(void) y = lsb_to_ms2(accel.y, 2, 12); z = lsb_to_ms2(accel.z, 2, 12); t = (float)accel.sensortime * SENSOR_TICK_TO_S; - printf( - "Gravity-x : %.2f, Gravity-y : %.2f, Gravity-z : %.2f, t(s) : %.4f\r\n", + app_printf( + "Gravity-x : %.2f, Gravity-y : %.2f, Gravity-z : %.2f, t(s) : %.4f\r\n", x, y, z, diff --git a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp index 097a1c5f..659e6457 100644 --- a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp +++ b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c.slcp @@ -29,12 +29,11 @@ include: component: - id: sl_system - id: device_init -- id: sleeptimer - id: i2cspm instance: [mikroe] - id: iostream_eusart instance: [vcom] -- id: printf +- id: app_log - id: gpiointerrupt - id: mikroe_accel5_bma400_i2c from: third_party_hw_drivers @@ -44,8 +43,12 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + other_file: - path: ../../documentation/example/mikroe_accel5_bma400/image/hardware_connection.png directory: "image" diff --git a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c_si91x.slcp b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c_si91x.slcp new file mode 100644 index 00000000..316f7bce --- /dev/null +++ b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_i2c_si91x.slcp @@ -0,0 +1,68 @@ +project_name: mikroe_accel5_bma400_i2c +label: Third Party Hardware Drivers - BMA400 - Accel 5 Click (Mikroe) - I2C +package: platform +description: | + This example project shows an example for Mikroe Accel 5 Click driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_accel5_bma400/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: mikroe_accel5_bma400_i2c + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_accel5_bma400/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_accel5_bma400/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_accel5_bma400/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp index 6dc4cb70..e495cb88 100644 --- a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp +++ b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi.slcp @@ -29,12 +29,11 @@ include: component: - id: sl_system - id: device_init -- id: sleeptimer - id: spidrv instance: [mikroe] - id: iostream_eusart instance: [vcom] -- id: printf +- id: app_log - id: gpiointerrupt - id: mikroe_accel5_bma400_spi from: third_party_hw_drivers @@ -44,7 +43,11 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" other_file: - path: ../../documentation/example/mikroe_accel5_bma400/image/hardware_connection.png diff --git a/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi_si91x.slcp b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi_si91x.slcp new file mode 100644 index 00000000..30262c59 --- /dev/null +++ b/app/example/mikroe_accel5_bma400/mikroe_accel5_bma400_spi_si91x.slcp @@ -0,0 +1,65 @@ +project_name: mikroe_accel5_bma400_spi +label: Third Party Hardware Drivers - BMA400 - Accel 5 Click (Mikroe) - SPI +package: platform +description: | + This example project shows an example for Mikroe Accel 5 Click driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_accel5_bma400/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mikroe_accel5_bma400_spi + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_accel5_bma400/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_accel5_bma400/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_accel5_bma400/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_accurrent/app.c b/app/example/mikroe_accurrent/app.c new file mode 100644 index 00000000..6d30d40c --- /dev/null +++ b/app/example/mikroe_accurrent/app.c @@ -0,0 +1,95 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ +#include "mikroe_accurrent.h" +#include "sl_sleeptimer.h" + +#if (defined(SLI_SI917)) +#include "sl_si91x_gspi.h" +#else +#include "sl_spidrv_instances.h" +#endif + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif + +static mikroe_spi_handle_t app_spi_instance = NULL; +static volatile uint8_t timer_flag; +static sl_sleeptimer_timer_handle_t app_timer_handle; +static void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, + void *data); + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void) +{ + sl_status_t sc; + +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + + sc = mikroe_accurrent_init(app_spi_instance); + if (sc != SL_STATUS_OK) { + app_printf("Initialization error. Please check again ...\r\n"); + return; + } + + app_printf("Initialization successfully.\r\n"); + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + 1000, + app_timer_callback, + NULL, 0, 0); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + if (timer_flag) { + timer_flag = 0; + app_printf("Current value: %.3f mA\r\n", mikroe_accurrent_get_ma()); + } +} + +/***************************************************************************//** + * Static function implementation. + ******************************************************************************/ +static void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, + void *data) +{ + (void) handle; + (void) data; + + timer_flag = 1; +} diff --git a/app/example/mikroe_accurrent/app.h b/app/example/mikroe_accurrent/app.h new file mode 100644 index 00000000..02bedf57 --- /dev/null +++ b/app/example/mikroe_accurrent/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/app/example/silabs_pir_ira_s210st01/main.c b/app/example/mikroe_accurrent/main.c similarity index 100% rename from app/example/silabs_pir_ira_s210st01/main.c rename to app/example/mikroe_accurrent/main.c diff --git a/app/example/mikroe_accurrent/mikroe_accurrent.slcp b/app/example/mikroe_accurrent/mikroe_accurrent.slcp new file mode 100644 index 00000000..5fc8bb79 --- /dev/null +++ b/app/example/mikroe_accurrent/mikroe_accurrent.slcp @@ -0,0 +1,66 @@ +# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file. +project_name: mikroe_accurrent +label: Third Party Hardware Drivers - AC Current Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe AC Current Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_accurrent/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: device_init +- id: sleeptimer +- id: accurrent + from: third_party_hw_drivers +- id: iostream_eusart + instance: [vcom] +- id: sleeptimer +- id: app_log +- id: app_assert + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 + +other_file: + - path: ../../documentation/example/mikroe_accurrent/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_accurrent/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_accurrent/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_accurrent/image/install_float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true \ No newline at end of file diff --git a/app/example/mikroe_accurrent/mikroe_accurrent_si91x.slcp b/app/example/mikroe_accurrent/mikroe_accurrent_si91x.slcp new file mode 100644 index 00000000..54198c39 --- /dev/null +++ b/app/example/mikroe_accurrent/mikroe_accurrent_si91x.slcp @@ -0,0 +1,67 @@ +project_name: mikroe_accurrent_si91x +label: Third Party Hardware Drivers - AC Current Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe AC Current Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_accurrent/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: accurrent + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_accurrent/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_accurrent/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_accurrent/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_accurrent/image/install_float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_alcohol_mq3/app.c b/app/example/mikroe_alcohol_mq3/app.c index 30611490..c5d7f3d2 100644 --- a/app/example/mikroe_alcohol_mq3/app.c +++ b/app/example/mikroe_alcohol_mq3/app.c @@ -51,7 +51,7 @@ #if (defined(SLI_SI917)) #define app_printf(...) DEBUGOUT(__VA_ARGS__) -static uint8_t channel = SL_ADC_CHANNEL_0; +static uint8_t channel = SL_ADC_CHANNEL_1; #else #define app_printf(...) app_log(__VA_ARGS__) #endif diff --git a/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp index 2c437598..490add5e 100644 --- a/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp +++ b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3.slcp @@ -45,12 +45,10 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_2.png + - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_alcohol_mq3/image/console_log.png directory: "image" diff --git a/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3_si91x.slcp b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3_si91x.slcp index 459e8fbc..f2cfc72f 100644 --- a/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3_si91x.slcp +++ b/app/example/mikroe_alcohol_mq3/mikroe_alcohol_mq3_si91x.slcp @@ -1,8 +1,8 @@ project_name: mikroe_alcohol_mq3_si91x package: platform -label: Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe) - Si91x +label: Third Party Hardware Drivers - MQ3 - Alcohol Click (Mikroe) description: | - This example project shows an example for Mikroe Alcohol Click board driver integration on Si91x. + This example project shows an example for Mikroe Alcohol Click board driver integration. category: Example|Platform quality: evaluation @@ -36,20 +36,18 @@ component: from: wiseconnect3_sdk - id: si917_memory_default_config from: wiseconnect3_sdk -- instance: [channel_0] +- instance: [channel_1] from: wiseconnect3_sdk id: adc_instance sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 other_file: - - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example_2.png + - path: ../../documentation/example/mikroe_alcohol_mq3/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_alcohol_mq3/image/console_log.png directory: "image" diff --git a/app/example/mikroe_barcode2_em3080w/app.c b/app/example/mikroe_barcode2_em3080w/app.c index 10a87ea5..81711eb5 100644 --- a/app/example/mikroe_barcode2_em3080w/app.c +++ b/app/example/mikroe_barcode2_em3080w/app.c @@ -1,10 +1,10 @@ /***************************************************************************//** * @file app.c - * @brief Barcode Decoder Example Application + * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************** + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* * * SPDX-License-Identifier: Zlib * @@ -27,46 +27,71 @@ * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************* - * # Evaluation Quality + * # Experimental Quality * This code has been minimally tested to ensure that it builds and is suitable * as a demonstration for evaluation purposes only. This code will be maintained * at the sole discretion of Silicon Labs. ******************************************************************************/ - +#include "mikroe_em3080w.h" +#include "sl_sleeptimer.h" +#include "app_assert.h" #include + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_usart.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define USART_INSTANCE_USED UART_1 +static usart_peripheral_t uart_instance = USART_INSTANCE_USED; + +#else /* None Si91x device */ +#include "app_log.h" #include "sl_iostream_init_usart_instances.h" #include "sl_iostream_init_eusart_instances.h" -#include "sl_sleeptimer.h" -#include "app_log.h" - -#include "mikroe_em3080w.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define PROCESS_COUNTER 500 #define PROCESS_RX_BUFFER_SIZE 600 #define PROCESS_PARSER_BUFFER_SIZE 600 -enum SCAN_MODE { +typedef enum { SCAN_ENABLE, SCAN_DISABLE, SCAN_WAIT -}; - -static uint32_t last_tick = 0; -static enum SCAN_MODE scan_mode = SCAN_ENABLE; +}SCAN_MODE; mikroe_barcode2_t barcode2; +static uint32_t last_tick = 0; +static SCAN_MODE scan_mode = SCAN_ENABLE; static char current_parser_buf[PROCESS_PARSER_BUFFER_SIZE]; +static mikroe_uart_handle_t app_uart_instance = NULL; /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { +#if (defined(SLI_SI917)) + app_uart_instance = &uart_instance; +#else + app_uart_instance = sl_iostream_uart_mikroe_handle; + sl_iostream_set_default(sl_iostream_vcom_handle); app_log_iostream_set(sl_iostream_vcom_handle); - mikroe_barcode2_init(&barcode2, sl_iostream_uart_mikroe_handle, 0); - mikroe_barcode2_enable_reset(&barcode2, MIKROE_BARCODE2_ENABLE); +#endif + + app_printf("Hello world - Mikroe Barcode2 Example...\r\n"); + sl_status_t sc = mikroe_barcode2_init(&barcode2, app_uart_instance, 0); + app_assert_status(sc); + + sc = mikroe_barcode2_enable_reset(&barcode2, MIKROE_BARCODE2_ENABLE); + app_assert_status(sc); + sl_sleeptimer_delay_millisecond(100); - mikroe_barcode2_enable_reset(&barcode2, MIKROE_BARCODE2_DISABLE); + sc = mikroe_barcode2_enable_reset(&barcode2, MIKROE_BARCODE2_DISABLE); + app_assert_status(sc); + app_printf("mikroe barcode2 init successful\r\n"); } static void barcode2_process(void) @@ -113,12 +138,12 @@ static void barcode2_process(void) } if (rsp_cnt > 0) { if (rsp_cnt > 80) { - app_log_info(" QR Code:\r\n%s\r\n", current_parser_buf); + app_printf("QR Code:\r\n%s\r\n", current_parser_buf); } else { - app_log_info(" Barcode: \r\n%s\r\n", current_parser_buf); + app_printf("Barcode: \r\n%s\r\n", current_parser_buf); } - app_log_info("------------------------\r\n"); + app_printf("------------------------\r\n"); } } @@ -129,17 +154,17 @@ void app_process_action(void) { switch (scan_mode) { case SCAN_ENABLE: - app_log_info(" Scanning enabled \r\n"); - app_log_info("------------------------\r\n"); + app_printf("Scanning enabled\r\n"); + app_printf("------------------------\r\n"); mikroe_barcode2_enable_scaning(&barcode2, MIKROE_BARCODE2_ENABLE); - barcode2_process( ); + barcode2_process(); scan_mode = SCAN_DISABLE; break; case SCAN_DISABLE: mikroe_barcode2_enable_scaning(&barcode2, MIKROE_BARCODE2_DISABLE); - app_log_info(" Scanning disabled \r\n"); - app_log_info("------------------------\r\n"); + app_printf("Scanning disabled\r\n"); + app_printf("------------------------\r\n"); scan_mode = SCAN_WAIT; last_tick = sl_sleeptimer_get_tick_count(); break; diff --git a/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp b/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp index 119f8701..57eb2b8c 100644 --- a/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp +++ b/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w.slcp @@ -1,4 +1,3 @@ -# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file. project_name: mikroe_barcode2_em3080w package: platform label: Third Party Hardware Drivers - EM3080-W - Barcode 2 Click (Mikroe) @@ -43,8 +42,6 @@ component: configuration: - name: SL_IOSTREAM_USART_MIKROE_FLOW_CONTROL_TYPE value: usartHwFlowControlNone -- name: SL_IOSTREAM_USART_MIKROE_BAUDRATE - value: 9600 - name: SL_IOSTREAM_USART_MIKROE_RX_BUFFER_SIZE value: 256 @@ -53,19 +50,15 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_barcode2_em3080w/image/hardware_connection.png directory: "image" - path: ../../documentation/example/mikroe_barcode2_em3080w/image/create_example.png directory: "image" - - path: ../../documentation/example/mikroe_barcode2_em3080w/image/barcode2_config.png - directory: "image" - path: ../../documentation/example/mikroe_barcode2_em3080w/image/log.png directory: "image" - - path: ../../documentation/example/mikroe_barcode2_em3080w/image/uart_config.png - directory: "image" ui_hints: highlight: diff --git a/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w_si91x.slcp b/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w_si91x.slcp new file mode 100644 index 00000000..6ab9e3fe --- /dev/null +++ b/app/example/mikroe_barcode2_em3080w/mikroe_barcode2_em3080w_si91x.slcp @@ -0,0 +1,65 @@ +project_name: mikroe_barcode2_em3080w +package: platform +label: Third Party Hardware Drivers - EM3080-W - Barcode 2 Click (Mikroe) +description: | + This example project shows an example for Mikroe Barcode 2 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_barcode2_em3080w/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mikroe_barcode2 + from: third_party_hw_drivers +- id: app_assert + +configuration: +- name: SL_UART1_DMA_CONFIG_ENABLE + value: "0" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_barcode2_em3080w/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_barcode2_em3080w/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_barcode2_em3080w/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_brushless16_lb11685av/app.c b/app/example/mikroe_brushless16_lb11685av/app.c index aaa2c90c..909bf044 100644 --- a/app/example/mikroe_brushless16_lb11685av/app.c +++ b/app/example/mikroe_brushless16_lb11685av/app.c @@ -3,33 +3,61 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" #include "app_assert.h" #include "sl_sleeptimer.h" #include "mikroe_lb11685av.h" +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + void app_init(void) { sl_status_t ret; ret = mikroe_lb11685av_init(); app_assert(ret == SL_STATUS_OK, "\rMikroe LB11685AV init fail\n"); - app_log("\rMikroe LB11685AV init done"); + app_printf("\rMikroe LB11685AV init done"); sl_sleeptimer_delay_millisecond(500); } @@ -43,20 +71,20 @@ void app_process_action(void) static uint8_t state = 1; if (mikroe_lb11685av_get_rd()) { - app_log("\rMotor lock\n"); + app_printf("\rMotor lock\n"); sl_sleeptimer_delay_millisecond(500); } if (mikroe_lb11685av_get_fg()) { - app_log("\rFG\n"); + app_printf("\rFG\n"); sl_sleeptimer_delay_millisecond(500); } if (!(timer--)) { timer = 5000; if (state) { - app_log("\rMotor stop\n"); + app_printf("\rMotor stop\n"); } else { - app_log("\rMotor rotating\n"); + app_printf("\rMotor rotating\n"); } mikroe_lb11685av_set_en(state); state = !state; diff --git a/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp b/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp index 5af78901..13389dcf 100644 --- a/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp +++ b/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av.slcp @@ -42,7 +42,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_brushless16_lb11685av/image/create_example.png @@ -55,4 +55,4 @@ other_file: ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av_si91x.slcp b/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av_si91x.slcp new file mode 100644 index 00000000..9a9f95c0 --- /dev/null +++ b/app/example/mikroe_brushless16_lb11685av/mikroe_brushless16_lb11685av_si91x.slcp @@ -0,0 +1,61 @@ +project_name: mikroe_brushless16_lv11685av_si91x +package: platform +label: Third Party Hardware Drivers - LB11685AV - Brushless 16 Click (Mikroe) +description: | + This example project shows an example for Mikroe Brushless 16 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_brushless16_lb11685av/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_brushless16 + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_brushless16_lb11685av/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_brushless16_lb11685av/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_brushless16_lb11685av/image/workflow.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp index c3f11083..7febef1f 100644 --- a/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp +++ b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt.slcp @@ -44,13 +44,11 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png directory: "image" - - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png - directory: "image" - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/log.png directory: "image" - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/hardware_connection.png diff --git a/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt_si91x.slcp b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt_si91x.slcp index c5658820..75394d61 100644 --- a/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt_si91x.slcp +++ b/app/example/mikroe_buzz2_cmt_8540s_smt/mikroe_buzz2_cmt_8540s_smt_si91x.slcp @@ -1,8 +1,8 @@ project_name: mikroe_buzz2_cmt_8540s_smt_si91x package: platform -label: Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe) - Si91x +label: Third Party Hardware Drivers - CMT-8540S-SMT - Buzz 2 Click (Mikroe) description: | - This example project shows an example for Mikroe Buzz 2 Click board driver integration on Si91x. + This example project shows an example for Mikroe Buzz 2 Click board driver integration. category: Example|Platform quality: evaluation @@ -43,15 +43,13 @@ component: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 other_file: - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example.png directory: "image" - - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/create_example_si91x.png - directory: "image" - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/log.png directory: "image" - path: ../../documentation/example/mikroe_buzz2_cmt_8540s_smt/image/hardware_connection.png diff --git a/app/example/mikroe_captouch2_cap1166/app.c b/app/example/mikroe_captouch2_cap1166/app.c index 839faf08..752a7caf 100644 --- a/app/example/mikroe_captouch2_cap1166/app.c +++ b/app/example/mikroe_captouch2_cap1166/app.c @@ -3,24 +3,64 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "sl_sleeptimer.h" -#include "sl_spidrv_instances.h" + #include "sl_status.h" -#include "app_log.h" #include "app_assert.h" +#include "sl_sleeptimer.h" #include "mikroe_cap1166.h" +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_gspi.h" +#else +#include "app_log.h" +#include "sl_spidrv_instances.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif + +static mikroe_spi_handle_t app_spi_instance = NULL; + /***************************************************************************//** * Initialize application. ******************************************************************************/ @@ -28,7 +68,13 @@ void app_init(void) { sl_status_t ret_code; - ret_code = mikroe_cap1166_init(sl_spidrv_mikroe_handle); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + + ret_code = mikroe_cap1166_init(app_spi_instance); app_assert_status(ret_code); mikroe_cap1166_reset(); @@ -38,7 +84,7 @@ void app_init(void) mikroe_cap1166_default_cfg(); sl_sleeptimer_delay_millisecond(100); - app_log("\r\n>> Cap Touch 2 is initialized "); + app_printf("\r\n>> Cap Touch 2 is initialized\r\n"); } /***************************************************************************//** @@ -48,16 +94,13 @@ void app_process_action(void) { uint8_t cnt; uint8_t sensor_results[6]; - sl_status_t ret_code; - ret_code = mikroe_cap1166_detect_touch(&sensor_results[0]); - if (ret_code != SL_STATUS_INVALID_PARAMETER) { - for (cnt = 0; cnt < 6; cnt++ ) { - if (sensor_results[cnt] == 1) { - app_log("\r\nInput %d is touched", cnt + 1); - } else if (sensor_results[cnt] == 2) { - app_log("\r\nInput %d is released", cnt + 1); - } + mikroe_cap1166_detect_touch(sensor_results); + for (cnt = 0; cnt < 6; cnt++ ) { + if (sensor_results[cnt] == 1) { + app_printf("\r\nInput %d is touched\r\n", cnt + 1); + } else if (sensor_results[cnt] == 2) { + app_printf("\r\nInput %d is released\r\n", cnt + 1); } } } diff --git a/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp b/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp index a771a3c5..bd4c032b 100644 --- a/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp +++ b/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166.slcp @@ -44,7 +44,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_captouch2_cap1166/image/hardware_connection.png diff --git a/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166_si91x.slcp b/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166_si91x.slcp new file mode 100644 index 00000000..5dc472be --- /dev/null +++ b/app/example/mikroe_captouch2_cap1166/mikroe_captouch2_cap1166_si91x.slcp @@ -0,0 +1,64 @@ +project_name: mikroe_captouch2_cap1166_si91x +package: platform +label: Third Party Hardware Drivers - CAP1166 - Cap Touch 2 Click (Mikroe) +description: | + This example project shows an example for Mikroe Cap Touch 2 click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_captouch2_cap1166/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mikroe_captouch2 + from: third_party_hw_drivers +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_captouch2_cap1166/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_captouch2_cap1166/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_captouch2_cap1166/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_co_mq7/app.c b/app/example/mikroe_co_mq7/app.c index 81d5a97f..5da7dd2c 100644 --- a/app/example/mikroe_co_mq7/app.c +++ b/app/example/mikroe_co_mq7/app.c @@ -3,46 +3,98 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include "sl_status.h" #include "sl_sleeptimer.h" +#include "mikroe_mq7.h" + +#if (defined(SLI_SI917)) +#include "sl_adc_instances.h" +#include "rsi_debug.h" +#else +#include "em_iadc.h" #include "app_log.h" +#endif -#include "mikroe_mq7.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +static uint8_t channel = SL_ADC_CHANNEL_1; +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define READING_INTERVAL_MSEC 3000 static volatile bool timer_is_expire = false; static sl_sleeptimer_timer_handle_t app_timer_handle; +static mikroe_adc_handle_t app_adc_handle = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); void app_init(void) { - if (mikroe_mq7_init(IADC0) == SL_STATUS_OK) { - app_log("Initialize CO sensor successfully\n"); + sl_status_t status; + app_printf("Initializing CO Measurement Application\n"); +#if (defined(SLI_SI917)) + app_adc_handle = &channel; +#else + app_adc_handle = IADC0; +#endif + status = mikroe_mq7_init(app_adc_handle); +#if (defined(SLI_SI917)) + + /** + * Due to calling trim_efuse API on ADC init in driver + * it will change the clock frequency, + * if we are not initialize the debug again + * it will print the garbage data in console output. + */ + DEBUGINIT(); +#endif + if (status != SL_STATUS_OK) { + app_printf("Application Init Error!\n"); + app_printf("Please, run program again ...\n"); - sl_sleeptimer_start_periodic_timer(&app_timer_handle, - READING_INTERVAL_MSEC, - app_timer_cb, - (void *) NULL, - 0, - 0); + for (;;) {} } + app_printf("Initialize CO Sensor successfully.\n"); + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_cb, + (void *) NULL, + 0, + 0); } /***************************************************************************//** @@ -57,15 +109,15 @@ void app_process_action(void) timer_is_expire = false; if (mikroe_mq7_read_an_pin_voltage(&value) == SL_STATUS_OK) { - app_log("AN Voltage: %f V\n", value); + app_printf("AN Voltage: %f V\n", value); } else { - app_log("Fail to read\n"); + app_printf("Fail to read\n"); } if (mikroe_mq7_read_an_pin_value(&data_out) == SL_STATUS_OK) { - app_log("ADC Value: %d\n", data_out); + app_printf("ADC Value: %d\n", data_out); } else { - app_log("Fail to read\n"); + app_printf("Fail to read\n"); } } } diff --git a/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp b/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp index 3f7ff974..6f291a5d 100644 --- a/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp +++ b/app/example/mikroe_co_mq7/mikroe_co_mq7.slcp @@ -50,15 +50,13 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_co_mq7/image/hardware_connection.png directory: "image" -- path: ../../documentation/example/mikroe_co_mq7/image/default_configuration.png - directory: "image" define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 ui_hints: highlight: diff --git a/app/example/mikroe_co_mq7/mikroe_co_mq7_si91x.slcp b/app/example/mikroe_co_mq7/mikroe_co_mq7_si91x.slcp new file mode 100644 index 00000000..97523d64 --- /dev/null +++ b/app/example/mikroe_co_mq7/mikroe_co_mq7_si91x.slcp @@ -0,0 +1,70 @@ +project_name: mikroe_co_mq7_si91x +package: platform +label: Third Party Hardware Drivers - MQ7 - CO Click (Mikroe) +description: | + This example project shows an example for Mikroe CO Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_co_mq7/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: + +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_co + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: +- path: ../../documentation/example/mikroe_co_mq7/image/create_example.png + directory: "image" +- path: ../../documentation/example/mikroe_co_mq7/image/float.png + directory: "image" +- path: ../../documentation/example/mikroe_co_mq7/image/log.png + directory: "image" +- path: ../../documentation/example/mikroe_co_mq7/image/hardware_connection.png + directory: "image" + +sdk_extension: +- id: wiseconnect3_sdk + version: 3.3.4 +- id: third_party_hw_drivers + version: 4.0.0 + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_dcmotor24_l9958/app.c b/app/example/mikroe_dcmotor24_l9958/app.c index 4c82a7c9..1c0d1e6b 100644 --- a/app/example/mikroe_dcmotor24_l9958/app.c +++ b/app/example/mikroe_dcmotor24_l9958/app.c @@ -3,27 +3,71 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "mikroe_l9958.h" -#include "app_log.h" -#include "sl_spidrv_instances.h" #include "sl_pwm_instances.h" #include "sl_sleeptimer.h" #include "app_assert.h" +#if (defined(SLI_SI917)) +#include "sl_si91x_gspi.h" +#else +#include "sl_spidrv_instances.h" +#endif + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + #define APP_TIMER_TIMEOUT 500 +#if (defined(SLI_SI917)) +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif + +mikroe_spi_handle_t app_spi_instance = NULL; +mikroe_pwm_handle_t app_pwm_instance = NULL; + static volatile bool app_timer_expire = false; static sl_sleeptimer_timer_handle_t app_timer_handle; static void app_timer_handle_callback(sl_sleeptimer_timer_handle_t *handle, @@ -36,9 +80,21 @@ void app_init(void) { sl_status_t sc; - if (mikroe_l9958_init(sl_spidrv_mikroe_handle, - &sl_pwm_mikroe) == SL_STATUS_OK) { - app_log("DC Motor 24 Click initializes successfully\n"); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + +#if (defined(SLI_SI917)) + app_pwm_instance = &sl_pwm_channel_0_config; +#else + app_pwm_instance = &sl_pwm_mikroe; +#endif + + if (mikroe_l9958_init(app_spi_instance, + app_pwm_instance) == SL_STATUS_OK) { + app_printf("DC Motor 24 Click initializes successfully\n"); } sc = mikroe_l9958_default_cfg(); app_assert_status(sc); @@ -62,12 +118,12 @@ void app_process_action(void) if (app_timer_expire) { if (SL_STATUS_OK == mikroe_l9958_set_duty_cycle((float)duty_pct / 100)) { - app_log("Duty cycle: %d\n", duty_pct); + app_printf("Duty cycle: %d\n", duty_pct); } if ((100 == duty_pct) || (0 == duty_pct)) { duty_step = -duty_step; if (0 == duty_pct) { - app_log("Switch direction\n"); + app_printf("Switch direction\n"); mikroe_l9958_switch_direction(); } } diff --git a/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp b/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp index 8b715e80..aa29fd09 100644 --- a/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp +++ b/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958.slcp @@ -47,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_dcmotor24_l9958/image/create_example.png diff --git a/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958_si91x.slcp b/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958_si91x.slcp new file mode 100644 index 00000000..d1539f77 --- /dev/null +++ b/app/example/mikroe_dcmotor24_l9958/mikroe_dcmotor24_l9958_si91x.slcp @@ -0,0 +1,67 @@ +project_name: mikroe_dcmotor24_l9958_si91x +package: platform +label: Third Party Hardware Drivers - L9958 - DC Motor 24 Click (Mikroe) +description: | + This example project shows an example for Mikroe DC Motor 24 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_dcmotor24_l9958/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- instance: [channel_0] + from: wiseconnect3_sdk + id: pwm_instance +- id: dcmotor24_l9958 + from: third_party_hw_drivers +- id: app_assert + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_dcmotor24_l9958/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_dcmotor24_l9958/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_dcmotor24_l9958/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_dcmotor26_tb9053ftg/app.c b/app/example/mikroe_dcmotor26_tb9053ftg/app.c index 3088a300..a3d9d014 100644 --- a/app/example/mikroe_dcmotor26_tb9053ftg/app.c +++ b/app/example/mikroe_dcmotor26_tb9053ftg/app.c @@ -1,31 +1,75 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "sl_status.h" -#include "app_log.h" -#include "sl_i2cspm_instances.h" -#include "sl_spidrv_instances.h" -#include "em_iadc.h" #include "sl_sleeptimer.h" -#include "app_assert.h" #include "mikroe_tb9053ftg.h" +#include "app_assert.h" -#define APP_SET_MODE_TIMER_TIMEOUT 3000 -#define APP_SET_DUTY_TIMER_TIMEOUT 500 +#if (defined(SLI_SI917)) +#include "sl_si91x_ssi.h" +#include "sl_i2c_instances.h" +#include "sl_adc_instances.h" +#include "rsi_debug.h" +#else +#include "sl_spidrv_instances.h" +#include "sl_i2cspm_instances.h" +#include "em_iadc.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +#define app_printf(...) DEBUGOUT(__VA_ARGS__) + +static sl_ssi_instance_t ssi_instance = SL_SSI_MASTER_ACTIVE; +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +static uint8_t adc_channel = SL_ADC_CHANNEL_1; +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#define APP_SET_MODE_TIMER_TIMEOUT 3000 +#define APP_SET_DUTY_TIMER_TIMEOUT 500 + +mikroe_spi_handle_t app_spi_instance = NULL; +mikroe_i2c_handle_t app_i2c_instance = NULL; +mikroe_adc_handle_t app_adc_handle = NULL; static volatile bool duty_changed = false; static volatile uint8_t mode; @@ -46,17 +90,27 @@ void app_init(void) { sl_status_t sc; - app_log("Mikroe DC Motor 26 Click Driver - Example\n"); - app_log("======= Application initialization =======\n"); +#if (defined(SLI_SI917)) + app_spi_instance = &ssi_instance; + app_i2c_instance = &i2c_instance; + app_adc_handle = &adc_channel; +#else + app_spi_instance = sl_spidrv_mikroe_handle; + app_i2c_instance = sl_i2cspm_mikroe; + app_adc_handle = IADC0; +#endif + + app_printf("Mikroe DC Motor 26 Click Driver - Example\n"); + app_printf("======= Application initialization =======\n"); - sc = mikroe_tb9053ftg_init(sl_spidrv_mikroe_handle, - sl_i2cspm_mikroe, - IADC0); + sc = mikroe_tb9053ftg_init(app_spi_instance, + app_i2c_instance, + app_adc_handle); if (SL_STATUS_OK != sc) { - app_log("DC Motor 26 Click initialized failed!\n"); + app_printf("DC Motor 26 Click initialized failed!\n"); return; } else { - app_log("DC Motor 26 Click initialized successfully!\n"); + app_printf("DC Motor 26 Click initialized successfully!\n"); } mikroe_tb9053ftg_default_cfg(); @@ -83,8 +137,8 @@ static void application_task(void) mode = MIKROE_TB9053FTG_MODE_OUTPUT_OFF; sc = mikroe_tb9053ftg_set_ch1_operation_mode(mode); app_assert_status(sc); - app_log("\nCH1 MODE: OFF\n"); - app_log("Change to FORWARD MODE after 3 seconds ...\n"); + app_printf("\nCH1 MODE: OFF\n"); + app_printf("Change to FORWARD MODE after 3 seconds ...\n"); sc = sl_sleeptimer_start_timer_ms(&set_mode_timer, APP_SET_MODE_TIMER_TIMEOUT, app_set_mode_timer_callback, @@ -109,17 +163,17 @@ static void application_task(void) if (MIKROE_TB9053FTG_MODE_FORWARD == mode) { sc = mikroe_tb9053ftg_set_ch1_operation_mode(mode); app_assert_status(sc); - app_log("\nCH1 MODE: FORWARD\n"); + app_printf("\nCH1 MODE: FORWARD\n"); sc = mikroe_tb9053ftg_set_cm_sel_pin(MIKROE_TB9053FTG_PIN_LOW_LEVEL); app_assert_status(sc); while (duty < MIKROE_TB9053FTG_CONFIG56_DUTY_PERIOD_MAX) { if (duty_changed) { sc = mikroe_tb9053ftg_set_ch1_duty_period(duty); app_assert_status(sc); - app_log("Duty: %d\n", duty); + app_printf("Duty: %d\n", duty); sc = mikroe_tb9053ftg_get_motor_current(¤t); app_assert_status(sc); - app_log("Current: %1.2f mA\n", current * 1000); + app_printf("Current: %1.2f mA\n", current * 1000); duty += 100; duty_changed = false; } @@ -132,7 +186,7 @@ static void application_task(void) 0, 0); mode_changed = false; - app_log("Change to BRAKE MODE after 3 seconds ...\n"); + app_printf("Change to BRAKE MODE after 3 seconds ...\n"); } } @@ -141,13 +195,13 @@ static void application_task(void) if (MIKROE_TB9053FTG_MODE_BRAKE == mode) { sc = mikroe_tb9053ftg_set_ch1_operation_mode(mode); app_assert_status(sc); - app_log("\nCH1 MODE: BRAKE\n"); + app_printf("\nCH1 MODE: BRAKE\n"); sl_sleeptimer_restart_timer_ms(&set_mode_timer, 3000, app_set_mode_timer_callback, NULL, 0, 0); - app_log("Change to REVERSE MODE after 3 seconds ...\n"); + app_printf("Change to REVERSE MODE after 3 seconds ...\n"); mode_changed = false; } } @@ -159,13 +213,13 @@ static void application_task(void) app_assert_status(sc); sc = mikroe_tb9053ftg_set_cm_sel_pin(MIKROE_TB9053FTG_PIN_HIGH_LEVEL); app_assert_status(sc); - app_log("\nCH1 MODE: REVERSE\n"); + app_printf("\nCH1 MODE: REVERSE\n"); while (duty < MIKROE_TB9053FTG_CONFIG56_DUTY_PERIOD_MAX) { if (duty_changed) { mikroe_tb9053ftg_set_ch1_duty_period(duty); - app_log("Duty: %d\n", duty); + app_printf("Duty: %d\n", duty); mikroe_tb9053ftg_get_motor_current(¤t); - app_log("Current: %1.2f mA\n", current * 1000); + app_printf("Current: %1.2f mA\n", current * 1000); duty += 100; duty_changed = false; } diff --git a/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp b/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp index bac25af8..6491fc51 100644 --- a/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp +++ b/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg.slcp @@ -47,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_dcmotor26_tb9053ftg/image/create_project.png @@ -56,8 +56,6 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_dcmotor26_tb9053ftg/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_alcohol_mq3/image/install_float.png - directory: "image" ui_hints: highlight: diff --git a/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg_si91x.slcp b/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg_si91x.slcp new file mode 100644 index 00000000..b2b12076 --- /dev/null +++ b/app/example/mikroe_dcmotor26_tb9053ftg/mikroe_dcmotor26_tb9053ftg_si91x.slcp @@ -0,0 +1,74 @@ +project_name: mikroe_dcmotor26_tb9053ftg +package: platform +label: Third Party Hardware Drivers - TB9053FTG - DC Motor 26 Click (Mikroe) +description: | + This example project shows an example for Mikroe DC Motor 26 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_dcmotor26_tb9053ftg/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: dcmotor26_tb9053ftg + from: third_party_hw_drivers +- id: app_assert + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_dcmotor26_tb9053ftg/image/create_project.png + directory: "image" + - path: ../../documentation/example/mikroe_dcmotor26_tb9053ftg/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_dcmotor26_tb9053ftg/image/hardware_connection.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_dcmotor3_tb6549fg/app.c b/app/example/mikroe_dcmotor3_tb6549fg/app.c index 98a29a7f..5def6543 100644 --- a/app/example/mikroe_dcmotor3_tb6549fg/app.c +++ b/app/example/mikroe_dcmotor3_tb6549fg/app.c @@ -3,33 +3,71 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "mikroe_tb6549fg.h" -#include "app_log.h" #include "sl_pwm_instances.h" #include "sl_sleeptimer.h" -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif +mikroe_pwm_handle_t app_pwm_instance = NULL; static uint8_t dcmotor3_direction = 1; +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ void app_init(void) { - if (mikroe_tb6549fg_init(&sl_pwm_mikroe) == SL_STATUS_OK) { - app_log("DC Motor 3 Click initializes successfully\n"); +#if (defined(SLI_SI917)) + app_pwm_instance = &sl_pwm_channel_0_config; +#else + app_pwm_instance = &sl_pwm_mikroe; +#endif + + if (mikroe_tb6549fg_init(app_pwm_instance) == SL_STATUS_OK) { + app_printf("DC Motor 3 Click initializes successfully\n"); } mikroe_tb6549fg_set_duty_cycle(0.0); mikroe_tb6549fg_pwm_start(); @@ -49,15 +87,15 @@ void app_process_action(void) if (dcmotor3_direction == 1) { mikroe_tb6549fg_clockwise(); - app_log(">>>> CLOCKWISE \n"); + app_printf(">>>> CLOCKWISE \n"); mikroe_tb6549fg_enable(); } else { mikroe_tb6549fg_counter_clockwise(); - app_log("<<<< COUNTER CLOCKWISE \n"); + app_printf("<<<< COUNTER CLOCKWISE \n"); mikroe_tb6549fg_enable(); } mikroe_tb6549fg_set_duty_cycle(duty); - app_log("Duty: %d%%\r\n", ( uint16_t )(duty_cnt * 10)); + app_printf("Duty: %d%%\r\n", ( uint16_t )(duty_cnt * 10)); sl_sleeptimer_delay_millisecond(500); if (10 == duty_cnt) { diff --git a/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp b/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp index 7ca0d1e2..830e28d2 100644 --- a/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp +++ b/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg.slcp @@ -1,4 +1,3 @@ -# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file. project_name: mikroe_dcmotor3_tb6549fg package: platform label: Third Party Hardware Drivers - TB6549FG - DC Motor 3 Click (Mikroe) @@ -44,7 +43,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_dcmotor3_tb6549fg/image/create_example.png @@ -58,5 +57,3 @@ ui_hints: highlight: - path: README.md focus: true - - diff --git a/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg_si91x.slcp b/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg_si91x.slcp new file mode 100644 index 00000000..f5e84b25 --- /dev/null +++ b/app/example/mikroe_dcmotor3_tb6549fg/mikroe_dcmotor3_tb6549fg_si91x.slcp @@ -0,0 +1,63 @@ +project_name: mikroe_dcmotor3_tb6549fg_si91x +package: platform +label: Third Party Hardware Drivers - TB6549FG - DC Motor 3 Click (Mikroe) +description: | + This example project shows an example for Mikroe DC Motor 3 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_dcmotor3_tb6549fg/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- instance: [channel_0] + from: wiseconnect3_sdk + id: pwm_instance +- id: mikroe_dcmotor3 + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_dcmotor3_tb6549fg/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_dcmotor3_tb6549fg/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_dcmotor3_tb6549fg/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_e_paper_154_inch/mikroe_e_paper_154_inch.slcp b/app/example/mikroe_e_paper_154_inch/mikroe_e_paper_154_inch.slcp deleted file mode 100644 index a0c48e00..00000000 --- a/app/example/mikroe_e_paper_154_inch/mikroe_e_paper_154_inch.slcp +++ /dev/null @@ -1,48 +0,0 @@ -project_name: mikroe_e_paper_display -package: platform -label: Third Party Hardware Drivers - E-Paper Display 1,54" 200x200 dots (Mikroe) -description: | - This example project shows an example for E-Paper Display 1,54" 200x200 dots driver integration. -category: Example|Platform -quality: evaluation -filter: -- name: Device Type - value: [SoC] -- name: MCU - value: [32-bit MCU] -- name: Project Difficulty - value: [Beginner] -readme: -- path: ../../documentation/example/mikroe_e_paper_154_inch/README.md -source: -- path: app.c -- path: main.c -include: -- path: '' - file_list: - - path: app.h -component: -- id: sl_system -- id: device_init -- id: spidrv - instance: [mikroe] -- id: mikroe_epaper_display_154_inch - from: third_party_hw_drivers -- id: services_oled_glib - from: third_party_hw_drivers -define: -- name: DEBUG_EFM -sdk_extension: -- id: third_party_hw_drivers - version: 3.0.0 -other_file: - - path: ../../documentation/example/mikroe_e_paper_154_inch/image/hardware_connection.png - directory: image - - path: ../../documentation/example/mikroe_e_paper_154_inch/image/create_example.png - directory: image - - path: ../../documentation/example/mikroe_e_paper_154_inch/image/result.png - directory: image -ui_hints: - highlight: - - path: README.md - focus: true \ No newline at end of file diff --git a/app/example/mikroe_e_paper_154_inch/app.c b/app/example/mikroe_eink_display/app.c similarity index 63% rename from app/example/mikroe_e_paper_154_inch/app.c rename to app/example/mikroe_eink_display/app.c index 2fd231e7..852aa1cd 100644 --- a/app/example/mikroe_e_paper_154_inch/app.c +++ b/app/example/mikroe_eink_display/app.c @@ -1,31 +1,59 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include -#include "sl_spidrv_instances.h" -#include "mikroe_e_paper_154_inch_config.h" -#include "mikroe_e_paper_154_inch.h" +#include "mikroe_eink_display_config.h" +#include "mikroe_eink_display.h" #include "glib.h" +#if (defined(SLI_SI917)) +#include "sl_si91x_gspi.h" +#else +#include "sl_spidrv_instances.h" +#endif + +#if (defined(SLI_SI917)) +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif + const char *str1 = "SILICON LABS"; const char *str2 = "APPLICATION EXAMPLES"; + +static mikroe_spi_handle_t app_spi_instance = NULL; static glib_context_t g_context; const uint8_t EINK154_LUT_TABLE[30] = @@ -76,22 +104,28 @@ static const unsigned char silicon_labs_logo_96x35[] = { void app_init(void) { +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + glib_init(&g_context); g_context.wrap = false; - g_context.text_color = E_PAPER_SCREEN_COLOR_BLACK; + g_context.text_color = EINK_DISPLAY_SCREEN_COLOR_BLACK; - mikroe_e_paper_154_inch_init(sl_spidrv_mikroe_handle); - mikroe_e_paper_154_inch_start_config(); - mikroe_e_paper_154_inch_set_lut(EINK154_LUT_TABLE, 30); + mikroe_eink_display_init(app_spi_instance); + mikroe_eink_display_start_config(); + mikroe_eink_display_set_lut(EINK154_LUT_TABLE, 30); - glib_fill(&g_context, E_PAPER_SCREEN_COLOR_WHITE); + glib_fill(&g_context, EINK_DISPLAY_SCREEN_COLOR_WHITE); glib_draw_xbitmap(&g_context, 52, 82, silicon_labs_logo_96x35, - 96, 35, EINK154_SCREEN_COLOR_BLACK); + 96, 35, EINK_DISPLAY_SCREEN_COLOR_BLACK); glib_draw_string(&g_context, str1, - (MIKROE_E_PAPER_WIDTH - strlen(str1) * 6 + 1) / 2, 140); + (MIKROE_EINK_DISPLAY_WIDTH - strlen(str1) * 6 + 1) / 2, 140); glib_draw_string(&g_context, str2, - (MIKROE_E_PAPER_WIDTH - strlen(str2) * 6 + 1) / 2, 160); + (MIKROE_EINK_DISPLAY_WIDTH - strlen(str2) * 6 + 1) / 2, 160); glib_update_display(); } diff --git a/app/example/mikroe_eink_display/app.h b/app/example/mikroe_eink_display/app.h new file mode 100644 index 00000000..02bedf57 --- /dev/null +++ b/app/example/mikroe_eink_display/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2601b/sl_spidrv_st7789_config.h b/app/example/mikroe_eink_display/brd4182a/sl_spidrv_mikroe_config.h similarity index 55% rename from driver/public/silabs/tft_lcd_st7789/config/brd2601b/sl_spidrv_st7789_config.h rename to app/example/mikroe_eink_display/brd4182a/sl_spidrv_mikroe_config.h index f5117d37..4d182fe4 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2601b/sl_spidrv_st7789_config.h +++ b/app/example/mikroe_eink_display/brd4182a/sl_spidrv_mikroe_config.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file sl_spidrv_st7789_config.h + * @file * @brief SPIDRV Config ******************************************************************************* * # License @@ -28,75 +28,94 @@ * ******************************************************************************/ -#ifndef SL_SPIDRV_ST7789_CONFIG_H -#define SL_SPIDRV_ST7789_CONFIG_H +#ifndef SL_SPIDRV_MIKROE_CONFIG_H +#define SL_SPIDRV_MIKROE_CONFIG_H #include "spidrv.h" // <<< Use Configuration Wizard in Context Menu >>> // SPIDRV settings -// SPI bitrate +// SPI bitrate // Default: 1000000 -#define SL_SPIDRV_ST7789_BITRATE 40000000 +#define SL_SPIDRV_MIKROE_BITRATE 1000000 -// SPI frame length <4-16> +// SPI frame length <4-16> // Default: 8 -#define SL_SPIDRV_ST7789_FRAME_LENGTH 8 +#define SL_SPIDRV_MIKROE_FRAME_LENGTH 8 -// SPI mode +// SPI mode // Master // Slave -#define SL_SPIDRV_ST7789_TYPE spidrvMaster +#define SL_SPIDRV_MIKROE_TYPE spidrvMaster -// Bit order on the SPI bus +// Bit order on the SPI bus // LSB transmitted first // MSB transmitted first -#define SL_SPIDRV_ST7789_BIT_ORDER spidrvBitOrderMsbFirst +#define SL_SPIDRV_MIKROE_BIT_ORDER spidrvBitOrderMsbFirst -// SPI clock mode +// SPI clock mode // SPI mode 0: CLKPOL=0, CLKPHA=0 // SPI mode 1: CLKPOL=0, CLKPHA=1 // SPI mode 2: CLKPOL=1, CLKPHA=0 // SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ST7789_CLOCK_MODE spidrvClockMode0 +#define SL_SPIDRV_MIKROE_CLOCK_MODE spidrvClockMode0 -// SPI master chip select (CS) control scheme. +// SPI master chip select (CS) control scheme. // CS controlled by the SPI driver // CS controlled by the application -#define SL_SPIDRV_ST7789_CS_CONTROL spidrvCsControlApplication +#define SL_SPIDRV_MIKROE_CS_CONTROL spidrvCsControlAuto -// SPI slave transfer start scheme +// SPI slave transfer start scheme // Transfer starts immediately // Transfer starts when the bus is idle (CS deasserted) // Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ST7789_SLAVE_START_MODE spidrvSlaveStartImmediate +#define SL_SPIDRV_MIKROE_SLAVE_START_MODE spidrvSlaveStartImmediate // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// SL_SPIDRV_ST7789 -// $[USART_SL_SPIDRV_ST7789] -#define SL_SPIDRV_ST7789_PERIPHERAL USART0 -#define SL_SPIDRV_ST7789_PERIPHERAL_NO 0 +// SL_SPIDRV_MIKROE +// $[USART_SL_SPIDRV_MIKROE] +#ifndef SL_SPIDRV_MIKROE_PERIPHERAL +#define SL_SPIDRV_MIKROE_PERIPHERAL USART0 +#endif +#ifndef SL_SPIDRV_MIKROE_PERIPHERAL_NO +#define SL_SPIDRV_MIKROE_PERIPHERAL_NO 0 +#endif // USART0 TX on PC00 -#define SL_SPIDRV_ST7789_TX_PORT gpioPortC -#define SL_SPIDRV_ST7789_TX_PIN 3 +#ifndef SL_SPIDRV_MIKROE_TX_PORT +#define SL_SPIDRV_MIKROE_TX_PORT gpioPortC +#endif +#ifndef SL_SPIDRV_MIKROE_TX_PIN +#define SL_SPIDRV_MIKROE_TX_PIN 0 +#endif // USART0 RX on PC01 -#define SL_SPIDRV_ST7789_RX_PORT gpioPortC -#define SL_SPIDRV_ST7789_RX_PIN 2 +#ifndef SL_SPIDRV_MIKROE_RX_PORT +#define SL_SPIDRV_MIKROE_RX_PORT gpioPortC +#endif +#ifndef SL_SPIDRV_MIKROE_RX_PIN +#define SL_SPIDRV_MIKROE_RX_PIN 1 +#endif // USART0 CLK on PC02 -#define SL_SPIDRV_ST7789_CLK_PORT gpioPortC -#define SL_SPIDRV_ST7789_CLK_PIN 1 +#ifndef SL_SPIDRV_MIKROE_CLK_PORT +#define SL_SPIDRV_MIKROE_CLK_PORT gpioPortC +#endif +#ifndef SL_SPIDRV_MIKROE_CLK_PIN +#define SL_SPIDRV_MIKROE_CLK_PIN 2 +#endif // USART0 CS on PC03 -#define SL_SPIDRV_ST7789_CS_PORT gpioPortA -#define SL_SPIDRV_ST7789_CS_PIN 7 - -// [USART_SL_SPIDRV_ST7789]$ +#ifndef SL_SPIDRV_MIKROE_CS_PORT +#define SL_SPIDRV_MIKROE_CS_PORT gpioPortC +#endif +#ifndef SL_SPIDRV_MIKROE_CS_PIN +#define SL_SPIDRV_MIKROE_CS_PIN 3 +#endif +// [USART_SL_SPIDRV_MIKROE]$ // <<< sl:end pin_tool >>> -#endif // SL_SPIDRV_ST7789_CONFIG_H +#endif // SL_SPIDRV_MIKROE_CONFIG_H diff --git a/app/example/silabs_triac/main.c b/app/example/mikroe_eink_display/main.c similarity index 100% rename from app/example/silabs_triac/main.c rename to app/example/mikroe_eink_display/main.c diff --git a/app/example/mikroe_eink_display/mikroe_eink_display.slcp b/app/example/mikroe_eink_display/mikroe_eink_display.slcp new file mode 100644 index 00000000..41e6cc90 --- /dev/null +++ b/app/example/mikroe_eink_display/mikroe_eink_display.slcp @@ -0,0 +1,55 @@ +project_name: mikroe_eink_display +package: platform +label: Third Party Hardware Drivers - E-Paper Display - eINK Click (Mikroe) +description: | + This example project shows an example for eINK Click with the E-Paper display. +category: Example|Platform +quality: evaluation +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] +readme: +- path: ../../documentation/example/mikroe_eink_display/README.md +source: +- path: app.c +- path: main.c +include: +- path: '' + file_list: + - path: app.h +component: +- id: sl_system +- id: device_init +- id: spidrv + instance: [mikroe] +- id: mikroe_eink_display + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers +define: +- name: DEBUG_EFM +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +config_file: + - override: + component: spidrv + file_id: spidrv_config + instance: mikroe + path: brd4182a/sl_spidrv_mikroe_config.h + condition: [brd4182a] +other_file: + - path: ../../documentation/example/mikroe_eink_display/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_eink_display/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_eink_display/image/result.png + directory: image +ui_hints: + highlight: + - path: README.md + focus: true \ No newline at end of file diff --git a/app/example/mikroe_eink_display/mikroe_eink_display_si91x.slcp b/app/example/mikroe_eink_display/mikroe_eink_display_si91x.slcp new file mode 100644 index 00000000..9555a0ad --- /dev/null +++ b/app/example/mikroe_eink_display/mikroe_eink_display_si91x.slcp @@ -0,0 +1,60 @@ +project_name: mikroe_eink_display +package: platform +label: Third Party Hardware Drivers - E-Paper Display - eINK Click (Mikroe) +description: | + This example project shows an example for eINK Click with the E-Paper display. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_eink_display/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mikroe_eink_display + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_eink_display/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_eink_display/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_eink_display/image/result.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_emg/app.c b/app/example/mikroe_emg/app.c index f8046d8d..75452a39 100644 --- a/app/example/mikroe_emg/app.c +++ b/app/example/mikroe_emg/app.c @@ -1,29 +1,65 @@ /***************************************************************************//** - * @file app.c - * @brief Top level application functions + * @file app.h + * @brief Application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "sl_sleeptimer.h" -#include "app_log.h" #include "mikroe_emg.h" +#if (defined(SLI_SI917)) +#include "sl_adc_instances.h" +#include "rsi_debug.h" +#else +#include "em_iadc.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +static uint8_t channel = SL_ADC_CHANNEL_1; +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + #define READING_INTERVAL_MSEC 5 static uint32_t time; static volatile bool emg_timer_expire = false; static sl_sleeptimer_timer_handle_t emg_timer; +static mikroe_adc_handle_t app_adc_handle = NULL; static void emg_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, void *data); @@ -34,14 +70,28 @@ static void emg_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, void app_init(void) { sl_status_t status; + app_printf("Application Initialization.\r\n"); +#if (defined(SLI_SI917)) + app_adc_handle = &channel; +#else + app_adc_handle = IADC0; +#endif + status = mikroe_emg_init(app_adc_handle); +#if (defined(SLI_SI917)) - app_log("Application Initialization.\r\n"); - status = mikroe_emg_init(IADC0); + /** + * Due to calling trim_efuse API on ADC init in driver + * it will change the clock frequency, + * if we are not initialize the debug again + * it will print the garbage data in console output. + */ + DEBUGINIT(); +#endif if (status == SL_STATUS_OK) { - app_log("EMG Click is initialized.\r\n"); + app_printf("EMG Click is initialized.\r\n"); } else { - app_log("EMG Click initialization is failed!\r\n"); - app_log(" Please, run program again... \r\n"); + app_printf("EMG Click initialization is failed!\r\n"); + app_printf(" Please, run program again... \r\n"); } time = 0; @@ -69,7 +119,7 @@ void app_process_action(void) emg_timer_expire = false; status = mikroe_emg_read_an_pin_value(&adc_value); if (SL_STATUS_OK == status) { - app_log("%u, %lu\r\n", adc_value, time); + app_printf("%u, %lu\r\n", adc_value, time); } time += READING_INTERVAL_MSEC; } diff --git a/app/example/mikroe_emg/mikroe_emg.slcp b/app/example/mikroe_emg/mikroe_emg.slcp index 9929e8fd..93ef1315 100644 --- a/app/example/mikroe_emg/mikroe_emg.slcp +++ b/app/example/mikroe_emg/mikroe_emg.slcp @@ -41,7 +41,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_emg/image/create_example.png diff --git a/app/example/mikroe_emg/mikroe_emg_si91x.slcp b/app/example/mikroe_emg/mikroe_emg_si91x.slcp new file mode 100644 index 00000000..51313c7b --- /dev/null +++ b/app/example/mikroe_emg/mikroe_emg_si91x.slcp @@ -0,0 +1,70 @@ +project_name: mikroe_emg +package: platform +label: Third Party Hardware Drivers - EMG Click (Mikroe) +description: | + This example project shows an example for Mikroe EMG Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_emg/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: emg + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance + +define: + - name: DEBUG_EFM + +sdk_extension: +- id: wiseconnect3_sdk + version: 3.3.4 +- id: third_party_hw_drivers + version: 4.0.0 + +other_file: + - path: ../../documentation/example/mikroe_emg/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_emg/image/emg_plot.png + directory: image + - path: ../../documentation/example/mikroe_emg/image/emg_setup.png + directory: image + - path: ../../documentation/example/mikroe_emg/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_emg/image/software_layer.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_environment2_sht40_sgp40/app.c b/app/example/mikroe_environment2_sht40_sgp40/app.c index a2a5dad1..fbdaea39 100644 --- a/app/example/mikroe_environment2_sht40_sgp40/app.c +++ b/app/example/mikroe_environment2_sht40_sgp40/app.c @@ -1,34 +1,69 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application + * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ +#include "sl_sleeptimer.h" +#include "mikroe_sht40_sgp40.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" -#include "sl_sleeptimer.h" #include "app_log.h" +#endif -#include "mikroe_sht40_sgp40.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif -#define READING_INTERVAL_MSEC 1000 +#define READING_INTERVAL_MSEC 1000 static bool timer_is_expire = false; static sl_sleeptimer_timer_handle_t app_timer_handle; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); static void app_task(void); @@ -38,28 +73,34 @@ static void app_task(void); *****************************************************************************/ void app_init(void) { - if (SL_STATUS_OK != mikroe_environment2_init(sl_i2cspm_mikroe)) { - app_log("Sensor initialized fail!."); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + if (SL_STATUS_OK != mikroe_environment2_init(app_i2c_instance)) { + app_printf("Sensor initialized fail!."); } else { if (mikroe_environment2_sgp40_measure_test() == SL_STATUS_OK) { - app_log(" All tests passed\r\n"); - app_log(" Successfully\r\n"); + app_printf(" All tests passed\r\n"); + app_printf(" Successfully\r\n"); } else { - app_log(" One or more tests have\r\n"); - app_log(" Failed\r\n"); + app_printf(" One or more tests have\r\n"); + app_printf(" Failed\r\n"); } - app_log("-----------------------\r\n"); + app_printf("-----------------------\r\n"); mikroe_environment2_sgp40_heater_off(); mikroe_environment2_config_sensors(); - sl_sleeptimer_start_periodic_timer(&app_timer_handle, - READING_INTERVAL_MSEC, - app_timer_cb, - (void *) NULL, - 0, - 0); + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_cb, + (void *) NULL, + 0, + 0); } } @@ -83,16 +124,16 @@ static void app_task(void) int32_t voc_index; mikroe_environment2_get_temp_hum(&humidity, &temperature); - app_log(" Humidity : %.2f %% \r\n", humidity); - app_log(" Temperature : %.2f C \r\n", temperature); + app_printf(" Humidity : %.2f %% \r\n", humidity); + app_printf(" Temperature : %.2f C \r\n", temperature); mikroe_environment2_get_air_quality(&air_quality); - app_log(" Air Quality : %d \r\n", air_quality); - app_log("- - - - - - - - - - - \r\n"); + app_printf(" Air Quality : %d \r\n", air_quality); + app_printf("- - - - - - - - - - - \r\n"); mikroe_environment2_get_voc_index(&voc_index); - app_log(" VOC Index : %d \r\n", ( uint16_t ) voc_index); - app_log("-----------------------\r\n"); + app_printf(" VOC Index : %d \r\n", ( uint16_t ) voc_index); + app_printf("-----------------------\r\n"); } static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data) diff --git a/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp b/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp index 769e085b..a329db17 100644 --- a/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp +++ b/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40.slcp @@ -47,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_environment2_sht40_sgp40/image/create_example.png diff --git a/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40_si91x.slcp b/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40_si91x.slcp new file mode 100644 index 00000000..b8c4bb66 --- /dev/null +++ b/app/example/mikroe_environment2_sht40_sgp40/mikroe_environment2_sht40_sgp40_si91x.slcp @@ -0,0 +1,69 @@ +project_name: mikroe_environment2_sht40_sgp40 +package: platform +label: Third Party Hardware Drivers - SGP40 & SHT40 - Environment 2 Click (Mikroe) +description: | + This example project shows an example for Mikroe Environment 2 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_environment2_sht40_sgp40/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: environment2_sgp40_sht40 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_environment2_sht40_sgp40/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_environment2_sht40_sgp40/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_environment2_sht40_sgp40/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_environment2_sht40_sgp40/image/float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_environment3_bme688/app.c b/app/example/mikroe_environment3_bme688/app.c index 29f00245..551b02e4 100644 --- a/app/example/mikroe_environment3_bme688/app.c +++ b/app/example/mikroe_environment3_bme688/app.c @@ -1,34 +1,77 @@ /***************************************************************************//** - * @file + * @file app.c * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ - +#include "sl_component_catalog.h" #include "sl_sleeptimer.h" +#include "bme68x.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" + +#ifdef SL_CATALOG_ENVIRONMENT3_BME688_SPI_PRESENT +#include "mikroe_bme688_spi.h" +#include "mikroe_bme688_spi_config.h" +#include "sl_si91x_gspi.h" +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif + +#ifdef SL_CATALOG_ENVIRONMENT3_BME688_I2C_PRESENT +#include "mikroe_bme688_i2c.h" +#include "mikroe_bme688_i2c_config.h" +#include "sl_i2c_instances.h" +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else /* None Si91x device */ #include "app_log.h" #ifdef SL_CATALOG_ENVIRONMENT3_BME688_SPI_PRESENT #include "sl_spidrv_instances.h" #include "mikroe_bme688_spi.h" +#include "mikroe_bme688_spi_config.h" #endif #ifdef SL_CATALOG_ENVIRONMENT3_BME688_I2C_PRESENT -#include "mikroe_bme688_i2c.h" #include "sl_i2cspm_instances.h" +#include "mikroe_bme688_i2c.h" +#include "mikroe_bme688_i2c_config.h" #endif -#include "bme68x.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define READING_INTERVAL_MSEC 2000 #define HEATER_TEMPERATURE 300 @@ -36,14 +79,6 @@ static bme68x_dev_t bme688; -#ifdef SL_CATALOG_ENVIRONMENT3_BME688_SPI_PRESENT -static bme68x_spi_t bme688_spi; -#endif - -#ifdef SL_CATALOG_ENVIRONMENT3_BME688_I2C_PRESENT -static bme68x_i2c_t bme688_i2c; -#endif - static volatile bool enable_reading_data = false; static sl_sleeptimer_timer_handle_t app_periodic_timer; @@ -52,13 +87,27 @@ static sl_status_t app_bme688_get_data(void); static void app_periodic_timer_cb(sl_sleeptimer_timer_handle_t *timer, void *data); +#ifdef SL_CATALOG_ENVIRONMENT3_BME688_SPI_PRESENT +mikroe_spi_handle_t app_spi_instance = NULL; +#endif +#ifdef SL_CATALOG_ENVIRONMENT3_BME688_I2C_PRESENT +static mikroe_i2c_handle_t app_i2c_instance = NULL; +#endif + /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { if (app_bme688_init() != SL_STATUS_OK) { - app_log("Initialization error. Please check again ...\r\n"); + app_printf("Initialization error. Please check again ...\r\n"); + } else { +#ifdef SL_CATALOG_ENVIRONMENT3_BME688_SPI_PRESENT + app_printf("Environment 3 BME688 - SPI Initialization Successful\r\n"); +#endif +#ifdef SL_CATALOG_ENVIRONMENT3_BME688_I2C_PRESENT + app_printf("Environment 3 BME688 - I2C Initialization Successful\r\n"); +#endif } } @@ -71,7 +120,7 @@ void app_process_action(void) enable_reading_data = false; if (app_bme688_get_data() != SL_STATUS_OK) { - app_log("Reading error. Please check again ...\r\n"); + app_printf("Reading error. Please check again ...\r\n"); } } } @@ -83,21 +132,24 @@ static sl_status_t app_bme688_init(void) bme68x_heatr_conf_t heatr_conf; #ifdef SL_CATALOG_ENVIRONMENT3_BME688_I2C_PRESENT - // Initialize an I2C interface for BME688 - bme688_i2c.handle = sl_i2cspm_mikroe; - bme688_i2c.addr = BME68X_I2C_ADDR_LOW; - bme688.intf_ptr = &bme688_i2c; - rslt = mikroe_bme688_i2c_init(&bme688); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + rslt = mikroe_bme688_i2c_init(&bme688, app_i2c_instance); if (rslt != BME68X_OK) { return SL_STATUS_FAIL; } #endif #ifdef SL_CATALOG_ENVIRONMENT3_BME688_SPI_PRESENT - // Initialize an SPI interface for BME688 - bme688_spi.handle = sl_spidrv_mikroe_handle; - bme688.intf_ptr = &bme688_spi; - rslt = mikroe_bme688_spi_init(&bme688); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + rslt = mikroe_bme688_spi_init(&bme688, app_spi_instance); if (rslt != BME68X_OK) { return SL_STATUS_FAIL; } @@ -159,10 +211,10 @@ static sl_status_t app_bme688_get_data(void) } if (n_fields) { - app_log("\r\nTemperature : %.2f" "\xB0" "C\r\n", data.temperature); - app_log("Humidity : %.2f %%\r\n", data.humidity); - app_log("Pressure : %.2f Pa\r\n", data.pressure); - app_log("Gas resistance : %.2f Ohm\r\n", data.gas_resistance); + app_printf("\r\nTemperature : %.2f" "\xB0" "C\r\n", data.temperature); + app_printf("Humidity : %.2f %%\r\n", data.humidity); + app_printf("Pressure : %.2f Pa\r\n", data.pressure); + app_printf("Gas resistance : %.2f Ohm\r\n", data.gas_resistance); } return SL_STATUS_OK; diff --git a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp index b4824758..80e6e79d 100644 --- a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp +++ b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c.slcp @@ -1,4 +1,3 @@ -# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file. project_name: mikroe_environment3_bme688_i2c package: platform label: Third Party Hardware Drivers - BME688 - Environment 3 click (Mikroe) - I2C @@ -35,7 +34,6 @@ component: - id: iostream_eusart instance: [vcom] - id: app_log -- id: sleeptimer - id: environment3_bme688_i2c from: third_party_hw_drivers @@ -48,7 +46,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_environment3_bme688/image/create_example.png diff --git a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c_si91x.slcp b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c_si91x.slcp new file mode 100644 index 00000000..11143ae6 --- /dev/null +++ b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_i2c_si91x.slcp @@ -0,0 +1,67 @@ +project_name: mikroe_environment3_bme688_i2c_si91x +package: platform +label: Third Party Hardware Drivers - BME688 - Environment 3 click (Mikroe) - I2C +description: | + This example project shows an example for BME688 - Environment 3 Click (Mikroe) - I2C integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_environment3_bme688/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: environment3_bme688_i2c + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_environment3_bme688/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_environment3_bme688/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_environment3_bme688/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_environment3_bme688/image/float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp index c6a23a05..22141ec6 100644 --- a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp +++ b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi.slcp @@ -1,4 +1,3 @@ -# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file. project_name: mikroe_environment3_bme688_spi package: platform label: Third Party Hardware Drivers - BME688 - Environment 3 click (Mikroe) - SPI @@ -35,7 +34,6 @@ component: - id: iostream_eusart instance: [vcom] - id: app_log -- id: sleeptimer - id: environment3_bme688_spi from: third_party_hw_drivers @@ -48,7 +46,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_environment3_bme688/image/create_example.png diff --git a/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi_si91x.slcp b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi_si91x.slcp new file mode 100644 index 00000000..fafc612e --- /dev/null +++ b/app/example/mikroe_environment3_bme688/mikroe_environment3_bme688_spi_si91x.slcp @@ -0,0 +1,64 @@ +project_name: mikroe_environment3_bme688_spi_si91x +package: platform +label: Third Party Hardware Drivers - BME688 - Environment 3 click (Mikroe) - SPI +description: | + This example project shows an example for BME688 - Environment 3 Click (Mikroe) - SPI integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_environment3_bme688/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: environment3_bme688_spi + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_environment3_bme688/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_environment3_bme688/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_environment3_bme688/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_environment3_bme688/image/float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_eth_wiz_w5500/app.c b/app/example/mikroe_eth_wiz_w5500/app.c index 784f36a3..3f1acd9b 100644 --- a/app/example/mikroe_eth_wiz_w5500/app.c +++ b/app/example/mikroe_eth_wiz_w5500/app.c @@ -1,28 +1,40 @@ /***************************************************************************//** - * @file + * @file app.c * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #include #include #include - -#include "sl_spidrv_instances.h" -#include "sl_sleeptimer.h" -#include "app_log.h" -#include "app_assert.h" - #include "w5x00_utils.h" #include "ethernet.h" #include "ethernet_client.h" @@ -32,14 +44,27 @@ #include "http_server.h" #include "w5x00.h" #include "w5x00_utils.h" +#include "sl_sleeptimer.h" +#include "app_assert.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_gspi.h" +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else /* None Si91x device */ +#include "app_log.h" +#include "sl_spidrv_instances.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define USE_DHCP -#define app_log_print_ip(ip) \ - app_log("%d.%d.%d.%d", w5x00_ip4_addr_get_byte(ip, 0), \ - w5x00_ip4_addr_get_byte(ip, 1), \ - w5x00_ip4_addr_get_byte(ip, 2), \ - w5x00_ip4_addr_get_byte(ip, 3)) +#define app_log_print_ip(ip) \ + app_printf("%d.%d.%d.%d", w5x00_ip4_addr_get_byte(ip, 0), \ + w5x00_ip4_addr_get_byte(ip, 1), \ + w5x00_ip4_addr_get_byte(ip, 2), \ + w5x00_ip4_addr_get_byte(ip, 3)) uint8_t mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; w5x00_ip4_addr_t ip = { WIZNET_IP4_DATA(127, 0, 0, 1) }; @@ -52,6 +77,7 @@ w5x00_ethernet_client_t client; w5x00_ip4_addr_t local_ip = { WIZNET_IP4_DATA(10, 42, 0, 242) }; w5x00_ip4_addr_t gateway_ip = { WIZNET_IP4_DATA(10, 42, 0, 1) }; w5x00_ip4_addr_t subnet_mask = { WIZNET_IP4_DATA(255, 255, 255, 0) }; +static mikroe_spi_handle_t app_spi_instance = NULL; static const char *get_content_body(const char *uri) { @@ -97,11 +123,11 @@ void http_client_get_device_public_ip(const char *host, w5x00_ethernet_client_init(&client, ð, 10000); sl_sleeptimer_delay_millisecond(1000); - app_log("Connecting to: %s:%d\r\n", host, port); + app_printf("Connecting to: %s:%d\r\n", host, port); if (SL_STATUS_OK == w5x00_ethernet_client_connect_host(&client, host, port)) { - app_log("\r\nConnected!\r\n\r\n"); + app_printf("\r\nConnected!\r\n\r\n"); snprintf(message, sizeof(message), @@ -109,7 +135,7 @@ void http_client_get_device_public_ip(const char *host, host, path, host); - app_log("HTTP Request:\r\n\r\n%s\r\n\r\n", message); + app_printf("HTTP Request:\r\n\r\n%s\r\n\r\n", message); while (w5x00_ethernet_client_available_for_write(&client) < (int)strlen(message)) {} w5x00_ethernet_client_write(&client, @@ -123,28 +149,30 @@ void http_client_get_device_public_ip(const char *host, if ((length > 0) && (length < (int)sizeof(message))) { message[length] = '\0'; w5x00_ip4_addr_t ip; - const char *body; + const char *body = NULL; - app_log("HTTP Response:\r\n\r\n%s\r\n\r\n", message); + app_printf("HTTP Response:\r\n\r\n%s\r\n\r\n", message); body = get_content_body(message); - // app_log("%.*s", length, message); - app_log("HTTP Response body (public ip address): %s\r\n", body); + // app_printf("%.*s", length, message); + if (NULL != body) { + app_printf("HTTP Response body (public ip address): %s\r\n", body); + } if (body && w5x00_ip4addr_aton(body, &ip)) { - app_log("Public ip (parsed from the body): %d.%d.%d.%d\r\n\r\n", - w5x00_ip4_addr_get_byte(&ip, 0), - w5x00_ip4_addr_get_byte(&ip, 1), - w5x00_ip4_addr_get_byte(&ip, 2), - w5x00_ip4_addr_get_byte(&ip, 3)); + app_printf("Public ip (parsed from the body): %d.%d.%d.%d\r\n\r\n", + w5x00_ip4_addr_get_byte(&ip, 0), + w5x00_ip4_addr_get_byte(&ip, 1), + w5x00_ip4_addr_get_byte(&ip, 2), + w5x00_ip4_addr_get_byte(&ip, 3)); } else { - app_log("Parse the ip from HTTP response body failed\r\n"); + app_printf("Parse the ip from HTTP response body failed\r\n"); } } } - app_log("Connection remote closed!\r\n"); + app_printf("Connection remote closed!\r\n"); } else { - app_log("Connect eror!\r\n"); + app_printf("Connect eror!\r\n"); } } @@ -155,11 +183,18 @@ void app_init(void) { sl_status_t status; - w5x00_init(sl_spidrv_w5500_handle); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + + w5x00_init(app_spi_instance); + #ifdef USE_DHCP status = w5x00_ethernet_dhcp_init(ð, mac, 30000, 10000); - app_log("DHCP configuration: %s\r\n", - SL_STATUS_OK == status ? "success":"failed"); + app_printf("DHCP configuration: %s\r\n", + SL_STATUS_OK == status ? "success":"failed"); #else status = w5x00_ethernet_static_init(ð, mac, @@ -168,8 +203,8 @@ void app_init(void) &subnet_mask, &dns_server1, 3000); - app_log("Static address configuration: %s\r\n", - SL_STATUS_OK == status ? "success":"failed"); + app_printf("Static address configuration: %s\r\n", + SL_STATUS_OK == status ? "success":"failed"); #endif if (SL_STATUS_OK != status) { @@ -177,9 +212,9 @@ void app_init(void) link_status = w5x00_ethernet_link_status(ð); if (EthernetLinkON == link_status) { - app_log("Ethernet link status is on\r\n"); + app_printf("Ethernet link status is on\r\n"); } else if (EthernetLinkOFF == link_status) { - app_log("Ethernet link status is off\r\n"); + app_printf("Ethernet link status is off\r\n"); return; } } @@ -189,25 +224,25 @@ void app_init(void) memset(&local_ip, 0, sizeof(local_ip)); w5x00_ethernet_get_local_ip(ð, &local_ip); - app_log("local ip: "); + app_printf("local ip: "); app_log_print_ip(&local_ip); - app_log("\r\n"); + app_printf("\r\n"); memset(&gateway_ip, 0, sizeof(gateway_ip)); w5x00_ethernet_get_gateway_ip(ð, &gateway_ip); - app_log("gateway: "); + app_printf("gateway: "); app_log_print_ip(&gateway_ip); - app_log("\r\n"); + app_printf("\r\n"); memset(&subnet_mask, 0, sizeof(subnet_mask)); w5x00_ethernet_get_subnet_mask(ð, &subnet_mask); - app_log("subnet mask: "); + app_printf("subnet mask: "); app_log_print_ip(&subnet_mask); - app_log("\r\n"); + app_printf("\r\n"); - app_log("dns: "); + app_printf("dns: "); app_log_print_ip(ð.dns_server_address); - app_log("\r\n"); + app_printf("\r\n"); http_client_get_device_public_ip("checkip.amazonaws.com", 80, "/"); } diff --git a/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp b/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp index 3dffa742..e4e7adc5 100644 --- a/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp +++ b/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500.slcp @@ -34,17 +34,20 @@ component: - id: iostream_eusart instance: [vcom] - id: spidrv - instance: [w5500] + instance: [mikroe] - id: app_assert - id: app_log -- id: sleeptimer + +configuration: + - name: SL_SPIDRV_MIKROE_CS_CONTROL + value: "spidrvCsControlApplication" define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/board.png @@ -57,12 +60,12 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/log.png directory: "image" - - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/mikrobus.png - directory: "image" - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/software_layers.png directory: "image" - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/w5500_config.png directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/spi_config.png + directory: "image" ui_hints: highlight: diff --git a/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500_si91x.slcp b/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500_si91x.slcp new file mode 100644 index 00000000..ad296843 --- /dev/null +++ b/app/example/mikroe_eth_wiz_w5500/mikroe_eth_wiz_w5500_si91x.slcp @@ -0,0 +1,69 @@ +project_name: mikroe_eth_wiz_w5500 +package: platform +label: Third Party Hardware Drivers - W5500 - ETH Wiz Click (Mikroe) +description: | + This example project shows an example for Mikroe ETH WIZ Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_eth_wiz_w5500/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: app_assert +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mikroe_eth_wiz + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/board.png + directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/diagram.png + directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/flow.png + directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/software_layers.png + directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/w5500_config.png + directory: "image" + - path: ../../documentation/example/mikroe_eth_wiz_w5500/image/spi_config.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_fingerprint2_a172mrq/app.c b/app/example/mikroe_fingerprint2_a172mrq/app.c index d35a3c18..06b60055 100644 --- a/app/example/mikroe_fingerprint2_a172mrq/app.c +++ b/app/example/mikroe_fingerprint2_a172mrq/app.c @@ -22,20 +22,35 @@ #include "sl_status.h" #include "sl_sleeptimer.h" +#include "mikroe_a172mrq.h" + +#if (defined(SLI_SI917)) +#include "sl_si91x_usart.h" +#include "rsi_debug.h" +#else #include "sl_iostream_init_usart_instances.h" #include "sl_iostream_init_eusart_instances.h" - #include "app_log.h" +#endif + #include "app_assert.h" -#include "mikroe_a172mrq.h" +#define PROCESS_COUTER 100 +#define READING_INTERVAL_MSEC 5000 + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define USART_INSTANCE_USED UART_1 -#define PROCESS_COUTER 100 -#define READING_INTERVAL_MSEC 5000 +static usart_peripheral_t uart_instance = USART_INSTANCE_USED; +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; static uint8_t flag; +mikroe_uart_handle_t app_uart_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); static void app_a172mrq_process(void); @@ -49,17 +64,24 @@ void app_init(void) { sl_status_t ret_code; +#if (defined(SLI_SI917)) + app_uart_instance = &uart_instance; +#else + app_uart_instance = sl_iostream_uart_mikroe_handle; + + sl_iostream_set_default(sl_iostream_vcom_handle); app_log_iostream_set(sl_iostream_vcom_handle); +#endif // Initialize Fingerprint 2 Click mikroe_a172mrq_cfg_setup(); - ret_code = mikroe_a172mrq_init(sl_iostream_uart_mikroe_handle); + ret_code = mikroe_a172mrq_init(app_uart_instance); app_assert_status(ret_code); // Reset Fingerprint 2 Click mikroe_a172mrq_reset(); sl_sleeptimer_delay_millisecond(1000); - app_log("Fingerprint 2 Click is initialized.\r\n"); + app_printf("Fingerprint 2 Click is initialized.\r\n"); // Write fingerprint data at position 0 app_a172mrq_reg_one(0); @@ -110,7 +132,7 @@ static void app_a172mrq_process(void) uart_rx_buffer[check_buf_cnt] = 13; } } - app_log("%s", uart_rx_buffer); + app_printf("%s", uart_rx_buffer); if (strstr(uart_rx_buffer, "")) { flag = 1; process_cnt = 5; @@ -123,7 +145,7 @@ static void app_a172mrq_process(void) sl_sleeptimer_delay_millisecond(100); } } else { - app_log("Fingerprint processing failed!\r\n"); + app_printf("Fingerprint processing failed!\r\n"); } } } @@ -131,7 +153,7 @@ static void app_a172mrq_process(void) // Register a fingerprint on index static void app_a172mrq_reg_one(uint8_t fngr_number) { - app_log("Registration is being processed.\r\n"); + app_printf("Registration is being processed.\r\n"); sl_sleeptimer_delay_millisecond(500); mikroe_a172mrq_reg_one_fp(fngr_number); @@ -146,10 +168,10 @@ static void app_a172mrq_compare(void) { sl_status_t ret_code; - ret_code = mikroe_a172mrq_generic_write(MIKROE_FINGERPRINT2_CMD_FP_CMP, - strlen(MIKROE_FINGERPRINT2_CMD_FP_CMP)); + ret_code = mikroe_a172mrq_generic_write( + MIKROE_FINGERPRINT2_CMD_FP_CMP, strlen(MIKROE_FINGERPRINT2_CMD_FP_CMP)); if (SL_STATUS_OK == ret_code) { - app_log("Comparison is being processed.\r\n"); + app_printf("Comparison is being processed.\r\n"); app_a172mrq_process(); do @@ -158,7 +180,7 @@ static void app_a172mrq_compare(void) } while (flag == 0); } else { - app_log("Comparison processing failed!\r\n"); + app_printf("Comparison processing failed!\r\n"); } } diff --git a/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp b/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp index ae7be9be..944b7d26 100644 --- a/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp +++ b/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq.slcp @@ -44,7 +44,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_fingerprint2_a172mrq/image/hardware_connection.png diff --git a/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq_si91x.slcp b/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq_si91x.slcp new file mode 100644 index 00000000..0c5f6a6a --- /dev/null +++ b/app/example/mikroe_fingerprint2_a172mrq/mikroe_fingerprint2_a172mrq_si91x.slcp @@ -0,0 +1,67 @@ +project_name: mikroe_fingerprint2_a172mrq_si91x +label: Third Party Hardware Drivers - A-172-MRQ - Fingerprint 2 Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe Fingerprint 2 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_fingerprint2_a172mrq/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_fingerprint2 + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +configuration: + - name: SL_UART1_DMA_CONFIG_ENABLE + value: "0" + +other_file: + - path: ../../documentation/example/mikroe_fingerprint2_a172mrq/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_fingerprint2_a172mrq/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_fingerprint2_a172mrq/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_fingerprint2_a172mrq/image/sw_layers.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_force3_fsr400/app.c b/app/example/mikroe_force3_fsr400/app.c index f447566d..be167da5 100644 --- a/app/example/mikroe_force3_fsr400/app.c +++ b/app/example/mikroe_force3_fsr400/app.c @@ -1,29 +1,65 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application + * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" #include "mikroe_fsr400.h" -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#define READING_INTERVAL_MSEC 500 +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define READING_INTERVAL_MSEC 500 typedef enum { @@ -46,6 +82,7 @@ static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool trigger_process = false; static mikroe_fsr400_status_e fsr400_status = mikroe_fsr400_status_init; static mikroe_fsr400_status_e fsr400_old_status = mikroe_fsr400_status_init; +static mikroe_i2c_handle_t app_i2c_instance = NULL; void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -53,20 +90,26 @@ void app_init(void) { sl_status_t stt; - app_log("Hello World - Mikroe Force 3 Click example\r\n"); + app_printf("Hello World - Mikroe Force 3 Click example\r\n"); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif - stt = mikroe_fsr400_init(sl_i2cspm_mikroe); - app_log("mikroe_fsr400_init = 0x%x\r\n", (uint16_t)stt); + stt = mikroe_fsr400_init(app_i2c_instance); + app_printf("mikroe_fsr400_init = 0x%x\r\n", (uint16_t)stt); - app_log("sl_sleeptimer_start_periodic = 0x%lx\r\n", - sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, - READING_INTERVAL_MSEC, - app_timer_callback, - NULL, - 0, - 0)); + app_printf("sl_sleeptimer_start_periodic = 0x%lx\r\n", + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_callback, + NULL, + 0, + 0)); - app_log(">> %s \r\n", mikroe_fsr400_status_name[fsr400_status]); + app_printf(">> %s \r\n", mikroe_fsr400_status_name[fsr400_status]); } /***************************************************************************//** @@ -94,8 +137,8 @@ void app_process_action(void) if (fsr400_status != fsr400_old_status) { fsr400_old_status = fsr400_status; - app_log(">> %s \r\n", mikroe_fsr400_status_name[fsr400_status]); - app_log("----------------------\r\n"); + app_printf(">> %s \r\n", mikroe_fsr400_status_name[fsr400_status]); + app_printf("----------------------\r\n"); } } } diff --git a/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp b/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp index c9d57fde..1874ab7f 100644 --- a/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp +++ b/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400.slcp @@ -47,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_force3_fsr400/image/create_example.png diff --git a/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400_si91x.slcp b/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400_si91x.slcp new file mode 100644 index 00000000..ab6b94e5 --- /dev/null +++ b/app/example/mikroe_force3_fsr400/mikroe_force3_fsr400_si91x.slcp @@ -0,0 +1,69 @@ +project_name: mikroe_force_fsr400 +package: platform +label: Third Party Hardware Drivers - FSR400 - Force 3 Click (Mikroe) +description: | + This example project shows an example for FSR400 - Force 3 Click (Mikroe). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_force3_fsr400/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: mikroe_force3 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_force3_fsr400/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_force3_fsr400/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_force3_fsr400/image/force_3_click.png + directory: "image" + - path: ../../documentation/example/mikroe_force3_fsr400/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_gps_lea6s/app.c b/app/example/mikroe_gps_lea6s/app.c index f6c326b3..d2758ccf 100644 --- a/app/example/mikroe_gps_lea6s/app.c +++ b/app/example/mikroe_gps_lea6s/app.c @@ -3,33 +3,65 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include #include +#include "app_queue.h" #include "sl_sleeptimer.h" +#include "mikroe_lea6s.h" + +#if (defined(SLI_SI917)) +#include "sl_si91x_usart.h" +#include "rsi_debug.h" +#else #include "sl_iostream_init_usart_instances.h" +#include "sl_iostream_init_eusart_instances.h" #include "app_log.h" -#include "app_queue.h" -#include "mikroe_lea6s.h" +#endif + +#define PROCESS_RX_BUFFER_SIZE 500 +#define PROCESS_PARSER_BUFFER_SIZE PROCESS_RX_BUFFER_SIZE +#define PROCESS_QUEUE_SIZE (PROCESS_RX_BUFFER_SIZE * 2) -#define PROCESS_RX_BUFFER_SIZE 500 -#define PROCESS_PARSER_BUFFER_SIZE PROCESS_RX_BUFFER_SIZE -#define PROCESS_QUEUE_SIZE (PROCESS_RX_BUFFER_SIZE * 2) +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define USART_INSTANCE_USED UART_1 +static usart_peripheral_t uart_instance = USART_INSTANCE_USED; +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif static void gps_process (void); static void parser_application (void); @@ -41,27 +73,34 @@ static uint8_t parser_buffer[PROCESS_PARSER_BUFFER_SIZE]; APP_QUEUE(uart_rx_queue, uint8_t, PROCESS_QUEUE_SIZE); static sl_sleeptimer_timer_handle_t timer_handle; static bool trigger_gps_process = false; +mikroe_uart_handle_t app_uart_instance = NULL; void app_init(void) { + sl_status_t sc; + +#if (defined(SLI_SI917)) + app_uart_instance = &uart_instance; +#else + app_uart_instance = sl_iostream_uart_mikroe_handle; app_log_iostream_set(sl_iostream_vcom_handle); - app_log("Hello World GPS Click !!!\r\n"); - app_log("mikroe_lea6s_init = 0x%lx\r\n", - mikroe_lea6s_init(sl_iostream_uart_mikroe_handle)); - app_log("app_queue_init = 0x%lx\r\n", APP_QUEUE_INIT(&uart_rx_queue, - uint8_t, - PROCESS_QUEUE_SIZE)); +#endif + + app_printf("Hello World GPS Click !!!\r\n"); + sc = mikroe_lea6s_init(app_uart_instance, true); + app_printf("mikroe_lea6s_init = 0x%lx\r\n", sc); + sc = APP_QUEUE_INIT(&uart_rx_queue, uint8_t, PROCESS_QUEUE_SIZE); + app_printf("app_queue_init = 0x%lx\r\n", sc); mikroe_lea6s_wakeup(); sl_sleeptimer_delay_millisecond(5000); - app_log("mikroe_lea6s_wakeup done\r\n"); - - app_log("sl_sleeptimer_start_periodic = 0x%lx\r\n", - sl_sleeptimer_start_periodic_timer_ms(&timer_handle, - 1000, - timer_callback_fcn, - NULL, - 0, - 0)); + app_printf("mikroe_lea6s_wakeup done\r\n"); + sc = sl_sleeptimer_start_periodic_timer_ms(&timer_handle, + 800, + timer_callback_fcn, + NULL, + 0, + 0); + app_printf("sl_sleeptimer_start_periodic = 0x%lx\r\n", sc); } /***************************************************************************//** @@ -149,7 +188,7 @@ static void parser_application(void) * + 24.86183, + 121.0165 and enter the field of Google Map to find the * actual corresponding location. */ - app_log("**************************************************\r\n"); + app_printf("**************************************************\r\n"); memcpy((void *)latitude_int, (const void *)element_buf, 2); memcpy((void *)latitude_decimal, @@ -157,7 +196,7 @@ static void parser_application(void) strlen((const char *)element_buf) - 2); double latitude = (atof((const char *)latitude_int) + (atof((const char *)(latitude_decimal)) / 60.0)); - app_log("Latitude: %.6f\r\n", latitude); + app_printf("Latitude: %.6f\r\n", latitude); memset(element_buf, 0, sizeof(element_buf)); mikroe_lea6s_generic_parser(parser_buffer, @@ -172,14 +211,14 @@ static void parser_application(void) double longtitude = (atof((const char *)longitude_int) + (atof((const char *)(longitude_decimal)) / 60.0)); - app_log("Longitude: %.6f\r\n", longtitude); + app_printf("Longitude: %.6f\r\n", longtitude); memset(element_buf, 0, sizeof(element_buf)); mikroe_lea6s_generic_parser(parser_buffer, gps_command_nema_gpgga_e, gpgga_element_altitude_e, element_buf); - app_log("Altitude: %s \r\n", element_buf); + app_printf("Altitude: %s \r\n", element_buf); } index = 0; diff --git a/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp b/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp index 6adb3989..7a4318e5 100644 --- a/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp +++ b/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s.slcp @@ -39,17 +39,13 @@ component: - id: mikroe_gps from: third_party_hw_drivers -configuration: - - name: SL_IOSTREAM_USART_MIKROE_BAUDRATE - value: 9600 - toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_gps_lea6s/image/create_example.png @@ -62,4 +58,4 @@ other_file: ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s_si91x.slcp b/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s_si91x.slcp new file mode 100644 index 00000000..79bd5c49 --- /dev/null +++ b/app/example/mikroe_gps_lea6s/mikroe_gps_lea6s_si91x.slcp @@ -0,0 +1,66 @@ +project_name: mikroe_gps_click +package: platform +label: Third Party Hardware Drivers - LEA-6S - GPS Click (Mikroe) +description: | + This example project shows an example for LEA-6S - GPS Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_gps_lea6s/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_queue +- id: emlib_core +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_gps + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_gps_lea6s/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_gps_lea6s/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_gps_lea6s/image/gps_log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_heartrate2_maxm86161/app.c b/app/example/mikroe_heartrate2_maxm86161/app.c index f15bf9e7..4c46c33f 100644 --- a/app/example/mikroe_heartrate2_maxm86161/app.c +++ b/app/example/mikroe_heartrate2_maxm86161/app.c @@ -1,40 +1,82 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application + * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include "sl_sleeptimer.h" +#include "mikroe_maxm86161.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" #include "app_log.h" -#include "mikroe_maxm86161.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif bool sensor_init_ok = false; static uint16_t counter = 1000; +static mikroe_i2c_handle_t app_i2c_instance = NULL; void app_init(void) { uint8_t rd_stat; - app_log( + app_printf( "- MAXM86161 - Heartrate 2 Click board driver, example application. -\n"); - if (SL_STATUS_OK != mikroe_maxm86161_init(sl_i2cspm_mikroe)) { - app_log("> MAXM86161 - Heartrate 2 Click board driver init failed.\n"); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + if (SL_STATUS_OK != mikroe_maxm86161_init(app_i2c_instance)) { + app_printf("> MAXM86161 - Heartrate 2 Click board driver init failed.\n"); } else { sensor_init_ok = true; } @@ -48,18 +90,18 @@ void app_init(void) rd_stat = mikroe_maxm86161_generic_read(MIKROE_MAXM86161_REG_PART_ID); if (rd_stat != MIKROE_MAXM86161_DEV_ID) { - app_log("---- WRONG ID ----\n"); - app_log("Please restart your system.\n"); + app_printf("---- WRONG ID ----\n"); + app_printf("Please restart your system.\n"); for ( ; ; ) {} } if (mikroe_maxm86161_default_cfg(MAXM86161_CONFIG_GREEN) == SL_STATUS_OK) { - app_log("The module has been configured!\n"); + app_printf("The module has been configured!\n"); } sl_sleeptimer_delay_millisecond(1000); - app_log("> App init done.\n"); - app_log("> Starting measurement.\n"); + app_printf("> App init done.\n"); + app_printf("> Starting measurement.\n"); } } @@ -75,10 +117,10 @@ void app_process_action(void) if (fifo_object.tag == MIKROE_MAXM86161_FIFO_TAG_PPG1_LEDC1) { counter++; if (fifo_object.data_val > 1000) { - app_log("%lu;\r\n", fifo_object.data_val); + app_printf("%lu;\r\n", fifo_object.data_val); counter = 1000; } else if (counter > 1000) { - app_log("Please place your index finger on the sensor.\r\n"); + app_printf("Please place your index finger on the sensor.\r\n"); counter = 0; } } diff --git a/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp b/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp index 375af7b4..73ec01f6 100644 --- a/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp +++ b/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161.slcp @@ -43,7 +43,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_heartrate2_maxm86161/image/create_example.png diff --git a/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161_si91x.slcp b/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161_si91x.slcp new file mode 100644 index 00000000..4388c68c --- /dev/null +++ b/app/example/mikroe_heartrate2_maxm86161/mikroe_heartrate2_maxm86161_si91x.slcp @@ -0,0 +1,63 @@ +project_name: mikroe_heartrate2_maxm86161 +package: platform +label: Third Party Hardware Drivers - MAXM86161 - Heartrate 2 Click (Mikroe) +description: | + This example project shows an example for Mikroe Heartrate 2 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_heartrate2_maxm86161/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: mikroe_heartrate2 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_heartrate2_maxm86161/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_heartrate2_maxm86161/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_heartrate2_maxm86161/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_heartrate4_max30101/app.c b/app/example/mikroe_heartrate4_max30101/app.c index a9bacfcb..aba0e6f3 100644 --- a/app/example/mikroe_heartrate4_max30101/app.c +++ b/app/example/mikroe_heartrate4_max30101/app.c @@ -36,18 +36,45 @@ * ******************************************************************************/ -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#include "gpiointerrupt.h" -#include "app_log.h" - #include "mikroe_max30101_config.h" #include "mikroe_max30101.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#else +#include "sl_i2cspm_instances.h" +#endif + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#include "sl_driver_gpio.h" +#else +#include "gpiointerrupt.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + // #define MIKROE_HEARTRATE4_MODE_INTERRUPT #define MIKROE_HEARTRATE4_MODE_POLLING -#define READING_INTERVAL_MSEC 3000 +#define READING_INTERVAL_MSEC 3000 + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +mikroe_i2c_handle_t app_i2c_instance = NULL; static volatile bool data_ready = false; @@ -79,19 +106,36 @@ static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data) void app_init(void) { #ifdef MIKROE_HEARTRATE4_MODE_INTERRUPT +#if (defined(SLI_SI917)) + sl_gpio_t gpio_port_pin = { + MAX30101_INT_PIN / 16, + MAX30101_INT_PIN % 16 + }; + sl_gpio_driver_configure_interrupt(&gpio_port_pin, + GPIO_M4_INTR, + SL_GPIO_INTERRUPT_RISING_EDGE | SL_GPIO_INTERRUPT_FALLING_EDGE, + (void *)&heartrate4_int_callback, + AVL_INTR_NO); +#else GPIO_PinModeSet(MAX30101_INT_PORT, MAX30101_INT_PIN, gpioModeInputPull, 1); GPIO_ExtIntConfig(MAX30101_INT_PORT, MAX30101_INT_PIN, MAX30101_INT_PIN, - 0, - 1, - 1); + false, + true, + true); GPIOINT_CallbackRegister(MAX30101_INT_PIN, heartrate4_int_callback); - GPIO_IntEnable(MAX30101_INT_PIN); +#endif +#endif + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; #endif - if (mikroe_max30101_init(sl_i2cspm_mikroe) == SL_STATUS_OK) { - app_log("MAX30101 init successfully\n"); + if (mikroe_max30101_init(app_i2c_instance) == SL_STATUS_OK) { + app_printf("MAX30101 init successfully\n"); } sl_sleeptimer_delay_millisecond(2000); @@ -132,7 +176,7 @@ void app_process_action(void) data_ready = false; // Only get data if MAX30101 is available on the bus if (SL_STATUS_OK != mikroe_max30101_present()) { - app_log("Error: Unable to check MAX30101 is present on the bus.\r\n"); + app_printf("Error: Unable to check MAX30101 is present on the bus.\r\n"); return; } @@ -140,9 +184,9 @@ void app_process_action(void) red_samp = mikroe_max30101_get_red_val(); // If sample pulse amplitude is not under threshold value 0x8000 if (red_samp > 0x8000) { - app_log("%lu\r\n", red_samp); + app_printf("%lu\r\n", red_samp); } else { - app_log("Place Finger On Sensor\r\n"); + app_printf("Place Finger On Sensor\r\n"); } } } diff --git a/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp b/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp index e3f0581d..114691f4 100644 --- a/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp +++ b/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101.slcp @@ -54,7 +54,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 ui_hints: highlight: diff --git a/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101_si91x.slcp b/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101_si91x.slcp new file mode 100644 index 00000000..9951e249 --- /dev/null +++ b/app/example/mikroe_heartrate4_max30101/mikroe_heartrate4_max30101_si91x.slcp @@ -0,0 +1,65 @@ +project_name: mikroe_heartrate4_max30101_si91x +label: Third Party Hardware Drivers - MAX30101 - Heart Rate 4 Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe Heart Rate 4 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_heartrate4_max30101/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: mikroe_heartrate4 + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_heartrate4_max30101/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_heartrate4_max30101/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_heartrate4_max30101/image/default_config.png + directory: "image" + - path: ../../documentation/example/mikroe_heartrate4_max30101/image/hardware_connection.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_hvac_bundle_scd41_sps30/app.c b/app/example/mikroe_hvac_bundle_scd41_sps30/app.c index e7bd3938..b9bbb12f 100644 --- a/app/example/mikroe_hvac_bundle_scd41_sps30/app.c +++ b/app/example/mikroe_hvac_bundle_scd41_sps30/app.c @@ -1,34 +1,65 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" #include "app_assert.h" +#include "sl_sleeptimer.h" #include "mikroe_scd41.h" #include "sparkfun_sps30_i2c.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#else #include "sl_i2cspm_instances.h" -#include "sl_sleeptimer.h" +#include "app_log.h" + +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define READING_INTERVAL_MSEC 5000 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool trigger_process = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -38,70 +69,77 @@ void app_init(void) uint16_t ser_num[3]; mikroe_scd41_feature_data_t version_data; - app_log("Hello World - Mikroe HVAC Click Bundle example\r\n"); - app_log("-----------------------------------------\r\n"); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + app_printf("Hello World - Mikroe HVAC Click Bundle example\r\n"); + app_printf("-----------------------------------------\r\n"); // SCD41 Initialization - stt = mikroe_scd41_init(sl_i2cspm_mikroe); + stt = mikroe_scd41_init(app_i2c_instance); app_assert_status(stt); - app_log("Mikroe SCD41\r\n\nInit Done\r\n"); + app_printf("Mikroe SCD41\r\n\nInit Done\r\n"); mikroe_scd41_send_cmd(MIKROE_SCD41_PERFORM_FACTORY_RESET); - app_log("Perform Factory Reset Done\r\n"); + app_printf("Perform Factory Reset Done\r\n"); sl_sleeptimer_delay_millisecond(2000); stt = mikroe_scd41_get_serial_number(ser_num); app_assert_status(stt); - app_log("Get Serial Number Done\r\n"); - app_log("Serial Number: %.4d-%.4d-%.4d\r\n", - ( uint16_t ) ser_num[0], - ( uint16_t ) ser_num[1], - ( uint16_t ) ser_num[2]); + app_printf("Get Serial Number Done\r\n"); + app_printf("Serial Number: %.4d-%.4d-%.4d\r\n", + ( uint16_t ) ser_num[0], + ( uint16_t ) ser_num[1], + ( uint16_t ) ser_num[2]); stt = mikroe_scd41_get_feature_set_version(&version_data); app_assert_status(stt); - app_log("Get Feature Set Version Done\r\n"); - app_log("SCD41 - Features\r\n"); - app_log("Product Type : %d \r\n", ( uint16_t ) version_data.product_type); - app_log("Platform Type : %d \r\n", ( uint16_t ) version_data.platform_type); - app_log("Product Version : %d.%d \r\n", - ( uint16_t ) version_data.product_major_version, - ( uint16_t ) version_data.product_minor_version); + app_printf("Get Feature Set Version Done\r\n"); + app_printf("SCD41 - Features\r\n"); + app_printf("Product Type : %d \r\n", + ( uint16_t ) version_data.product_type); + app_printf("Platform Type : %d \r\n", + ( uint16_t ) version_data.platform_type); + app_printf("Product Version : %d.%d \r\n", + ( uint16_t ) version_data.product_major_version, + ( uint16_t ) version_data.product_minor_version); // Trigger measure single shot */ mikroe_scd41_send_cmd(MIKROE_SCD41_MEASURE_SINGLE_SHOT); - app_log("-----------------------------------------\r\n"); + app_printf("-----------------------------------------\r\n"); - app_log_iostream_set(sl_iostream_vcom_handle); // SPS30 Initialization - uint32_t sc = sps30_init(sl_i2cspm_mikroe); - app_assert_status(sc); - app_log("Sparkfun SPS30\r\nInit Done\r\n"); + stt = sps30_init(app_i2c_instance); + app_assert_status(stt); + app_printf("Sparkfun SPS30\r\nInit Done\r\n"); while (sps30_probe() != 0) { - app_log("SPS30 Sensor Probing Failed\r\n"); + app_printf("SPS30 Sensor Probing Failed\r\n"); sl_sleeptimer_delay_millisecond(1000); } - app_log("SPS30 Sensor Probing Successful\r\n"); + app_printf("SPS30 Sensor Probing Successful\r\n"); uint8_t fw_major; uint8_t fw_minor; stt = sps30_read_firmware_version(&fw_major, &fw_minor); app_assert_status(stt); - app_log("FW Version: %u.%u\r\n", fw_major, fw_minor); + app_printf("FW Version: %u.%u\r\n", fw_major, fw_minor); uint8_t serial_number[SPS30_MAX_SERIAL_LEN]; stt = sps30_get_serial((char *)serial_number); app_assert_status(stt); - app_log("Serial Number: %s\r\n", serial_number); + app_printf("Serial Number: %s\r\n", serial_number); stt = sps30_start_measurement(); app_assert_status(stt); - app_log("Measurements Started\r\n"); + app_printf("Measurements Started\r\n"); - app_log("-----------------------------------------\r\n\n"); + app_printf("-----------------------------------------\r\n\n"); // Start periodic measurement sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, @@ -126,44 +164,44 @@ void app_process_action(void) stt = mikroe_scd41_read_measurement(&hvac_data); if (SL_STATUS_OK == stt) { - app_log("<----------- Measured Values ----------->\r\n"); - app_log("CO2 Concent = %dppm\r\n", hvac_data.co2_concent); - app_log("Temperature = %.2f%cC \r\n", hvac_data.temperature, 176); - app_log("R.Humidity = %.2f %% \r\n", hvac_data.r_humidity); + app_printf("<----------- Measured Values ----------->\r\n"); + app_printf("CO2 Concent = %dppm\r\n", hvac_data.co2_concent); + app_printf("Temperature = %.2f%cC \r\n", hvac_data.temperature, 176); + app_printf("R.Humidity = %.2f %% \r\n", hvac_data.r_humidity); // Continue trigger measure single shot mikroe_scd41_send_cmd(MIKROE_SCD41_MEASURE_SINGLE_SHOT); } else { - app_log("Error, code = 0x%lx\r\n", stt); + app_printf("Error, code = 0x%lx\r\n", stt); while (1) {} } stt = sps30_read_measurement(&measure); if (stt != SL_STATUS_OK) { - app_log("Error Reading Measurement\r\n"); + app_printf("Error Reading Measurement\r\n"); } else { - app_log("%0.2f pm1.0\r\n" - "%0.2f pm2.5\r\n" - "%0.2f pm4.0\r\n" - "%0.2f pm10.0\r\n" - "%0.2f nc0.5\r\n" - "%0.2f nc1.0\r\n" - "%0.2f nc2.5\r\n" - "%0.2f nc4.5\r\n" - "%0.2f nc10.0\r\n" - "%0.2f typical particle size\r\n", - measure.mc_1p0, - measure.mc_2p5, - measure.mc_4p0, - measure.mc_10p0, - measure.nc_0p5, - measure.nc_1p0, - measure.nc_2p5, - measure.nc_4p0, - measure.nc_10p0, - measure.typical_particle_size); + app_printf("%0.2f pm1.0\r\n" + "%0.2f pm2.5\r\n" + "%0.2f pm4.0\r\n" + "%0.2f pm10.0\r\n" + "%0.2f nc0.5\r\n" + "%0.2f nc1.0\r\n" + "%0.2f nc2.5\r\n" + "%0.2f nc4.5\r\n" + "%0.2f nc10.0\r\n" + "%0.2f typical particle size\r\n", + measure.mc_1p0, + measure.mc_2p5, + measure.mc_4p0, + measure.mc_10p0, + measure.nc_0p5, + measure.nc_1p0, + measure.nc_2p5, + measure.nc_4p0, + measure.nc_10p0, + measure.typical_particle_size); } - app_log("-----------------------------------------\r\n\n"); + app_printf("-----------------------------------------\r\n\n"); } } diff --git a/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp b/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp index f316810d..4f16cd21 100644 --- a/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp +++ b/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30.slcp @@ -58,7 +58,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 ui_hints: highlight: diff --git a/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30_si91x.slcp b/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30_si91x.slcp new file mode 100644 index 00000000..3068fefd --- /dev/null +++ b/app/example/mikroe_hvac_bundle_scd41_sps30/mikroe_hvac_bundle_scd41_sps30_si91x.slcp @@ -0,0 +1,70 @@ +project_name: mikroe_hvac_bundle_scd41_sps30 +label: Third Party Hardware Drivers - SCD41 & SPS30 - HVAC Click Bundle (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe HVAC Click Bundle board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_hvac_bundle_scd41_sps30/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: hvac_bundle_scd41_sps30 + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_hvac_bundle_scd41_sps30/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_hvac_bundle_scd41_sps30/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_hvac_bundle_scd41_sps30/image/print_float.png + directory: "image" + - path: ../../documentation/example/mikroe_hvac_bundle_scd41_sps30/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_hvac_scd41/app.c b/app/example/mikroe_hvac_scd41/app.c index e2a2c236..867d8605 100644 --- a/app/example/mikroe_hvac_scd41/app.c +++ b/app/example/mikroe_hvac_scd41/app.c @@ -1,80 +1,123 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" #include "mikroe_scd41.h" -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#define READING_INTERVAL_MSEC 5000 +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define READING_INTERVAL_MSEC 5000 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool trigger_process = false; static uint16_t ser_num[3]; static mikroe_scd41_measuremen_data_t hvac_data; static mikroe_scd41_feature_data_t version_data; - +static mikroe_i2c_handle_t app_i2c_instance = NULL; void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); void app_init(void) { sl_status_t stt; - app_log("Hello World - Mikroe HVAC Click example\r\n"); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + app_printf("Hello World - Mikroe HVAC Click example\r\n"); - stt = mikroe_scd41_init(sl_i2cspm_mikroe); - app_log("Mikroe SCD41 Init = 0x%x\r\n", (uint16_t)stt); + stt = mikroe_scd41_init(app_i2c_instance); + app_printf("Mikroe SCD41 Init = 0x%x\r\n", (uint16_t)stt); mikroe_scd41_send_cmd(MIKROE_SCD41_PERFORM_FACTORY_RESET); - app_log("Perform Factory Reset \r\n"); - app_log("-----------------------------------------\r\n"); + app_printf("Perform Factory Reset \r\n"); + app_printf("-----------------------------------------\r\n"); sl_sleeptimer_delay_millisecond(2000); stt = mikroe_scd41_get_serial_number(ser_num); - app_log("mikroe_scd41_get_serial_number = 0x%x\r\n", (uint16_t)stt); - app_log("SCD41 - Serial Number: %.4d-%.4d-%.4d\r\n", - ( uint16_t ) ser_num[0], - ( uint16_t ) ser_num[1], - ( uint16_t ) ser_num[2]); - app_log("-----------------------------------------\r\n"); + app_printf("mikroe_scd41_get_serial_number = 0x%x\r\n", (uint16_t)stt); + app_printf("SCD41 - Serial Number: %.4d-%.4d-%.4d\r\n", + ( uint16_t ) ser_num[0], + ( uint16_t ) ser_num[1], + ( uint16_t ) ser_num[2]); + app_printf("-----------------------------------------\r\n"); stt = mikroe_scd41_get_feature_set_version(&version_data); - app_log("mikroe_scd41_get_feature_set_version = 0x%x\r\n", (uint16_t)stt); - app_log("SCD41 - Features\r\n"); - app_log("Product Type : %d \r\n", ( uint16_t ) version_data.product_type); - app_log("Platform Type : %d \r\n", ( uint16_t ) version_data.platform_type); - app_log("Product Version : %d.%d \r\n", - ( uint16_t ) version_data.product_major_version, - ( uint16_t ) version_data.product_minor_version); - app_log("-----------------------------------------\r\n"); + app_printf("mikroe_scd41_get_feature_set_version = 0x%x\r\n", (uint16_t)stt); + app_printf("SCD41 - Features\r\n"); + app_printf("Product Type : %d \r\n", + ( uint16_t ) version_data.product_type); + app_printf("Platform Type : %d \r\n", + ( uint16_t ) version_data.platform_type); + app_printf("Product Version : %d.%d \r\n", + ( uint16_t ) version_data.product_major_version, + ( uint16_t ) version_data.product_minor_version); + app_printf("-----------------------------------------\r\n"); // Trigger measure single shot */ mikroe_scd41_send_cmd(MIKROE_SCD41_MEASURE_SINGLE_SHOT); - app_log("sl_sleeptimer_start_periodic = 0x%lx\r\n", - sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, - READING_INTERVAL_MSEC, - app_timer_callback, - NULL, - 0, - 0)); + app_printf("sl_sleeptimer_start_periodic = 0x%lx\r\n", + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_callback, + NULL, + 0, + 0)); } /***************************************************************************//** @@ -87,15 +130,15 @@ void app_process_action(void) sl_status_t stt = mikroe_scd41_read_measurement(&hvac_data); if (SL_STATUS_OK == stt) { - app_log("CO2 Concent = %dppm\r\n", hvac_data.co2_concent); - app_log("Temperature = %.2f%cC \r\n", hvac_data.temperature, 176); - app_log("R.Humidity = %.2f %% \r\n", hvac_data.r_humidity); - app_log("-----------------------------------------\r\n"); + app_printf("CO2 Concent = %dppm\r\n", hvac_data.co2_concent); + app_printf("Temperature = %.2f%cC \r\n", hvac_data.temperature, 176); + app_printf("R.Humidity = %.2f %% \r\n", hvac_data.r_humidity); + app_printf("-----------------------------------------\r\n"); // Continue trigger measure single shot mikroe_scd41_send_cmd(MIKROE_SCD41_MEASURE_SINGLE_SHOT); } else { - app_log("Error, code = 0x%lx\r\n", stt); + app_printf("Error, code = 0x%lx\r\n", stt); while (1) {} } } diff --git a/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp b/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp index 238a221b..deec7b3e 100644 --- a/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp +++ b/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41.slcp @@ -29,13 +29,13 @@ include: component: - id: sl_system - id: device_init +- id: sleeptimer - id: hvac_scd41 from: third_party_hw_drivers - id: iostream_usart instance: [vcom] - id: i2cspm instance: [mikroe] -- id: sleeptimer - id: app_log toolchain_settings: @@ -46,7 +46,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_hvac_scd41/image/create_example.png diff --git a/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41_si91x.slcp b/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41_si91x.slcp new file mode 100644 index 00000000..bdab6f05 --- /dev/null +++ b/app/example/mikroe_hvac_scd41/mikroe_hvac_scd41_si91x.slcp @@ -0,0 +1,71 @@ +project_name: mikroe_hvac_scd41_si91x +package: platform +label: Third Party Hardware Drivers - SCD41 - HVAC Click (Mikroe) +description: | + This example project shows an example for SCD41 - HVAC Click (Mikroe). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_hvac_scd41/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: hvac_scd41 + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_hvac_scd41/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_hvac_scd41/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_hvac_scd41/image/hvac_click.png + directory: "image" + - path: ../../documentation/example/mikroe_hvac_scd41/image/driver_layer.png + directory: "image" + - path: ../../documentation/example/mikroe_hvac_scd41/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_irthermo3_mlx90632/app.c b/app/example/mikroe_irthermo3_mlx90632/app.c index cee5b114..e228a05f 100644 --- a/app/example/mikroe_irthermo3_mlx90632/app.c +++ b/app/example/mikroe_irthermo3_mlx90632/app.c @@ -1,31 +1,69 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application + * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" +#include "mikroe_mlx90632.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" #include "app_log.h" +#endif -#include "mikroe_mlx90632.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif #define READING_INTERVAL_MSEC 1000 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); static void application_task(void); @@ -35,10 +73,16 @@ static void application_task(void); ******************************************************************************/ void app_init(void) { - if (mikroe_mlx90632_init(sl_i2cspm_mikroe) == SL_STATUS_OK) { - app_log("IrThermo 3 Click initializes successfully\n"); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + if (mikroe_mlx90632_init(app_i2c_instance) == SL_STATUS_OK) { + app_printf("IrThermo 3 Click initializes successfully\n"); } else { - app_log("IrThermo 3 Click initializes fail\n"); + app_printf("IrThermo 3 Click initializes fail\n"); } mikroe_mlx90632_default_config(); @@ -67,10 +111,11 @@ void app_process_action(void) static void application_task(void) { if (mikroe_mlx90632_present() == SL_STATUS_OK) { - app_log("Ambient temp: %.2f\n", mikroe_mlx90632_get_ambient_temperature()); - app_log("Object temp: %.2f\n", mikroe_mlx90632_get_object_temperature()); + app_printf("Ambient temp: %.2f\n", + mikroe_mlx90632_get_ambient_temperature()); + app_printf("Object temp: %.2f\n", mikroe_mlx90632_get_object_temperature()); } else { - app_log("IrThermo 3 Click is not present on the bus\n"); + app_printf("IrThermo 3 Click is not present on the bus\n"); } } diff --git a/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp b/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp index b6fc6842..ddc8d66e 100644 --- a/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp +++ b/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632.slcp @@ -44,22 +44,20 @@ toolchain_settings: other_file: - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/create_example.png - directory: "image" + directory: "image" - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/float.png directory: "image" - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/log.png directory: "image" - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/default_config.png - directory: "image" define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 ui_hints: highlight: diff --git a/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632_si91x.slcp b/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632_si91x.slcp new file mode 100644 index 00000000..44073c61 --- /dev/null +++ b/app/example/mikroe_irthermo3_mlx90632/mikroe_irthermo3_mlx90632_si91x.slcp @@ -0,0 +1,69 @@ +project_name: mikroe_irthermo3_mlx90632 +label: Third Party Hardware Drivers - MLX90632 - IrThermo 3 Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe IrThermo 3 click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_irthermo3_mlx90632/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: mikroe_irthermo3 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/float.png + directory: "image" + - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_irthermo3_mlx90632/image/hardware_connection.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_lr9_ra_08/app.c b/app/example/mikroe_lr9_ra_08/app.c new file mode 100644 index 00000000..efc42da1 --- /dev/null +++ b/app/example/mikroe_lr9_ra_08/app.c @@ -0,0 +1,262 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#include +#include "mikroe_ra_08.h" +#include "sl_sleeptimer.h" +#include "sl_iostream_init_usart_instances.h" +#include "sl_iostream_init_eusart_instances.h" +#include "app_log.h" + +#define app_printf(...) app_log(__VA_ARGS__) + +// Comment the line below to switch application mode to receiver +#define DEMO_APP_TRANSMITTER + +// Default RF configuration +#define LR9_RF_CFG_DEFAULT_TX "433000000,1,1,1,22,1" +#define LR9_RF_CFG_DEFAULT_RX "433000000,1,1,1,1" +#define LR9_DEMO_STRING "Silabs" +// Receiver string sequences +#define PROCESS_START_RECEIVE "Recv:" +#define PROCESS_ATDTRX "AT" +// Response timeout +#define RESPONSE_TIMEOUT 100000 +// Application buffer size +#define APP_BUFFER_SIZE 500 +#define PROCESS_BUFFER_SIZE 100 +#define APP_TIMER_INTERVAL 2000 + +static sl_sleeptimer_timer_handle_t app_timer; +static volatile bool timer_trigger; +static uint8_t app_buf[APP_BUFFER_SIZE] = { 0 }; +static uint32_t app_buf_len = 0; +mikroe_uart_handle_t app_uart_instance = NULL; + +static void mikroe_ra_08_clear_app_buffer(void); +static void mikroe_ra_08_log_app_buffer(void); + +#ifndef DEMO_APP_TRANSMITTER +static void mikroe_ra_08_log_receiver(void); + +#endif +static void mikroe_ra_08_log_response(void); +static sl_status_t mikroe_ra_08_process(void); +static void application_task(void); +static void app_timer_callback(sl_sleeptimer_timer_handle_t *timer, void *data); + +/***************************************************************************//** + * Application clear app buffer function. + ******************************************************************************/ +static void mikroe_ra_08_clear_app_buffer(void) +{ + memset(app_buf, 0, app_buf_len); + app_buf_len = 0; +} + +/***************************************************************************//** + * Application log buffer function. + ******************************************************************************/ +static void mikroe_ra_08_log_app_buffer(void) +{ + for (uint32_t i = 0; i < app_buf_len; i++) { + app_printf("%c", app_buf[i]); + } + app_printf("\n"); +} + +/***************************************************************************//** + * Log receiver function. + ******************************************************************************/ +#ifndef DEMO_APP_TRANSMITTER +static void mikroe_ra_08_log_receiver(void) +{ + uint32_t timeout_cnt = 0; + mikroe_ra_08_clear_app_buffer( ); + mikroe_ra_08_process(); + while (0 == strstr((char *)app_buf, PROCESS_START_RECEIVE)) + { + mikroe_ra_08_process(); + if (timeout_cnt++ > RESPONSE_TIMEOUT) { + mikroe_ra_08_clear_app_buffer(); + app_printf("[ERROR]: Time out!\n"); + break; + } + sl_sleeptimer_delay_millisecond(1); + } + mikroe_ra_08_process(); + if (strstr((char *)app_buf, PROCESS_ATDTRX)) { + app_printf(" Receive: "); + for ( uint32_t buf_cnt = 15; buf_cnt < 15 + strlen(LR9_DEMO_STRING); + buf_cnt++ ) + { + app_printf("%c", app_buf[buf_cnt]); + } + app_printf("\r\n"); + } +} + +#endif + +/***************************************************************************//** + * Process response funtion. + ******************************************************************************/ +static void mikroe_ra_08_log_response(void) +{ + if (SL_STATUS_OK == mikroe_ra_08_process()) { + mikroe_ra_08_log_app_buffer(); + mikroe_ra_08_clear_app_buffer(); + } +} + +static sl_status_t mikroe_ra_08_process(void) +{ + uint8_t rx_buf[PROCESS_BUFFER_SIZE] = { 0 }; + int32_t overflow_bytes = 0; + int32_t rx_cnt = 0; + int32_t rx_size; + sl_status_t sc = mikroe_ra_08_generic_read(rx_buf, + PROCESS_BUFFER_SIZE, + &rx_size); + if ((sc == SL_STATUS_OK) && (rx_size <= APP_BUFFER_SIZE)) { + if ((app_buf_len + rx_size) > APP_BUFFER_SIZE) { + overflow_bytes = (app_buf_len + rx_size) - APP_BUFFER_SIZE; + app_buf_len = APP_BUFFER_SIZE - rx_size; + memmove(app_buf, &app_buf[overflow_bytes], app_buf_len); + memset(&app_buf[app_buf_len], 0, overflow_bytes); + } + for ( rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) + { + if (rx_buf[rx_cnt]) { + app_buf[app_buf_len++] = rx_buf[rx_cnt]; + } + } + return SL_STATUS_OK; + } + return SL_STATUS_FAIL; +} + +/***************************************************************************//** + * App timer callback function. + ******************************************************************************/ +static void app_timer_callback(sl_sleeptimer_timer_handle_t *timer, void *data) +{ + (void) timer; + (void) data; + + timer_trigger = true; +} + +/***************************************************************************//** + * Application task function. + ******************************************************************************/ +static void application_task(void) +{ +#ifdef DEMO_APP_TRANSMITTER + mikroe_ra_08_send_data_frame(MIKROE_RA_08_DTRX_CONFIG_DATA, + MIKROE_RA_08_NB_TRIALS_2, + (uint8_t *)LR9_DEMO_STRING); + mikroe_ra_08_log_response(); +#endif +} + +/***************************************************************************//** + * Application init function. + ******************************************************************************/ +void app_init(void) +{ + sl_status_t sc; + + app_uart_instance = sl_iostream_uart_mikroe_handle; + app_log_iostream_set(sl_iostream_vcom_handle); + + app_printf("Silicon Labs - LoRa 9 Click example.\n"); + + sc = mikroe_ra_08_init(app_uart_instance); + if (SL_STATUS_OK != sc) { + app_printf("LoRa 9 Click initialized failed!\n"); + return; + } + mikroe_ra_08_hw_reset(); + sl_sleeptimer_delay_millisecond(500); + + mikroe_ra_08_inquire_command((uint8_t *)MIKROE_RA_08_CMD_CTXADDRSET, + MIKROE_RA_08_EQUAL_ENABLE); + mikroe_ra_08_log_response(); + sl_sleeptimer_delay_millisecond(500); + mikroe_ra_08_inquire_command((uint8_t *)MIKROE_RA_08_CMD_CADDRSET, + MIKROE_RA_08_EQUAL_ENABLE); + mikroe_ra_08_log_response(); + sl_sleeptimer_delay_millisecond(500); +#ifdef DEMO_APP_TRANSMITTER + app_printf("Transmitter Role\n"); + mikroe_ra_08_write_command((uint8_t *)MIKROE_RA_08_CMD_CTX, + (uint8_t *)LR9_RF_CFG_DEFAULT_TX); + mikroe_ra_08_log_response(); + sl_sleeptimer_delay_millisecond(500); +#else + app_printf("Receiver Role\n"); + mikroe_ra_08_write_command((uint8_t *)MIKROE_RA_08_CMD_CRXS, + (uint8_t *)LR9_RF_CFG_DEFAULT_RX); + mikroe_ra_08_log_response(); + sl_sleeptimer_delay_millisecond(500); +#endif + mikroe_ra_08_log_response(); + sl_sleeptimer_delay_millisecond(500); + + sl_sleeptimer_start_periodic_timer_ms(&app_timer, + APP_TIMER_INTERVAL, + app_timer_callback, + NULL, + 0, + 0); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + if (timer_trigger) { + application_task(); + timer_trigger = false; + } +#ifndef DEMO_APP_TRANSMITTER + mikroe_ra_08_log_receiver(); +#endif +} diff --git a/app/example/mikroe_lr9_ra_08/app.h b/app/example/mikroe_lr9_ra_08/app.h new file mode 100644 index 00000000..02bedf57 --- /dev/null +++ b/app/example/mikroe_lr9_ra_08/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/app/example/mikroe_lr9_ra_08/main.c b/app/example/mikroe_lr9_ra_08/main.c new file mode 100644 index 00000000..2da253ba --- /dev/null +++ b/app/example/mikroe_lr9_ra_08/main.c @@ -0,0 +1,58 @@ +/***************************************************************************//** + * @file main.c + * @brief main() function. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ +#include "sl_component_catalog.h" +#include "sl_system_init.h" +#include "app.h" +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#include "sl_power_manager.h" +#endif +#if defined(SL_CATALOG_KERNEL_PRESENT) +#include "sl_system_kernel.h" +#else // SL_CATALOG_KERNEL_PRESENT +#include "sl_system_process_action.h" +#endif // SL_CATALOG_KERNEL_PRESENT + +int main(void) +{ + // Initialize Silicon Labs device, system, service(s) and protocol stack(s). + // Note that if the kernel is present, processing task(s) will be created by + // this call. + sl_system_init(); + + // Initialize the application. For example, create periodic timer(s) or + // task(s) if the kernel is present. + app_init(); + +#if defined(SL_CATALOG_KERNEL_PRESENT) + // Start the kernel. Task(s) created in app_init() will start running. + sl_system_kernel_start(); +#else // SL_CATALOG_KERNEL_PRESENT + while (1) { + // Do not remove this call: Silicon Labs components process action routine + // must be called from the super loop. + sl_system_process_action(); + + // Application process. + app_process_action(); + +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + // Let the CPU go to sleep if the system allows it. + sl_power_manager_sleep(); +#endif + } +#endif // SL_CATALOG_KERNEL_PRESENT +} diff --git a/app/example/mikroe_lr9_ra_08/mikroe_lr9_ra_08.slcp b/app/example/mikroe_lr9_ra_08/mikroe_lr9_ra_08.slcp new file mode 100644 index 00000000..2fa4931c --- /dev/null +++ b/app/example/mikroe_lr9_ra_08/mikroe_lr9_ra_08.slcp @@ -0,0 +1,61 @@ +project_name: mikroe_lr_ra_08 +label: Third Party Hardware Drivers - RA-08 - LR 9 Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe LR 9 Click (Mikroe). +category: Example|Platform +quality: evaluation +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_lr9_ra_08/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: device_init +- id: sleeptimer +- id: mikroe_lr9 + from: third_party_hw_drivers +- id: iostream_eusart + instance: [vcom] +- id: iostream_usart + instance: [mikroe] +- id: app_log + +other_file: + - path: ../../documentation/example/mikroe_lr9_ra_08/image/create_project.png + directory: "image" + - path: ../../documentation/example/mikroe_lr9_ra_08/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_lr9_ra_08/image/log_receiver.png + directory: "image" + - path: ../../documentation/example/mikroe_lr9_ra_08/image/log_transmitter.png + directory: "image" + + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 + +ui_hints: + highlight: + - path: README.md + focus: true \ No newline at end of file diff --git a/app/example/mikroe_lte_iot2_bg96/app.c b/app/example/mikroe_lte_iot2_bg96/app.c index 0f833351..43b8454e 100644 --- a/app/example/mikroe_lte_iot2_bg96/app.c +++ b/app/example/mikroe_lte_iot2_bg96/app.c @@ -3,33 +3,76 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" #include "app_iostream_cli.h" #include "at_parser_events.h" #include "mikroe_bg96.h" +#if (defined(SLI_SI917)) +#include "sl_si91x_usart.h" +#include "rsi_debug.h" +#else +#include "sl_iostream_init_usart_instances.h" +#include "sl_iostream_init_eusart_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define USART_INSTANCE_USED UART_1 +static usart_peripheral_t uart_instance = USART_INSTANCE_USED; +#endif + +static mikroe_uart_handle_t app_uart_instance = NULL; + void app_init(void) { +#if (defined(SLI_SI917)) + app_uart_instance = &uart_instance; +#else + app_uart_instance = sl_iostream_uart_mikroe_handle; + + sl_iostream_set_default(sl_iostream_vcom_handle); app_log_iostream_set(sl_iostream_vcom_handle); - app_log("Hello World LTE IoT 2 Click !!!\r\n"); - bg96_nb_init(sl_iostream_mikroe_handle); - app_log("BG96 init done !!!\r\n"); - app_log("Type your command to execute the function !!!\r\n"); +#endif + + app_printf("Hello World LTE IoT 2 Click !!!\r\n"); + bg96_nb_init(app_uart_instance); + app_printf("BG96 init done !!!\r\n"); + app_printf("Type your command to execute the function !!!\r\n"); } /***************************************************************************//** diff --git a/app/example/mikroe_lte_iot2_bg96/app_iostream_cli.c b/app/example/mikroe_lte_iot2_bg96/app_iostream_cli.c index e553d211..9c69cea1 100644 --- a/app/example/mikroe_lte_iot2_bg96/app_iostream_cli.c +++ b/app/example/mikroe_lte_iot2_bg96/app_iostream_cli.c @@ -33,18 +33,27 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ #include +#include #include -#include "em_chip.h" -#include "sl_iostream.h" -#include "sl_iostream_init_instances.h" -#include "sl_iostream_handles.h" +#include "sl_string.h" + #include "at_parser_core.h" -#include "app_iostream_cli.h" #include "at_parser_events.h" -#include "app_log.h" #include "mikroe_bg96.h" -#include "sl_string.h" -#include "stdlib.h" +#include "app_iostream_cli.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else +#include "app_log.h" +#include "sl_iostream.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif /******************************************************************************* ******************************* MACROS ************************************ @@ -179,12 +188,18 @@ void app_iostream_cli_process_action(void) static uint8_t index = 0; static bool start_cli = false; +#if (defined(SLI_SI917)) + c = DEBUGIN(); +#else + /* Retrieve characters, print local echo and full line back */ sl_iostream_getchar(sl_iostream_vcom_handle, &c); +#endif + if (c > 0) { if ((c == '\r') || (c == '\n')) { - sl_iostream_putchar(sl_iostream_vcom_handle, '\r'); - sl_iostream_putchar(sl_iostream_vcom_handle, '\n'); + app_printf("%c", '\r'); + app_printf("%c", '\n'); buffer[index] = '\0'; app_parser(buffer); index = 0; @@ -197,11 +212,11 @@ void app_iostream_cli_process_action(void) if (start_cli == false) { start_cli = true; - app_log("[>>>] "); + app_printf("[>>>] "); } /* Local echo */ - sl_iostream_putchar(sl_iostream_vcom_handle, c); + app_printf("%c", c); } } } @@ -225,7 +240,7 @@ static void app_parser(uint8_t *buf) return; } } - app_log("Can't recognize command!\r\n"); + app_printf("Can't recognize command!\r\n"); } /**************************************************************************//** @@ -244,7 +259,7 @@ static void wakeup(void) bg96_wake_up(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, wakeup_handler, (void *) &output_object); - app_log("Waking up device!\r\n"); + app_printf("Waking up device!\r\n"); } /***************************************************************************//** @@ -260,9 +275,9 @@ static void wakeup_handler(void *handler_data) { at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while waking up: %d\r\n", l_output->error_code); + app_printf("Error while waking up: %d\r\n", l_output->error_code); } else { - app_log("Device is up!\r\n"); + app_printf("Device is up!\r\n"); } } @@ -280,7 +295,7 @@ static void sleep(void) SL_STATUS_OK, sleep_handler, (void *) &output_object); - app_log("Put the device to sleep!\r\n"); + app_printf("Put the device to sleep!\r\n"); } /***************************************************************************//** @@ -296,9 +311,9 @@ static void sleep_handler(void *handler_data) { at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while putting to sleep: %d\r\n", l_output->error_code); + app_printf("Error while putting to sleep: %d\r\n", l_output->error_code); } else { - app_log("Device went to sleep!\r\n"); + app_printf("Device went to sleep!\r\n"); } } @@ -314,7 +329,7 @@ static void imei(void) bg96_read_imei(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, imei_handler, (void *) &output_object); - app_log("Read IMEI command sent!\r\n"); + app_printf("Read IMEI command sent!\r\n"); } /***************************************************************************//** @@ -331,9 +346,9 @@ static void imei_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while reading IMEI: %d\r\n", l_output->error_code); + app_printf("Error while reading IMEI: %d\r\n", l_output->error_code); } else { - app_log("IMEI: %s\r\n", l_output->response_data); + app_printf("IMEI: %s\r\n", l_output->response_data); } } @@ -351,7 +366,7 @@ static void infor(void) SL_STATUS_OK, infor_handler, (void *) &output_object); - app_log("Get Quectel BG96 module infor command sent!\r\n"); + app_printf("Get Quectel BG96 module infor command sent!\r\n"); } /***************************************************************************//** @@ -368,9 +383,9 @@ static void infor_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while reading BG96 Infor: %d\r\n", l_output->error_code); + app_printf("Error while reading BG96 Infor: %d\r\n", l_output->error_code); } else { - app_log("%s\r\n", l_output->response_data); + app_printf("%s\r\n", l_output->response_data); } } @@ -388,7 +403,7 @@ static void set_gsm(void) SL_STATUS_OK, set_gsm_handler, (void *) &output_object); - app_log("Select TE Character Set to GSM command sent!\r\n"); + app_printf("Select TE Character Set to GSM command sent!\r\n"); } /***************************************************************************//** @@ -405,10 +420,10 @@ static void set_gsm_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while set te character set GSM: %d\r\n", - l_output->error_code); + app_printf("Error while set te character set GSM: %d\r\n", + l_output->error_code); } else { - app_log("Set GSM OK\r\n"); + app_printf("Set GSM OK\r\n"); } } @@ -425,7 +440,7 @@ static void set_service_domain(void) at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, set_service_domain_handler, (void *) &output_object); - app_log("Set the service domain CS_and_PS command sent!\r\n"); + app_printf("Set the service domain CS_and_PS command sent!\r\n"); } /***************************************************************************//** @@ -442,10 +457,10 @@ static void set_service_domain_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while configure the service domain of UE: %d\r\n", - l_output->error_code); + app_printf("Error while configure the service domain of UE: %d\r\n", + l_output->error_code); } else { - app_log("Configure the service domain OK\r\n"); + app_printf("Configure the service domain OK\r\n"); } } @@ -464,7 +479,7 @@ static void textmode(void) SL_STATUS_OK, settextmode_handler, (void *) &output_object); - app_log("Set BG96 to text mode command sent!\r\n"); + app_printf("Set BG96 to text mode command sent!\r\n"); } /***************************************************************************//** @@ -481,9 +496,9 @@ static void settextmode_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while set SMS text mode %d\r\n", l_output->error_code); + app_printf("Error while set SMS text mode %d\r\n", l_output->error_code); } else { - app_log("Set SMS text mode OK\r\n"); + app_printf("Set SMS text mode OK\r\n"); } } @@ -501,7 +516,7 @@ static void pdumode(void) SL_STATUS_OK, setpdumode_handler, (void *) &output_object); - app_log("Set BG96 to pdu mode command sent!\r\n"); + app_printf("Set BG96 to pdu mode command sent!\r\n"); } /***************************************************************************//** @@ -518,9 +533,9 @@ static void setpdumode_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while set SMS pdu mode %d\r\n", l_output->error_code); + app_printf("Error while set SMS pdu mode %d\r\n", l_output->error_code); } else { - app_log("Set SMS pdu mode OK\r\n"); + app_printf("Set SMS pdu mode OK\r\n"); } } @@ -540,7 +555,7 @@ static void sms_text(void) at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, sms_text_handler, (void *) &output_object); - app_log("SMS text command sent!\r\n"); + app_printf("SMS text command sent!\r\n"); } /***************************************************************************//** @@ -557,11 +572,11 @@ static void sms_text_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while send sms text: %d\r\n", - l_output->error_code); + app_printf("Error while send sms text: %d\r\n", + l_output->error_code); } else { - app_log("Send sms text mode ok, response data: %s\r\n", - l_output->response_data); + app_printf("Send sms text mode ok, response data: %s\r\n", + l_output->response_data); } } @@ -584,7 +599,7 @@ static void sms_pdu(void) at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, sms_pdu_handler, (void *) &output_object); - app_log("SMS pdu command sent!\r\n"); + app_printf("SMS pdu command sent!\r\n"); } /***************************************************************************//** @@ -601,11 +616,11 @@ static void sms_pdu_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while send sms pdu: %d\r\n", - l_output->error_code); + app_printf("Error while send sms pdu: %d\r\n", + l_output->error_code); } else { - app_log("Send sms text mode ok, response data: %s\r\n", - l_output->response_data); + app_printf("Send sms text mode ok, response data: %s\r\n", + l_output->response_data); } } @@ -624,7 +639,7 @@ static void sim_apn(void) at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, sim_apn_handler, (void *) &output_object); - app_log("Set SIM APN command sent!\r\n"); + app_printf("Set SIM APN command sent!\r\n"); } /***************************************************************************//** @@ -641,9 +656,9 @@ static void sim_apn_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while set sim apn: %d\r\n", l_output->error_code); + app_printf("Error while set sim apn: %d\r\n", l_output->error_code); } else { - app_log("Set SIM APN ok\r\n"); + app_printf("Set SIM APN ok\r\n"); } } @@ -659,7 +674,7 @@ static void ip(void) bg96_read_ip(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, ip_handler, (void *) &output_object); - app_log("Read IP command sent!\r\n"); + app_printf("Read IP command sent!\r\n"); } /***************************************************************************//** @@ -675,10 +690,10 @@ static void ip_handler(void *handler_data) { at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while reading IP: %d\r\n%s\r\n", l_output->error_code, - l_output->response_data); + app_printf("Error while reading IP: %d\r\n%s\r\n", l_output->error_code, + l_output->response_data); } else { - app_log("IP address: %s\r\n", l_output->response_data); + app_printf("IP address: %s\r\n", l_output->response_data); } } @@ -694,7 +709,7 @@ static void net_reg(void) bg96_network_registration(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, net_reg_handler, (void *) &output_object); - app_log("Network registration started!\r\n"); + app_printf("Network registration started!\r\n"); } /***************************************************************************//** @@ -710,10 +725,10 @@ static void net_reg_handler(void *handler_data) { at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Network registration error: %d\r\n%s\r\n", l_output->error_code, - l_output->response_data); + app_printf("Network registration error: %d\r\n%s\r\n", l_output->error_code, + l_output->response_data); } else { - app_log("Network registration done!\r\n"); + app_printf("Network registration done!\r\n"); } } @@ -736,7 +751,7 @@ static void open(void) bg96_nb_open_connection(&connection, &output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, open_handler, (void *) &output_object); - app_log("Open command sent!\r\n"); + app_printf("Open command sent!\r\n"); } /***************************************************************************//** @@ -753,9 +768,9 @@ static void open_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Network open error: %d\r\n", (int) l_output->error_code); + app_printf("Network open error: %d\r\n", (int) l_output->error_code); } else { - app_log("Network opened.\r\n"); + app_printf("Network opened.\r\n"); } } @@ -776,7 +791,7 @@ static void open_server(void) at_parser_init_output_object(&output_object); bg96_nb_open_connection(&connection, &output_object); - app_log("Open server command sent!\r\n"); + app_printf("Open server command sent!\r\n"); } /***************************************************************************//** @@ -795,7 +810,7 @@ static void close_server(void) at_parser_init_output_object(&output_object); bg96_nb_close_connection(&connection, &output_object); - app_log("Open server command sent!\r\n"); + app_printf("Open server command sent!\r\n"); } /***************************************************************************//** @@ -819,7 +834,7 @@ static void send(void) bg96_nb_send_data(&connection, data_to_send, &output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, send_handler, (void *) &output_object); - app_log("Data has been sent!\r\n"); + app_printf("Data has been sent!\r\n"); } /***************************************************************************//** @@ -834,9 +849,9 @@ static void send(void) static void send_handler(void *handler_data) { at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; - app_log("Send response received! Error: %d Data: %s\r\n", - l_output->error_code, - l_output->response_data); + app_printf("Send response received! Error: %d Data: %s\r\n", + l_output->error_code, + l_output->response_data); } /***************************************************************************//** @@ -860,7 +875,7 @@ static void close(void) SL_STATUS_OK, close_handler, (void *) &output_object); - app_log("Close command sent!\r\n"); + app_printf("Close command sent!\r\n"); } /***************************************************************************//** @@ -877,10 +892,10 @@ static void close_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Network close error: %d\r\n %s\r\n", l_output->error_code, - l_output->response_data); + app_printf("Network close error: %d\r\n %s\r\n", l_output->error_code, + l_output->response_data); } else { - app_log("Network closed\r\n"); + app_printf("Network closed\r\n"); } } @@ -896,7 +911,7 @@ static void cops(void) bg96_get_operator(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, cops_handler, (void *) &output_object); - app_log("Getting operator!\r\n"); + app_printf("Getting operator!\r\n"); } /***************************************************************************//** @@ -913,10 +928,11 @@ static void cops_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while getting operator: %d\r\n %s\r\n", l_output->error_code, - l_output->response_data); + app_printf("Error while getting operator: %d\r\n %s\r\n", + l_output->error_code, + l_output->response_data); } else { - app_log("Actual operator: %s\r\n", l_output->response_data); + app_printf("Actual operator: %s\r\n", l_output->response_data); } } @@ -932,7 +948,7 @@ static void receive(void) bg96_nb_receive_data(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, recv_handler, (void *) &output_object); - app_log("Receiving data!\r\n"); + app_printf("Receiving data!\r\n"); } /***************************************************************************//** @@ -948,10 +964,11 @@ static void recv_handler(void *handler_data) { at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while receiving data: %d\r\n %s\r\n", l_output->error_code, - l_output->response_data); + app_printf("Error while receiving data: %d\r\n %s\r\n", + l_output->error_code, + l_output->response_data); } else { - app_log("Received data: %s\r\n", l_output->response_data); + app_printf("Received data: %s\r\n", l_output->response_data); } } @@ -967,7 +984,7 @@ static void gps_start(void) bg96_gnss_start(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, start_gnss_handler, (void *) &output_object); - app_log("GNSS start command sent.\r\n"); + app_printf("GNSS start command sent.\r\n"); } /***************************************************************************//** @@ -984,9 +1001,9 @@ static void start_gnss_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while starting GNSS: %d\r\n", l_output->error_code); + app_printf("Error while starting GNSS: %d\r\n", l_output->error_code); } else { - app_log("GNSS started.\r\n"); + app_printf("GNSS started.\r\n"); } } @@ -1002,7 +1019,7 @@ static void gps_location(void) bg96_gnss_get_position(&output_object); at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, get_position_handler, (void *) &output_object); - app_log("GNSS position command sent.\r\n"); + app_printf("GNSS position command sent.\r\n"); } /***************************************************************************//** @@ -1020,10 +1037,12 @@ static void get_position_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while getting position: %d\r\n %s\r\n", l_output->error_code, - l_output->response_data); + app_printf("Error while getting position: %d\r\n %s\r\n", + l_output->error_code, + l_output->response_data); } else { - app_log("GPS location raw response data: %s\r\n", l_output->response_data); + app_printf("GPS location raw response data: %s\r\n", + l_output->response_data); uint8_t element_buf[200] = { 0 }; sl_status_t stt = bg96_gpsloc_generic_parser(l_output->response_data, @@ -1061,7 +1080,7 @@ static void get_position_handler(void *handler_data) strlen((const char *)element_buf) - 3); double latitude = (atof((const char *)latitude_int) + (atof((const char *)(latitude_decimal)) / 60.0)); - app_log("Latitude: %.6f\r\n", latitude); + app_printf("Latitude: %.6f\r\n", latitude); memset(element_buf, 0, sizeof(element_buf)); bg96_gpsloc_generic_parser(l_output->response_data, @@ -1076,13 +1095,13 @@ static void get_position_handler(void *handler_data) double longtitude = (atof((const char *)longitude_int) + (atof((const char *)(longitude_decimal)) / 60.0)); - app_log("Longitude: %.6f\r\n", longtitude); + app_printf("Longitude: %.6f\r\n", longtitude); memset(element_buf, 0, sizeof(element_buf)); bg96_gpsloc_generic_parser(l_output->response_data, element_buf, gpsloc_element_altitude_e); - app_log("Altitude: %sM\r\n", element_buf); + app_printf("Altitude: %sM\r\n", element_buf); bg96_gpsloc_generic_parser(l_output->response_data, element_buf, @@ -1094,7 +1113,7 @@ static void get_position_handler(void *handler_data) memcpy((void *)minuste, (const void *)element_buf + 2, 2); memcpy((void *)seconds, (const void *)element_buf + 4, 2); - app_log("Time UTC: %sh:%sm:%ss\r\n", hour, minuste, seconds); + app_printf("Time UTC: %sh:%sm:%ss\r\n", hour, minuste, seconds); bg96_gpsloc_generic_parser(l_output->response_data, element_buf, @@ -1106,7 +1125,7 @@ static void get_position_handler(void *handler_data) memcpy((void *)month, (const void *)element_buf + 2, 2); memcpy((void *)year, (const void *)element_buf + 4, 2); - app_log("Date: %s/%s/20%s\r\n", day, month, year); + app_printf("Date: %s/%s/20%s\r\n", day, month, year); } } } @@ -1168,7 +1187,7 @@ static void gps_stop(void) at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, stop_gnss_handler, (void *) &output_object); bg96_gnss_stop(&output_object); - app_log("GNSS stop command sent.\r\n"); + app_printf("GNSS stop command sent.\r\n"); } /***************************************************************************//** @@ -1185,8 +1204,8 @@ static void stop_gnss_handler(void *handler_data) at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; if (l_output->error_code) { - app_log("Error while stopping GNSS: %d\r\n", l_output->error_code); + app_printf("Error while stopping GNSS: %d\r\n", l_output->error_code); } else { - app_log("GNSS stopped.\r\n"); + app_printf("GNSS stopped.\r\n"); } } diff --git a/app/example/mikroe_lte_iot2_bg96/app_iostream_cli_si91x.c b/app/example/mikroe_lte_iot2_bg96/app_iostream_cli_si91x.c new file mode 100644 index 00000000..d463f5b8 --- /dev/null +++ b/app/example/mikroe_lte_iot2_bg96/app_iostream_cli_si91x.c @@ -0,0 +1,1362 @@ +/***************************************************************************//** + * @file app_iostream_cli.c + * @brief source of simple CLI + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ +#include +#include +#include +#include "sl_string.h" + +#include "at_parser_core.h" +#include "at_parser_events.h" +#include "mikroe_bg96.h" +#include "app_iostream_cli.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else +#include "app_log.h" +#include "sl_iostream.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +/******************************************************************************* + ******************************* MACROS ************************************ + ******************************************************************************/ +#ifndef BUFSIZE +#define BUFSIZE 80 +#endif + +/* AT+QGPSLOC Acquire Positioning Information + * Response: "+QGPSLOC: ,,,,,, + * ,,,," + * + */ +typedef enum { + gpsloc_element_UTC_time_e = 1, + gpsloc_element_latitude_e, + gpsloc_element_longitude_e, + gpsloc_element_hdop_e, + gpsloc_element_altitude_e, + gpsloc_element_fix_e, + gpsloc_element_cog_e, + gpsloc_element_spkm_e, + gpsloc_element_spkn_e, + gpsloc_element_date_e, + gpsloc_element_nsat_e, +}bg96_gnssloc_response_elements_t; + +/******************************************************************************* + *************** STATIC FUNCTION DECLARATIONS ****************************** + ******************************************************************************/ +static void app_parser(uint8_t *buf); +static void wakeup(void); +static void sleep(void); +static void infor(void); +static void imei(void); +static void textmode(void); +static void pdumode(void); +static void set_gsm(void); +static void set_service_domain(void); +static void sms_text(void); +static void sms_pdu(void); +static void sim_apn(void); +static void ip(void); +static void net_reg(void); +static void open(void); +static void send(void); +static void close(void); +static void cops(void); +static void receive(void); +static void gps_start(void); +static void gps_location(void); +static void gps_stop(void); +static void open_server(void); +static void close_server(void); + +static void wakeup_handler(void *handler_data); +static void sleep_handler(void *handler_data); +static void infor_handler(void *handler_data); +static void imei_handler(void *handler_data); +static void settextmode_handler(void *handler_data); +static void setpdumode_handler(void *handler_data); +static void set_gsm_handler(void *handler_data); +static void set_service_domain_handler(void *handler_data); +static void sms_text_handler(void *handler_data); +static void sms_pdu_handler(void *handler_data); +static void sim_apn_handler(void *handler_data); +static void ip_handler(void *handler_data); +static void net_reg_handler(void *handler_data); +static void open_handler(void *handler_data); +static void close_handler(void *handler_data); +static void send_handler(void *handler_data); +static void recv_handler(void *handler_data); +static void cops_handler(void *handler_data); +static void stop_gnss_handler(void *handler_data); +static void get_position_handler(void *handler_data); +static void start_gnss_handler(void *handler_data); +static sl_status_t bg96_gpsloc_generic_parser(uint8_t *input_string, + uint8_t *parser_buf, + bg96_gnssloc_response_elements_t element); + +/******************************************************************************* + ************************** GLOBAL VAAIBLES ********************************* + ******************************************************************************/ +static uint8_t buffer[BUFSIZE]; +static bool at_processing = false; + +/**************************************************************************//** + * @brief + * Command and handler definitions for the CLI. + * + *****************************************************************************/ +static cli_cmd_t cli_cmds[] = { + { "wakeup", wakeup }, + { "sleep", sleep }, + { "imei", imei }, + { "infor", infor }, + { "gsm", set_gsm }, + { "service", set_service_domain }, + { "textmode", textmode }, + { "pdumode", pdumode }, + { "smstext", sms_text }, + { "smspdu", sms_pdu }, + { "simapn", sim_apn }, + { "ip", ip }, + { "netreg", net_reg }, + { "open", open }, + { "send", send }, + { "close", close }, + { "cops", cops }, + { "recv", receive }, + { "gpsstart", gps_start }, + { "location", gps_location }, + { "gpsstop", gps_stop }, + { "opens", open_server }, + { "closes", close_server }, +}; +static uint8_t cli_cmd_size = sizeof(cli_cmds) / sizeof(cli_cmds[0]); + +at_scheduler_status_t output_object = { + SL_STATUS_NOT_INITIALIZED, + 0, "" +}; + +/**************************************************************************//** + * @brief + * App layer process function. + * This function SHALL be called periodically in the main loop. + * + *****************************************************************************/ +void app_iostream_cli_process_action(void) +{ + char c = 0; + static uint8_t index = 0; + static bool start_cli = false; + +#if (defined(SLI_SI917)) + c = DEBUGIN(); +#else + + /* Retrieve characters, print local echo and full line back */ + sl_iostream_getchar(sl_iostream_vcom_handle, &c); +#endif + + if (c > 0) { + if ((c == '\r') || (c == '\n')) { + app_printf("%c", '\r'); + app_printf("%c", '\n'); + buffer[index] = '\0'; + app_parser(buffer); + index = 0; + start_cli = false; + } else { + if (index < BUFSIZE - 1) { + buffer[index] = c; + index++; + } + + if (start_cli == false) { + start_cli = true; + app_printf("[>>>] "); + } + + /* Local echo */ + app_printf("%c", c); + } + } +} + +/**************************************************************************//** + * @brief + * App lacer incoming command parser function. + * + * @param[in] buf + * Pointer to the buffer which contains the input command. + * + *****************************************************************************/ +static void app_parser(uint8_t *buf) +{ + uint8_t i; + + for (i = 0; i < cli_cmd_size; i++) { + if (!strncmp((const char *) cli_cmds[i].cmd, (const char *) buf, + CLI_CMD_LENGTH)) { + cli_cmds[i].handler(); + return; + } + } + app_printf("Can't recognize command!\r\n"); +} + +/**************************************************************************//** +* Command handler functions +******************************************************************************/ + +/***************************************************************************//** + * @brief + * Wake up function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void wakeup(void) +{ + at_parser_init_output_object(&output_object); + bg96_wake_up(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + wakeup_handler, (void *) &output_object); + app_printf("Waking up device!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Wake up handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void wakeup_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + if (l_output->error_code) { + app_printf("Error while waking up: %d\r\n", l_output->error_code); + } else { + app_printf("Device is up!\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Sleep function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void sleep(void) +{ + at_parser_init_output_object(&output_object); + bg96_sleep(&output_object); + at_listen_event((uint8_t *) &output_object.status, + SL_STATUS_OK, + sleep_handler, + (void *) &output_object); + app_printf("Put the device to sleep!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Sleep handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void sleep_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + if (l_output->error_code) { + app_printf("Error while putting to sleep: %d\r\n", l_output->error_code); + } else { + app_printf("Device went to sleep!\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Get IMEI function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void imei(void) +{ + at_parser_init_output_object(&output_object); + bg96_read_imei(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, imei_handler, + (void *) &output_object); + app_printf("Read IMEI command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Get IMEI handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void imei_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while reading IMEI: %d\r\n", l_output->error_code); + } else { + app_printf("IMEI: %s\r\n", l_output->response_data); + } +} + +/***************************************************************************//** + * @brief + * Get BG96 Module information function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void infor(void) +{ + at_parser_init_output_object(&output_object); + bg96_read_infor(&output_object); + at_listen_event((uint8_t *) &output_object.status, + SL_STATUS_OK, + infor_handler, + (void *) &output_object); + app_printf("Get Quectel BG96 module infor command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Get BG96 Module information handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void infor_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while reading BG96 Infor: %d\r\n", l_output->error_code); + } else { + app_printf("%s\r\n", l_output->response_data); + } +} + +/***************************************************************************//** + * @brief + * Select TE Character Set to GSM function. Call this function before sending + * sms. Result will be available in the global output_object. + * + ******************************************************************************/ +static void set_gsm(void) +{ + at_parser_init_output_object(&output_object); + bg96_set_te_gsm(&output_object); + at_listen_event((uint8_t *) &output_object.status, + SL_STATUS_OK, + set_gsm_handler, + (void *) &output_object); + app_printf("Select TE Character Set to GSM command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Select TE Character Set to GSM handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void set_gsm_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while set te character set GSM: %d\r\n", + l_output->error_code); + } else { + app_printf("Set GSM OK\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Configure the service domain of UE function + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void set_service_domain(void) +{ + at_parser_init_output_object(&output_object); + bg96_config_service_domain(&output_object, service_domain_type_CS_and_PS_e); + at_listen_event((uint8_t *) &output_object.status, + SL_STATUS_OK, set_service_domain_handler, + (void *) &output_object); + app_printf("Set the service domain CS_and_PS command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Configure the service domain of UE handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void set_service_domain_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while configure the service domain of UE: %d\r\n", + l_output->error_code); + } else { + app_printf("Configure the service domain OK\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Set BG96 to Text Mode function. Call this function before sending sms + * text. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void textmode(void) +{ + at_parser_init_output_object(&output_object); + bg96_set_sms_mode(&output_object, set_sms_mode_text); + at_listen_event((uint8_t *) &output_object.status, + SL_STATUS_OK, + settextmode_handler, + (void *) &output_object); + app_printf("Set BG96 to text mode command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Set BG96 to Text Mode handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void settextmode_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while set SMS text mode %d\r\n", l_output->error_code); + } else { + app_printf("Set SMS text mode OK\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Set BG96 to PDU Mode function. Call this function before sending sms pdu. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void pdumode(void) +{ + at_parser_init_output_object(&output_object); + bg96_set_sms_mode(&output_object, set_sms_mode_pdu); + at_listen_event((uint8_t *) &output_object.status, + SL_STATUS_OK, + setpdumode_handler, + (void *) &output_object); + app_printf("Set BG96 to pdu mode command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Set BG96 to PDU Mode handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void setpdumode_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while set SMS pdu mode %d\r\n", l_output->error_code); + } else { + app_printf("Set SMS pdu mode OK\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Send SMS Text function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void sms_text(void) +{ + bg96_sms_text_t sms_text = { " *** ", \ + "Hello World - LTE IoT 2 Click Board !!! - (sms text mode)" }; + + at_parser_init_output_object(&output_object); + bg96_send_sms_text(&output_object, &sms_text); + + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + sms_text_handler, (void *) &output_object); + app_printf("SMS text command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Send SMS Text handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void sms_text_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while send sms text: %d\r\n", + l_output->error_code); + } else { + app_printf("Send sms text mode ok, response data: %s\r\n", + l_output->response_data); + } +} + +/***************************************************************************//** + * @brief + * Send SMS PDU function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void sms_pdu(void) +{ + bg96_sms_pdu_t sms_pdu = { + " *** ", + " *** ", + "Hello World - LTE IoT 2 Click Board !!! - (sms pdu mode)" + }; + + at_parser_init_output_object(&output_object); + bg96_send_sms_pdu(&output_object, &sms_pdu); + + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + sms_pdu_handler, (void *) &output_object); + app_printf("SMS pdu command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Send SMS PDU handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void sms_pdu_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while send sms pdu: %d\r\n", + l_output->error_code); + } else { + app_printf("Send sms text mode ok, response data: %s\r\n", + l_output->response_data); + } +} + +/***************************************************************************//** + * @brief + * Set SIM APN function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void sim_apn(void) +{ + uint8_t sim_apn[30] = "v-internet"; + + at_parser_init_output_object(&output_object); + bg96_set_sim_apn(&output_object, (uint8_t *)sim_apn); + + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + sim_apn_handler, (void *) &output_object); + app_printf("Set SIM APN command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Set SIM APN handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void sim_apn_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while set sim apn: %d\r\n", l_output->error_code); + } else { + app_printf("Set SIM APN ok\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Get IO address function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void ip(void) +{ + at_parser_init_output_object(&output_object); + bg96_read_ip(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, ip_handler, + (void *) &output_object); + app_printf("Read IP command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Get IP address handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void ip_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while reading IP: %d\r\n%s\r\n", l_output->error_code, + l_output->response_data); + } else { + app_printf("IP address: %s\r\n", l_output->response_data); + } +} + +/***************************************************************************//** + * @brief + * Network registration function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void net_reg(void) +{ + at_parser_init_output_object(&output_object); + bg96_network_registration(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + net_reg_handler, (void *) &output_object); + app_printf("Network registration started!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Network registration handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void net_reg_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Network registration error: %d\r\n%s\r\n", l_output->error_code, + l_output->response_data); + } else { + app_printf("Network registration done!\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Open client connection function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void open(void) +{ + bg96_nb_connection_t connection = { + 0, + 9999, + "TCP", + (uint8_t *) "cloudsocket.hologram.io" + }; + + at_parser_init_output_object(&output_object); + bg96_nb_open_connection(&connection, &output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, open_handler, + (void *) &output_object); + app_printf("Open command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Open client connection handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void open_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Network open error: %d\r\n", (int) l_output->error_code); + } else { + app_printf("Network opened.\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Open server connection function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void open_server(void) +{ + bg96_nb_connection_t connection = { + 0, + 2020, + "TCP LISTENER", + (uint8_t *) "127.0.0.1" + }; + + at_parser_init_output_object(&output_object); + bg96_nb_open_connection(&connection, &output_object); + app_printf("Open server command sent!\r\n"); +} + +/***************************************************************************//** + * @brief + * Close server connection function. + * Result will be available in the global output_object. + ******************************************************************************/ +static void close_server(void) +{ + bg96_nb_connection_t connection = { + 11, + 2020, + "TCP LISTENER", + (uint8_t *) "127.0.0.1" + }; + + at_parser_init_output_object(&output_object); + bg96_nb_close_connection(&connection, &output_object); + app_printf("Open server command sent!\r\n"); +} + +/***************************************************************************//** + * @brief + * Send data on an opened channel. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void send(void) +{ + bg96_nb_connection_t connection = { + 0, + 9999, + "TCP", + (uint8_t *) "cloudsocket.hologram.io" + }; + uint8_t data_to_send[] = + "{\"k\":\"Tm}hswZ8\",\"d\":\"Hello Silabs!\",\"t\":\"my_topic\"}"; + + at_parser_init_output_object(&output_object); + bg96_nb_send_data(&connection, data_to_send, &output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, send_handler, + (void *) &output_object); + app_printf("Data has been sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Send data handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void send_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + app_printf("Send response received! Error: %d Data: %s\r\n", + l_output->error_code, + l_output->response_data); +} + +/***************************************************************************//** + * @brief + * Close client connection function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void close(void) +{ + bg96_nb_connection_t connection = { + 0, + 9999, + "TCP", + (uint8_t *) "cloudsocket.hologram.io" + }; + + at_parser_init_output_object(&output_object); + bg96_nb_close_connection(&connection, &output_object); + at_listen_event((uint8_t *) &output_object.status, + SL_STATUS_OK, + close_handler, + (void *) &output_object); + app_printf("Close command sent!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Close client connection handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void close_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Network close error: %d\r\n %s\r\n", l_output->error_code, + l_output->response_data); + } else { + app_printf("Network closed\r\n"); + } +} + +/***************************************************************************//** + * @brief + * Get actual operator function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void cops(void) +{ + at_parser_init_output_object(&output_object); + bg96_get_operator(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, cops_handler, + (void *) &output_object); + app_printf("Getting operator!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Get actual operator handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void cops_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while getting operator: %d\r\n %s\r\n", + l_output->error_code, + l_output->response_data); + } else { + app_printf("Actual operator: %s\r\n", l_output->response_data); + } +} + +/***************************************************************************//** + * @brief + * Receive data function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void receive(void) +{ + at_parser_init_output_object(&output_object); + bg96_nb_receive_data(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, recv_handler, + (void *) &output_object); + app_printf("Receiving data!\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Receive data handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void recv_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while receiving data: %d\r\n %s\r\n", + l_output->error_code, + l_output->response_data); + } else { + app_printf("Received data: %s\r\n", l_output->response_data); + } +} + +/***************************************************************************//** + * @brief + * GNSS start function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void gps_start(void) +{ + at_parser_init_output_object(&output_object); + bg96_gnss_start(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + start_gnss_handler, (void *) &output_object); + app_printf("GNSS start command sent.\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Start GNSS handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void start_gnss_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while starting GNSS: %d\r\n", l_output->error_code); + } else { + app_printf("GNSS started.\r\n"); + } +} + +/***************************************************************************//** + * @brief + * GNSS get location function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void gps_location(void) +{ + at_parser_init_output_object(&output_object); + bg96_gnss_get_position(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + get_position_handler, (void *) &output_object); + app_printf("GNSS position command sent.\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Get GNSS location handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * +QGPSLOC: ,,,,,,, + * ,,, + ******************************************************************************/ +static void get_position_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while getting position: %d\r\n %s\r\n", + l_output->error_code, + l_output->response_data); + } else { + app_printf("GPS location raw response data: %s\r\n", + l_output->response_data); + + uint8_t element_buf[200] = { 0 }; + sl_status_t stt = bg96_gpsloc_generic_parser(l_output->response_data, + element_buf, + gpsloc_element_latitude_e); + + if ((sl_strlen((char *) element_buf) > 0) && (SL_STATUS_OK == stt)) { + /* + * Latitude ranges between -90 and 90 degrees. + * Longitude ranges between -180 and 180 degrees. + * + * Convert to degree calculation example: + * Latitude: [N] 2451.71 is 24 degrees north latitude and 51.71 + * minutes. + * Convert the points to degrees 51.71 / 60 = 0.86183. + * The actual Google Map corresponds to 24 + 0.86183 = +24.86183. + * Longitude: [E] 12100.99 is 121 degrees east long and 0.99 points. + * Convert the points to degrees 0.99 / 60 = 0.0165. + * The actual Google Map is 121 + 0.0165 = +121.0165. + * Combine the converted latitude and longitude data into + * (+24.86183, +121.0165) and enter the field of Google Map to find the + * actual corresponding location. + */ + + uint8_t latitude_int[10]; + uint8_t latitude_decimal[10]; + uint8_t longitude_int[10]; + uint8_t longitude_decimal[10]; + + // latitude_int = 2 character + memcpy((void *)latitude_int, (const void *)element_buf, 2); + // Ignore addition one character = 'N' or 'S' + memcpy((void *)latitude_decimal, + (const void *)(element_buf + 2), + strlen((const char *)element_buf) - 3); + double latitude = (atof((const char *)latitude_int) + + (atof((const char *)(latitude_decimal)) / 60.0)); + app_printf("Latitude: %.6f\r\n", latitude); + memset(element_buf, 0, sizeof(element_buf)); + + bg96_gpsloc_generic_parser(l_output->response_data, + element_buf, + gpsloc_element_longitude_e); + // longitude_int = 3 character + memcpy((void *)longitude_int, (const void *)element_buf, 3); + // Ignore addition one character = 'E' or 'W' + memcpy((void *)longitude_decimal, + (const void *) (element_buf + 3), + strlen((const char *)element_buf) - 4); + double longtitude = (atof((const char *)longitude_int) + + (atof((const char *)(longitude_decimal)) + / 60.0)); + app_printf("Longitude: %.6f\r\n", longtitude); + memset(element_buf, 0, sizeof(element_buf)); + + bg96_gpsloc_generic_parser(l_output->response_data, + element_buf, + gpsloc_element_altitude_e); + app_printf("Altitude: %sM\r\n", element_buf); + + bg96_gpsloc_generic_parser(l_output->response_data, + element_buf, + gpsloc_element_UTC_time_e); + uint8_t hour[3] = { 0 }; + uint8_t minuste[3] = { 0 }; + uint8_t seconds[3] = { 0 }; + memcpy((void *)hour, (const void *)element_buf, 2); + memcpy((void *)minuste, (const void *)element_buf + 2, 2); + memcpy((void *)seconds, (const void *)element_buf + 4, 2); + + app_printf("Time UTC: %sh:%sm:%ss\r\n", hour, minuste, seconds); + + bg96_gpsloc_generic_parser(l_output->response_data, + element_buf, + gpsloc_element_date_e); + uint8_t day[3] = { 0 }; + uint8_t month[3] = { 0 }; + uint8_t year[3] = { 0 }; + memcpy((void *)day, (const void *)element_buf, 2); + memcpy((void *)month, (const void *)element_buf + 2, 2); + memcpy((void *)year, (const void *)element_buf + 4, 2); + + app_printf("Date: %s/%s/20%s\r\n", day, month, year); + } + } +} + +sl_status_t bg96_gpsloc_generic_parser(uint8_t *input_string, + uint8_t *parser_buf, + bg96_gnssloc_response_elements_t element) +{ + uint8_t rsp_buf[200]; + uint8_t element_cnt = 0; + uint8_t *start_rsp; + uint8_t *element_start; + uint8_t *element_end; + + start_rsp = (uint8_t *)strstr((const char *) input_string, + (const char *)"+QGPSLOC: "); + + if ((start_rsp != 0)) { + memset(rsp_buf, 0, 200); + sl_strcpy_s((char *)rsp_buf, 200, (const char *) start_rsp); + element_start = rsp_buf + strlen((const char *)"+QGPSLOC: "); + + do + { + if (element_cnt != 0) { + element_start = + (uint8_t *)strstr((const char *) element_start, (const char *)","); + if (element_start != 0) { + element_start++; + } + } + element_cnt++; + } while (element_cnt < element); + + element_end = (uint8_t *)strstr((const char *) element_start, + (const char *)","); + + if ((element_start != 0) && (element_end != 0)) { + strncpy((char *) parser_buf, + (const char *)element_start, + element_end - element_start); + } + } else { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief + * GNSS stop listening function. + * Result will be available in the global output_object. + * + ******************************************************************************/ +static void gps_stop(void) +{ + at_parser_init_output_object(&output_object); + at_listen_event((uint8_t *) &output_object.status, SL_STATUS_OK, + stop_gnss_handler, (void *) &output_object); + bg96_gnss_stop(&output_object); + app_printf("GNSS stop command sent.\r\n"); + at_processing = true; + while (at_processing) { + at_parser_process(); + at_platform_process(); + at_event_process(); + } +} + +/***************************************************************************//** + * @brief + * Stop GNSS handler function. + * + * @param[in] handler_data + * Data sent by the event handler. + * Currently handler_data is a pointer to an at_scheduler_status_t. + * + ******************************************************************************/ +static void stop_gnss_handler(void *handler_data) +{ + at_processing = false; + at_scheduler_status_t *l_output = (at_scheduler_status_t *) handler_data; + + if (l_output->error_code) { + app_printf("Error while stopping GNSS: %d\r\n", l_output->error_code); + } else { + app_printf("GNSS stopped.\r\n"); + } +} diff --git a/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp b/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp index c6fd6182..b4ff0703 100644 --- a/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp +++ b/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96.slcp @@ -39,22 +39,34 @@ component: instance: [mikroe] - id: app_log +configuration: + - name: SL_IOSTREAM_USART_MIKROE_FLOW_CONTROL_TYPE + value: usartHwFlowControlNone + - name: SL_IOSTREAM_USART_MIKROE_RX_BUFFER_SIZE + value: 256 + - name: CIRCULAR_QUEUE_LEN_MAX + value: "256" + toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/create_example.png directory: "image" - - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_1.png + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_queue_size.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_uart_si91x.png directory: "image" - - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_2.png + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_sms_phone_number.png directory: "image" - - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_3.png + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_pdu_phone_number.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_1.png directory: "image" - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/log.png directory: "image" diff --git a/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96_si91x.slcp b/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96_si91x.slcp new file mode 100644 index 00000000..a8c0544d --- /dev/null +++ b/app/example/mikroe_lte_iot2_bg96/mikroe_lte_iot2_bg96_si91x.slcp @@ -0,0 +1,84 @@ +project_name: mikroe_lte_iot2_bg96 +package: platform +label: Third Party Hardware Drivers - BG96 - LTE IoT 2 Click (Mikroe) +description: | + This example project shows an example for Mikroe LTE IoT 2 Click driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_lte_iot2_bg96/README.md + +source: +- path: app.c +- path: main.c +- path: app_iostream_cli_si91x.c + +include: +- path: '' + file_list: + - path: app.h + - path: app_iostream_cli.h + +component: +- id: sl_system +- id: mikroe_lte_iot2 + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +configuration: + - name: SL_UART1_DMA_CONFIG_ENABLE + value: "0" + - name: CIRCULAR_QUEUE_LEN_MAX + value: "256" + +other_file: + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_queue_size.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_uart_si91x.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_sms_phone_number.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/config_pdu_phone_number.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/hardware_connection_1.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/sms_receive.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/layer.drawio.png + directory: "image" + - path: ../../documentation/example/mikroe_lte_iot2_bg96/image/gps_log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_mic2/app.c b/app/example/mikroe_mic2/app.c index 672bb71a..364cb3ac 100644 --- a/app/example/mikroe_mic2/app.c +++ b/app/example/mikroe_mic2/app.c @@ -1,30 +1,68 @@ /***************************************************************************//** - * @file app.c + * @file * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#include "app_log.h" #include "mikroe_mic2.h" +#if (defined(SLI_SI917)) +#include "sl_adc_instances.h" +#include "sl_i2c_instances.h" +#include "rsi_debug.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +static uint8_t channel = SL_ADC_CHANNEL_1; +#else +#include "em_iadc.h" +#include "sl_i2cspm_instances.h" +#include "app_log.h" + +#define app_printf(...) app_log(__VA_ARGS__) +#endif + #define READING_INTERVAL_MSEC 500 static mikroe_mic2_data_t adc_value; static volatile bool mic2_timer_expire = false; static sl_sleeptimer_timer_handle_t mic2_timer; +static mikroe_adc_handle_t app_adc_handle = NULL; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void mic2_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, void *data); @@ -36,14 +74,31 @@ void app_init(void) { sl_status_t sc; - app_log("Application Initialization.\n"); - mikroe_mic2_cfg_setup(); - sc = mikroe_mic2_init(sl_i2cspm_mikroe, IADC0); +#if (defined(SLI_SI917)) + app_adc_handle = &channel; + app_i2c_instance = &i2c_instance; +#else + app_adc_handle = IADC0; + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + app_printf("Application Initialization.\n"); + sc = mikroe_mic2_init(app_i2c_instance, app_adc_handle); +#if (defined(SLI_SI917)) + + /** + * Due to calling trim_efuse API on ADC init in driver + * it will change the clock frequency, + * if we are not initialize the debug again + * it will print the garbage data in console output. + */ + DEBUGINIT(); +#endif if (!sc) { - app_log("MIC 2 Click is initialized.\n"); + app_printf("MIC 2 Click is initialized.\n"); } else { - app_log("Status code: %lx\n", sc); - app_log("MIC 2 Click initialization is failed!\n"); + app_printf("Status code: %lx\n", sc); + app_printf("MIC 2 Click initialization is failed!\n"); } mikroe_mic2_set_potentiometer(35); @@ -80,9 +135,9 @@ void app_process_action(void) sc = mikroe_mic2_generic_read(&adc_value); if (SL_STATUS_OK == sc) { db_value = (adc_value + 83.2073) / 11.003; - app_log("Sound intensity: %.2f dB.\n", db_value); + app_printf("Sound intensity: %.2f dB.\n", db_value); } else { - app_log("Reading the ADC value is failing.!\n"); + app_printf("Reading the ADC value is failing.!\n"); } } } diff --git a/app/example/mikroe_mic2/mikroe_mic2.slcp b/app/example/mikroe_mic2/mikroe_mic2.slcp index 502a1c5c..fb4f9eb4 100644 --- a/app/example/mikroe_mic2/mikroe_mic2.slcp +++ b/app/example/mikroe_mic2/mikroe_mic2.slcp @@ -45,15 +45,13 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_mic2/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_mic2/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_mic2/image/install_float.png - directory: "image" - path: ../../documentation/example/mikroe_mic2/image/software_layer.png directory: "image" - path: ../../documentation/example/mikroe_mic2/image/console_log.png @@ -62,4 +60,4 @@ other_file: ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_mic2/mikroe_mic2_si91x.slcp b/app/example/mikroe_mic2/mikroe_mic2_si91x.slcp new file mode 100644 index 00000000..cbeab761 --- /dev/null +++ b/app/example/mikroe_mic2/mikroe_mic2_si91x.slcp @@ -0,0 +1,68 @@ +project_name: mikroe_mic2_si91x +package: platform +label: Third Party Hardware Drivers - MIC 2 Click (Mikroe) +description: | + This example project shows an example for Mikroe MIC 2 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_mic2/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mic2 + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_mic2/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_mic2/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_mic2/image/software_layer.png + directory: "image" + - path: ../../documentation/example/mikroe_mic2/image/console_log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_microsd/app.c b/app/example/mikroe_microsd/app.c index 36aedc83..8efaec9f 100644 --- a/app/example/mikroe_microsd/app.c +++ b/app/example/mikroe_microsd/app.c @@ -34,18 +34,33 @@ * Silicon Labs may update projects from time to time. ******************************************************************************/ #include "string.h" - -#include "diskio.h" +#include "app_assert.h" +#include "sl_sleeptimer.h" #include "ff.h" - -#include "sl_spidrv_instances.h" +#include "diskio.h" #include "sl_sdc_sd_card.h" +#if (defined(SLI_SI917)) +#include "sl_si91x_gspi.h" +#include "rsi_debug.h" +#else +#include "sl_spidrv_instances.h" #include "app_log.h" -#include "app_assert.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif + +static mikroe_spi_handle_t app_spi_instance = NULL; #if !FF_FS_NORTC && !FF_FS_READONLY -#include "sl_sleeptimer.h" #endif static const char str[] = "Silabs SD Card I/O Example via SPI!\r\n"; @@ -82,16 +97,22 @@ void app_init(void) app_assert_status(sc); time_data = get_fattime(); - app_log("\nCurrent time is %lu/%lu/%lu %2lu:%02lu:%02lu.\n\n", - (time_data >> 25) + 1980, - (time_data >> 21) & 0x0f, - (time_data >> 16) & 0x1f, - (time_data >> 11) & 0x1f, - (time_data >> 5) & 0x3f, - (time_data << 1) & 0x1f); + app_printf("\nCurrent time is %lu/%lu/%lu %2lu:%02lu:%02lu.\n\n", + (time_data >> 25) + 1980, + (time_data >> 21) & 0x0f, + (time_data >> 16) & 0x1f, + (time_data >> 11) & 0x1f, + (time_data >> 5) & 0x3f, + (time_data << 1) & 0x1f); +#endif + +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; #endif - sd_card_spi_init(sl_spidrv_mikroe_handle); + sd_card_spi_init(app_spi_instance); // Give a work area to the default drive ret_code = f_mount(&fs, "", 0); @@ -100,27 +121,27 @@ void app_init(void) // Show logical drive status ret_code = f_getfree("", &fre_clust, &pfs); app_assert_status(ret_code); - app_log("-------------- Volume status --------------\n\r"); - app_log(("FAT type = %s\nBytes/Cluster = %lu\nNumber of FATs = %u\n" - "Root DIR entries = %u\nSectors/FAT = %lu\n" - "Number of clusters = %lu\nVolume start (lba) = %lu\n" - "FAT start (lba) = %lu\nDIR start (lba,clustor) = %lu\n" - "Data start (lba) = %lu\n%lu KiB total disk space.\n" - "%lu KiB available.\n\n"), - fst[pfs->fs_type], - (DWORD)pfs->csize * 512, - pfs->n_fats, - pfs->n_rootdir, - pfs->fsize, - pfs->n_fatent - 2, - (DWORD)pfs->volbase, - (DWORD)pfs->fatbase, - (DWORD)pfs->dirbase, - (DWORD)pfs->database, - (pfs->n_fatent - 2) * (pfs->csize / 2), - fre_clust * (pfs->csize / 2)); - - app_log("-------- Open file to write and read again ---------\n\r"); + app_printf("-------------- Volume status --------------\n\r"); + app_printf(("FAT type = %s\nBytes/Cluster = %lu\nNumber of FATs = %u\n" + "Root DIR entries = %u\nSectors/FAT = %lu\n" + "Number of clusters = %lu\nVolume start (lba) = %lu\n" + "FAT start (lba) = %lu\nDIR start (lba,clustor) = %lu\n" + "Data start (lba) = %lu\n%lu KiB total disk space.\n" + "%lu KiB available.\n\n"), + fst[pfs->fs_type], + (DWORD)pfs->csize * 512, + pfs->n_fats, + pfs->n_rootdir, + pfs->fsize, + pfs->n_fatent - 2, + (DWORD)pfs->volbase, + (DWORD)pfs->fatbase, + (DWORD)pfs->dirbase, + (DWORD)pfs->database, + (pfs->n_fatent - 2) * (pfs->csize / 2), + fre_clust * (pfs->csize / 2)); + + app_printf("-------- Open file to write and read again ---------\n\r"); // Open file to write ret_code = f_open(&fil, "hello.txt", FA_OPEN_ALWAYS | FA_READ | FA_WRITE); app_assert_status(ret_code); @@ -128,7 +149,7 @@ void app_init(void) // Write a message ret_code = f_write(&fil, str, sizeof(str), &bw); app_assert_status(ret_code); - app_log("Write a message to SD card success! Byte writen = %d\n\r", bw); + app_printf("Write a message to SD card success! Byte writen = %d\n\r", bw); // Close file ret_code = f_close(&fil); @@ -141,8 +162,8 @@ void app_init(void) // Read back the content and print on the console ret_code = f_read(&fil, f_work, sizeof(f_work), &br); app_assert_status(ret_code); - app_log("Read a message from SD card success! Byte read = %d\n\r", br); - app_log("Content: %s", f_work); + app_printf("Read a message from SD card success! Byte read = %d\n\r", br); + app_printf("Content: %s", f_work); // Close file ret_code = f_close(&fil); diff --git a/app/example/mikroe_microsd/mikroe_microsd.slcp b/app/example/mikroe_microsd/mikroe_microsd.slcp index 27c470bc..d130227f 100644 --- a/app/example/mikroe_microsd/mikroe_microsd.slcp +++ b/app/example/mikroe_microsd/mikroe_microsd.slcp @@ -1,9 +1,9 @@ -# Silicon Labs Project Configuration Tools: slcp, v0, Component selection file. project_name: mikroe_microsd label: Third Party Hardware Drivers - microSD Click (Mikroe) description: | This example project shows an example for Mikroe microSD click board driver integration. category: Example|Platform + filter: - name: Device Type value: [SoC] @@ -13,15 +13,19 @@ filter: value: [Beginner] package: platform quality: evaluation + readme: - path: ../../documentation/example/mikroe_microsd/README.md + source: - path: app.c - path: main.c + include: - path: '' file_list: - path: app.h + component: - id: sl_system - id: device_init @@ -34,11 +38,13 @@ component: - id: mikroe_microsd from: third_party_hw_drivers - id: sleeptimer + define: - name: DEBUG_EFM + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_microsd/image/create_example.png directory: image @@ -48,6 +54,8 @@ other_file: directory: image - path: ../../documentation/example/mikroe_microsd/image/create_example.png directory: image + - path: ../../documentation/example/mikroe_microsd/image/fatfs_config.png + directory: image - path: ../../documentation/example/mikroe_microsd/image/mikrobus.png directory: image - path: ../../documentation/example/mikroe_microsd/image/structure_overview.png diff --git a/app/example/mikroe_microsd/mikroe_microsd_si91x.slcp b/app/example/mikroe_microsd/mikroe_microsd_si91x.slcp new file mode 100644 index 00000000..fbd40674 --- /dev/null +++ b/app/example/mikroe_microsd/mikroe_microsd_si91x.slcp @@ -0,0 +1,81 @@ +project_name: mikroe_microsd_si91x +label: Third Party Hardware Drivers - microSD Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe microSD click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_microsd/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: app_assert +- id: services_fatfs + from: third_party_hw_drivers +- id: mikroe_microsd + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_microsd/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/board.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/content_file.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/fatfs_config.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/mikrobus.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/structure_overview.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/system_overview.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/testing.png + directory: image + - path: ../../documentation/example/mikroe_microsd/image/workflow.png + directory: image + +configuration: +- name: SL_SLEEPTIMER_WALLCLOCK_CONFIG + value: '0' +- name: FF_FS_NORTC + value: '1' + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_nfc2_pn7150/app.c b/app/example/mikroe_nfc2_pn7150/app.c index 6b0d8477..c4402fac 100644 --- a/app/example/mikroe_nfc2_pn7150/app.c +++ b/app/example/mikroe_nfc2_pn7150/app.c @@ -3,27 +3,63 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#include "app_log.h" #include "mikroe_pn7150.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 + +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" + +#define app_printf(...) app_log(__VA_ARGS__) +#endif + #define NFC2_IRQ_STATE_LOW 0 #define NFC2_IRQ_STATE_HIGH 1 +static mikroe_i2c_handle_t app_i2c_instance = NULL; + static mikroe_pn7150_control_packet_t ctrl_pck_data; /** @@ -52,19 +88,25 @@ static void test_antenna(mikroe_pn7150_control_packet_t *ctrl_pck); void app_init(void) { - app_log(" Application Init "); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + app_printf(" Application Init "); - if (SL_STATUS_OK != mikroe_pn7150_init(sl_i2cspm_mikroe)) { - app_log("> PN7150 - NFC 2 Click board driver init failed.\n"); + if (SL_STATUS_OK != mikroe_pn7150_init(app_i2c_instance)) { + app_printf("> PN7150 - NFC 2 Click board driver init failed.\n"); } sl_sleeptimer_delay_millisecond(100); - app_log(" HW Reset \r\n"); + app_printf(" HW Reset \r\n"); mikroe_pn7150_hw_reset(); sl_sleeptimer_delay_millisecond(100); - app_log("-----------------------\r\n"); - app_log(" Reset and Init. Core \r\n"); + app_printf("-----------------------\r\n"); + app_printf(" Reset and Init. Core \r\n"); mikroe_pn7150_cmd_core_reset(); sl_sleeptimer_delay_millisecond(100); @@ -80,8 +122,8 @@ void app_init(void) while (mikroe_pn7150_check_irq() == NFC2_IRQ_STATE_HIGH) {} - app_log("-----------------------\r\n"); - app_log(" Disabling Standby Mode \r\n"); + app_printf("-----------------------\r\n"); + app_printf(" Disabling Standby Mode \r\n"); mikroe_pn7150_cmd_disable_standby_mode(); sl_sleeptimer_delay_millisecond(100); @@ -91,8 +133,8 @@ void app_init(void) test_antenna(&ctrl_pck_data); - app_log("-----------------------\r\n"); - app_log("Starting Test Procedure\r\n"); + app_printf("-----------------------\r\n"); + app_printf("Starting Test Procedure\r\n"); mikroe_pn7150_cmd_test_procedure(); sl_sleeptimer_delay_millisecond(100); @@ -103,12 +145,12 @@ void app_init(void) mikroe_pn7150_hw_reset(); sl_sleeptimer_delay_millisecond(100); - app_log("-----------------------\r\n"); - app_log(" NFC Config. \r\n"); + app_printf("-----------------------\r\n"); + app_printf(" NFC Config. \r\n"); mikroe_pn7150_default_cfg(&ctrl_pck_data); - app_log("-----------------------\r\n"); - app_log(" Discovery Start \r\n"); + app_printf("-----------------------\r\n"); + app_printf(" Discovery Start \r\n"); mikroe_pn7150_cmd_start_discovery(); sl_sleeptimer_delay_millisecond(100); @@ -116,12 +158,12 @@ void app_init(void) sl_sleeptimer_delay_millisecond(100); display_packet(&ctrl_pck_data); - app_log("-----------------------\r\n"); - app_log("-------- START --------\r\n"); - app_log("-----------------------\r\n"); + app_printf("-----------------------\r\n"); + app_printf("-------- START --------\r\n"); + app_printf("-----------------------\r\n"); sl_sleeptimer_delay_millisecond(500); - app_log(" Application Task "); + app_printf(" Application Task "); } /***************************************************************************//** @@ -135,41 +177,41 @@ void app_process_action(void) while (mikroe_pn7150_check_irq() == NFC2_IRQ_STATE_LOW) {} - app_log("-----------------------\r\n"); + app_printf("-----------------------\r\n"); sl_sleeptimer_delay_millisecond(1000); } static void display_packet(mikroe_pn7150_control_packet_t *ctrl_pck) { - app_log("- - - - - - - - - - - -\r\n"); - app_log(" Message Type = %d\r\n", ( uint16_t ) ctrl_pck->message_type); - app_log(" Pck Bound Flag = %d\r\n", ( uint16_t ) ctrl_pck->pck_bound_flag); - app_log(" Group Ident = %d\r\n", ( uint16_t ) ctrl_pck->group_ident); - app_log(" Opcode Ident = %d\r\n", ( uint16_t ) ctrl_pck->opcode_ident); - app_log(" Payload Length = %d\r\n", ( uint16_t ) ctrl_pck->payload_length); - app_log("- - - - - - - - - - - -\r\n"); + app_printf("- - - - - - - - - - - -\r\n"); + app_printf(" Message Type = %d\r\n", ( uint16_t ) ctrl_pck->message_type); + app_printf(" Pck Bound Flag = %d\r\n", ( uint16_t ) ctrl_pck->pck_bound_flag); + app_printf(" Group Ident = %d\r\n", ( uint16_t ) ctrl_pck->group_ident); + app_printf(" Opcode Ident = %d\r\n", ( uint16_t ) ctrl_pck->opcode_ident); + app_printf(" Payload Length = %d\r\n", ( uint16_t ) ctrl_pck->payload_length); + app_printf("- - - - - - - - - - - -\r\n"); for (uint8_t n_cnt = 0; n_cnt < ctrl_pck_data.payload_length; n_cnt++) { - app_log(" Payload[ %.2d ] = 0x%.2X\r\n", ( uint16_t ) n_cnt, - ( uint16_t ) ( uint16_t ) ctrl_pck_data.payload[n_cnt]); + app_printf(" Payload[ %.2d ] = 0x%.2X\r\n", ( uint16_t ) n_cnt, + ( uint16_t ) ( uint16_t ) ctrl_pck_data.payload[n_cnt]); } - app_log("- - - - - - - - - - - -\r\n"); + app_printf("- - - - - - - - - - - -\r\n"); memset(ctrl_pck_data.payload, 0x00, 255); } static void display_nfc_data(mikroe_pn7150_control_packet_t *ctrl_pck) { - app_log("- - - - - - - - - - - -\r\n"); - app_log(" Read Block:\r\n"); + app_printf("- - - - - - - - - - - -\r\n"); + app_printf(" Read Block:\r\n"); for (uint8_t n_cnt = 1; n_cnt < ctrl_pck->payload_length - 2; n_cnt++) { - app_log("\t 0x%.2X \r\n", ( uint16_t ) ctrl_pck->payload[n_cnt]); + app_printf("\t 0x%.2X \r\n", ( uint16_t ) ctrl_pck->payload[n_cnt]); } - app_log("\t 0x%.2X \r\n", - ( uint16_t ) ctrl_pck->payload[ctrl_pck->payload_length - 2]); + app_printf("\t 0x%.2X \r\n", + ( uint16_t ) ctrl_pck->payload[ctrl_pck->payload_length - 2]); - app_log("- - - - - - - - - - - -\r\n"); + app_printf("- - - - - - - - - - - -\r\n"); memset(ctrl_pck->payload, 0x00, 255); } @@ -177,7 +219,7 @@ static void read_nfc_data(mikroe_pn7150_control_packet_t *ctrl_pck) { mikroe_pn7150_read_ctrl_packet_data(ctrl_pck); display_nfc_data(ctrl_pck); - app_log(" Disconnect Card \r\n"); + app_printf(" Disconnect Card \r\n"); mikroe_pn7150_cmd_card_disconnected(); sl_sleeptimer_delay_millisecond(10); mikroe_pn7150_read_ctrl_packet_data(ctrl_pck); @@ -191,8 +233,8 @@ static void read_nfc_data(mikroe_pn7150_control_packet_t *ctrl_pck) static void test_antenna(mikroe_pn7150_control_packet_t *ctrl_pck) { - app_log("-----------------------\r\n"); - app_log(" Testing Antenna "); + app_printf("-----------------------\r\n"); + app_printf(" Testing Antenna "); mikroe_pn7150_cmd_antenna_test(0x01); sl_sleeptimer_delay_millisecond(100); diff --git a/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp b/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp index 0fc8b525..78bb7814 100644 --- a/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp +++ b/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150.slcp @@ -1,8 +1,11 @@ project_name: mikroe_nfc2_pn7150 +package: platform label: Third Party Hardware Drivers - PN7150 - NFC 2 Click (Mikroe) - I2C description: | This example project shows an example for PN7150 - NFC 2 Click board driver integration on I2C communication. category: Example|Platform +quality: evaluation + filter: - name: Device Type value: [SoC] @@ -10,17 +13,19 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] -package: platform -quality: evaluation + readme: - path: ../../documentation/example/mikroe_nfc2_pn7150/README.md + source: - path: app.c - path: main.c + include: - path: '' file_list: - path: app.h + component: - id: sl_system - id: device_init @@ -32,11 +37,14 @@ component: - id: app_log - id: mikroe_nfc2 from: third_party_hw_drivers + define: - name: DEBUG_EFM + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 + other_file: - path: ../../documentation/example/mikroe_nfc2_pn7150/image/hardware_connection.png directory: image @@ -44,7 +52,8 @@ other_file: directory: image - path: ../../documentation/example/mikroe_nfc2_pn7150/image/log.png directory: image + ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150_si91x.slcp b/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150_si91x.slcp new file mode 100644 index 00000000..000428fa --- /dev/null +++ b/app/example/mikroe_nfc2_pn7150/mikroe_nfc2_pn7150_si91x.slcp @@ -0,0 +1,64 @@ +project_name: mikroe_nfc2_pn7150 +package: platform +label: Third Party Hardware Drivers - PN7150 - NFC 2 Click (Mikroe) - I2C +description: | + This example project shows an example for PN7150 - NFC 2 Click board driver integration on I2C communication. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_nfc2_pn7150/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: mikroe_nfc2 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_nfc2_pn7150/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_nfc2_pn7150/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_nfc2_pn7150/image/log.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_read/app.c b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/app.c index ec6af9e9..6d45e56b 100644 --- a/app/example/mikroe_nfc2_pn7150_nci_t2t_read/app.c +++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/app.c @@ -3,22 +3,40 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#include "gpiointerrupt.h" -#include "app_log.h" #include "app_assert.h" #include "t2t.h" @@ -28,10 +46,29 @@ #include "mikroe_pn7150_config.h" #include "mikroe_pn7150.h" +#if (defined(SLI_SI917)) +#include "sl_driver_gpio.h" +#include "sl_i2c_instances.h" +#include "rsi_debug.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 +#define GPIO_M4_INTR 0 // M4 Pin interrupt number +#define AVL_INTR_NO 0 // available interrupt number + +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#else +#include "sl_i2cspm_instances.h" +#include "gpiointerrupt.h" +#include "app_log.h" + +#define app_printf(...) app_log(__VA_ARGS__) +#endif + static uint16_t read_index = 0; static uint16_t t2t_area_size = 0; - static uint8_t data_buff[16]; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_int_callback(uint8_t intNo); @@ -68,29 +105,47 @@ static void app_int_callback(uint8_t intNo); ******************************************************************************/ void app_init(void) { +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + // Initialize PN71x0 I2C communication. - if (SL_STATUS_OK != mikroe_pn7150_init(sl_i2cspm_mikroe)) { - app_log("> PN7150 - NFC 2 Click board driver init failed.\n"); + if (SL_STATUS_OK != mikroe_pn7150_init(app_i2c_instance)) { + app_printf("> PN7150 - NFC 2 Click board driver init failed.\n"); } +#if (defined(SLI_SI917)) + sl_gpio_t gpio_port_pin = { + MIKROE_PN7150_INT_PIN / 16, + MIKROE_PN7150_INT_PIN % 16 + }; + sl_gpio_driver_configure_interrupt(&gpio_port_pin, + GPIO_M4_INTR, + SL_GPIO_INTERRUPT_RISING_EDGE, + (void *)&app_int_callback, + AVL_INTR_NO); +#else GPIO_ExtIntConfig(MIKROE_PN7150_INT_PORT, MIKROE_PN7150_INT_PIN, MIKROE_PN7150_INT_PIN, - 1, - 0, - 1); + true, + false, + true); GPIOINT_CallbackRegister(MIKROE_PN7150_INT_PIN, app_int_callback); - GPIO_IntEnable(MIKROE_PN7150_INT_PIN); - app_log(" HW Reset \r\n"); +#endif + + app_printf(" HW Reset \r\n"); mikroe_pn7150_hw_reset(); // Initialize NCI. nci_init(); // Print project name. - app_log("\r\n******************************\r\n*\r\n"); - app_log("* NCI T2T Read Demo\r\n"); - app_log("*\r\n******************************\r\n"); + app_printf("\r\n******************************\r\n*\r\n"); + app_printf("* NCI T2T Read Demo\r\n"); + app_printf("*\r\n******************************\r\n"); } /***************************************************************************//** @@ -136,9 +191,9 @@ void app_process_action(void) = nci_evt->data.payload.nci_data.core_reset_rsp.config_status; /* Log NCI version of NFCC. */ - app_log("NFCC's NCI Version is %x.%x \r\n", - ((nci_version & 0xF0) >> 4), - (nci_version & 0x0F)); + app_printf("NFCC's NCI Version is %x.%x \r\n", + ((nci_version & 0xF0) >> 4), + (nci_version & 0x0F)); /* Log configuration status. */ if (config_status == nci_core_reset_keep_config) { @@ -161,9 +216,9 @@ void app_process_action(void) uint8_t *manu_spec_info = nci_evt->data.payload.nci_data.core_init_rsp.manu_spec_info; - app_log("NFCC's Firmware Version is %02x.%02x\r\n", - manu_spec_info[2], - manu_spec_info[3]); + app_printf("NFCC's Firmware Version is %02x.%02x\r\n", + manu_spec_info[2], + manu_spec_info[3]); /* Activate NXP proprietary extensions, * send command and check for error. @@ -253,25 +308,25 @@ void app_process_action(void) t2t_area_size = data_buff[14] * 2; /* Print header area. */ - app_log("\r\nHeader: \r\nBlock 000 "); + app_printf("\r\nHeader: \r\nBlock 000 "); serial_put_hex_and_ascii(&data_buff[0], 4); - app_log("\r\nBlock 001 "); + app_printf("\r\nBlock 001 "); serial_put_hex_and_ascii(&data_buff[4], 4); - app_log("\r\nBlock 002 "); + app_printf("\r\nBlock 002 "); serial_put_hex_and_ascii(&data_buff[8], 4); - app_log("\r\nBlock 003 "); + app_printf("\r\nBlock 003 "); serial_put_hex_and_ascii(&data_buff[12], 4); - app_log("\r\n\r\nT2T Area (Size: %d blocks): \r\n", t2t_area_size); + app_printf("\r\n\r\nT2T Area (Size: %d blocks): \r\n", t2t_area_size); } else if (((4 + t2t_area_size) - read_index) == 2) { - app_log("Block %03u to %03u ", read_index, (read_index + 1)); + app_printf("Block %03u to %03u ", read_index, (read_index + 1)); serial_put_hex(data_buff, 8); - app_log(" -- -- -- -- -- -- -- -- "); + app_printf(" -- -- -- -- -- -- -- -- "); serial_put_ascii(data_buff, 8); - app_log("\r\n"); + app_printf("\r\n"); } else { - app_log("Block %03u to %03u ", read_index, (read_index + 3)); + app_printf("Block %03u to %03u ", read_index, (read_index + 3)); serial_put_hex_and_ascii(data_buff, 16); - app_log("\r\n"); + app_printf("\r\n"); } read_index += 4; diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp index 12603637..282c1262 100644 --- a/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp +++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read.slcp @@ -1,8 +1,11 @@ project_name: pn7150_nci_t2t_read label: Third Party Hardware Drivers - PN7150 - Read a T2T Tag with NCI +package: platform description: | This example project demonstrates the interface of the NFC NCI service by using the NFC controller PN7150 to read a T2T Tag. category: Example|Platform +quality: evaluation + filter: - name: Device Type value: [SoC] @@ -10,8 +13,6 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] -package: platform -quality: evaluation readme: - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/README.md @@ -48,7 +49,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/hardware_connection.png @@ -57,7 +58,8 @@ other_file: directory: image - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/log.png directory: image + ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read_si91x.slcp b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read_si91x.slcp new file mode 100644 index 00000000..2d3ed84a --- /dev/null +++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_read/pn7150_nci_t2t_read_si91x.slcp @@ -0,0 +1,69 @@ +project_name: pn7150_nci_t2t_read +label: Third Party Hardware Drivers - PN7150 - Read a T2T Tag with NCI +package: platform +description: | + This example project demonstrates the interface of the NFC NCI service by using the NFC controller PN7150 to read a T2T Tag. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: services_nfc_tag + from: third_party_hw_drivers +- id: services_nfc_nci + from: third_party_hw_drivers +- id: mikroe_nfc2 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_read/image/log.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_write/app.c b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/app.c index 3658d82f..4e10b932 100644 --- a/app/example/mikroe_nfc2_pn7150_nci_t2t_write/app.c +++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/app.c @@ -3,22 +3,40 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#include "gpiointerrupt.h" -#include "app_log.h" #include "app_assert.h" #include "t2t.h" @@ -29,6 +47,27 @@ #include "mikroe_pn7150_config.h" #include "mikroe_pn7150.h" +#if (defined(SLI_SI917)) +#include "sl_driver_gpio.h" +#include "sl_i2c_instances.h" +#include "rsi_debug.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 +#define GPIO_M4_INTR 0 // M4 Pin interrupt number +#define AVL_INTR_NO 0 // available interrupt number + +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#else +#include "sl_i2cspm_instances.h" +#include "gpiointerrupt.h" +#include "app_log.h" + +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +static mikroe_i2c_handle_t app_i2c_instance = NULL; + static void app_int_callback(uint8_t intNo); /* @@ -92,31 +131,49 @@ uint32_t write_size; ******************************************************************************/ void app_init(void) { +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + // Initialize PN71x0 I2C communication. - if (SL_STATUS_OK != mikroe_pn7150_init(sl_i2cspm_mikroe)) { - app_log("> PN7150 - NFC 2 Click board driver init failed.\n"); + if (SL_STATUS_OK != mikroe_pn7150_init(app_i2c_instance)) { + app_printf("> PN7150 - NFC 2 Click board driver init failed.\n"); } +#if (defined(SLI_SI917)) + sl_gpio_t gpio_port_pin = { + MIKROE_PN7150_INT_PIN / 16, + MIKROE_PN7150_INT_PIN % 16 + }; + sl_gpio_driver_configure_interrupt(&gpio_port_pin, + GPIO_M4_INTR, + SL_GPIO_INTERRUPT_RISING_EDGE, + (void *)&app_int_callback, + AVL_INTR_NO); +#else GPIO_ExtIntConfig(MIKROE_PN7150_INT_PORT, MIKROE_PN7150_INT_PIN, MIKROE_PN7150_INT_PIN, - 1, - 0, - 1); + true, + false, + true); GPIOINT_CallbackRegister(MIKROE_PN7150_INT_PIN, app_int_callback); - GPIO_IntEnable(MIKROE_PN7150_INT_PIN); - app_log(" HW Reset \r\n"); +#endif + + app_printf(" HW Reset \r\n"); mikroe_pn7150_hw_reset(); // Initialize NCI. nci_init(); /* Print project name. */ - app_log("\r\n******************************\r\n*\r\n"); - app_log("* NCI T2T Write Demo\r\n"); - app_log("*\r\n******************************\r\n"); + app_printf("\r\n******************************\r\n*\r\n"); + app_printf("* NCI T2T Write Demo\r\n"); + app_printf("*\r\n******************************\r\n"); - app_log("Write content: %s\r\n", content); + app_printf("Write content: %s\r\n", content); record.payload = payload; // prefix + content @@ -133,7 +190,7 @@ void app_init(void) ndef_message_encode_result = ndef_message_encode(ndef_message_buff, ndef_message); if (ndef_message_encode_result.err == ndefMessageEncodeFail) { - app_log("NDEF message encode failed:(\r\n"); + app_printf("NDEF message encode failed:(\r\n"); return; } @@ -146,7 +203,7 @@ void app_init(void) ndef_message_encode_result.size, // L ndef_message_buff // V ) != tlvEncodeCompleted) { - app_log("NDEF TLV encode failed:(\r\n"); + app_printf("NDEF TLV encode failed:(\r\n"); return; } @@ -158,7 +215,7 @@ void app_init(void) 0, // L NULL // V ) != tlvEncodeCompleted) { - app_log("Terminator TLV encode failed:(\r\n"); + app_printf("Terminator TLV encode failed:(\r\n"); return; } @@ -208,9 +265,9 @@ void app_process_action(void) nci_evt->data.payload.nci_data.core_reset_rsp.config_status; /* Log NCI version of NFCC. */ - app_log("NFCC's NCI Version is %x.%x\r\n", - ((nci_version & 0xF0) >> 4), - (nci_version & 0x0F)); + app_printf("NFCC's NCI Version is %x.%x\r\n", + ((nci_version & 0xF0) >> 4), + (nci_version & 0x0F)); /* Log configuration status. */ if (config_status == nci_core_reset_keep_config) { @@ -234,9 +291,9 @@ void app_process_action(void) uint8_t *manu_spec_info = nci_evt->data.payload.nci_data.core_init_rsp.manu_spec_info; - app_log("NFCC's Firmware Version is %02x.%02x\r\n", - manu_spec_info[2], - manu_spec_info[3]); + app_printf("NFCC's Firmware Version is %02x.%02x\r\n", + manu_spec_info[2], + manu_spec_info[3]); /* Activate NXP proprietary extensions, * send command and check for error. @@ -328,7 +385,7 @@ void app_process_action(void) case nci_evt_data_packet_rec: { if (nci_evt->data.payload.nci_data.rec_data_packet.payload[0] != T2T_RSP_ACK) { - app_log("T2T Write NACK response. \r\n"); + app_printf("T2T Write NACK response. \r\n"); } write_index++; @@ -359,7 +416,7 @@ void app_process_action(void) }; nci_data_packet_send(&pakcet); } else { - app_log("T2T write completed.\r\n"); + app_printf("T2T write completed.\r\n"); write_index = 0; nci_rf_deactivate_cmd_t cmd = { .deactivate_type = nci_rf_deact_type_discovery_mode diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp index 2bf58c26..f23c0687 100644 --- a/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp +++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write.slcp @@ -1,8 +1,11 @@ project_name: pn7150_nci_t2t_write label: Third Party Hardware Drivers - PN7150 - Write to a T2T Tag with NCI +package: platform description: | This example project demonstrates the interface of the NFC NCI service by the NFC controller PN7150 to write to a T2T Tag. category: Example|Platform +quality: evaluation + filter: - name: Device Type value: [SoC] @@ -10,8 +13,6 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] -package: platform -quality: evaluation readme: - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/README.md @@ -50,7 +51,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/hardware_connection.png @@ -59,7 +60,8 @@ other_file: directory: image - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/log.png directory: image + ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write_si91x.slcp b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write_si91x.slcp new file mode 100644 index 00000000..059e9a7f --- /dev/null +++ b/app/example/mikroe_nfc2_pn7150_nci_t2t_write/pn7150_nci_t2t_write_si91x.slcp @@ -0,0 +1,71 @@ +project_name: pn7150_nci_t2t_write +label: Third Party Hardware Drivers - PN7150 - Write to a T2T Tag with NCI +package: platform +description: | + This example project demonstrates the interface of the NFC NCI service by the NFC controller PN7150 to write to a T2T Tag. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: services_nfc_tag + from: third_party_hw_drivers +- id: services_nfc_nci + from: third_party_hw_drivers +- id: services_nfc_ndef + from: third_party_hw_drivers +- id: mikroe_nfc2 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_nfc2_pn7150_nci_t2t_write/image/log.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_nfctag2_nt3h2111/app.c b/app/example/mikroe_nfctag2_nt3h2111/app.c index 3c58230f..e288b05f 100644 --- a/app/example/mikroe_nfctag2_nt3h2111/app.c +++ b/app/example/mikroe_nfctag2_nt3h2111/app.c @@ -3,25 +3,55 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include +#include "mikroe_nt3h2111.h" +#include "sl_sleeptimer.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_i2c_instances.h" +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#else /* None Si91x device */ #include "sl_i2cspm_instances.h" #include "app_log.h" -#include "sl_sleeptimer.h" -#include "mikroe_nt3h2111.h" #include "sl_iostream.h" - -sl_iostream_t *default_iostream; +#define app_printf(...) app_log(__VA_ARGS__) +static sl_iostream_t *default_iostream = NULL; +#endif // #define NTAG_I2C_BLOCK_SIZE 16 @@ -79,28 +109,36 @@ static sl_status_t test_read_session(void); static sl_status_t test_write_session(void); static uint8_t read_input (void); +static mikroe_i2c_handle_t app_i2c_instance = NULL; + /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { - /* Initialize NT3H2111 I2C communication. */ - nt3h2111_init(sl_i2cspm_mikroe); - +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; default_iostream = sl_iostream_get_default(); +#endif + + /* Initialize NT3H2111 I2C communication. */ + nt3h2111_init(app_i2c_instance); /* Print project name. */ - app_log( + app_printf( "\r\n*********************************************************\r\n*\r\n"); - app_log("* Third Party Hardware Drivers - NT3H2111 - NFC Tag 2 Click\r\n"); - app_log("*\r\n*********************************************************\r\n"); - app_log("*\r\n* Give a input, your input should be between 0 and 4.\r\n"); - app_log("* Press enter when you finish.\r\n"); - app_log("*\r\n* 0. Factory reset Tag\r\n"); - app_log("*\r\n* 1. Read the session registers\r\n"); - app_log("*\r\n* 2. Write the session registers\r\n"); - app_log("*\r\n* 3. Write Tag\r\n"); - app_log("*\r\n* 4. Read Tag\r\n"); + app_printf("* Third Party Hardware Drivers - NT3H2111 - NFC Tag 2 Click\r\n"); + app_printf( + "*\r\n*********************************************************\r\n"); + app_printf("*\r\n* Give a input, your input should be between 0 and 4.\r\n"); + app_printf("* Press enter when you finish.\r\n"); + app_printf("*\r\n* 0. Factory reset Tag\r\n"); + app_printf("*\r\n* 1. Read the session registers\r\n"); + app_printf("*\r\n* 2. Write the session registers\r\n"); + app_printf("*\r\n* 3. Write Tag\r\n"); + app_printf("*\r\n* 4. Read Tag\r\n"); } /***************************************************************************//** @@ -111,69 +149,72 @@ void app_process_action(void) sl_status_t stt; uint8_t input_cmd = 0; - app_log("\r\nGive a your number, press enter when you finish: "); - app_log("\r\n>"); + app_printf("\r\nGive a your number, press enter when you finish: "); + app_printf("\r\n>"); + input_cmd = read_input(); + switch (input_cmd) { case 0: - app_log("Start to reset the memory to its default values\r\n"); + app_printf("Start to reset the memory to its default values\r\n"); stt = factory_reset_tag(); if (stt == SL_STATUS_OK) { - app_log("Reset successful!\r\n"); + app_printf("Reset successful!\r\n"); } else { - app_log("Reseting Failed with Err = 0x%lx\r\n", stt); + app_printf("Reseting Failed with Err = 0x%lx\r\n", stt); } break; case 1: - app_log("Start reading the content of Session Watchdog Timer\r\n"); + app_printf("Start reading the content of Session Watchdog Timer\r\n"); stt = test_read_session(); if (stt == SL_STATUS_OK) { - app_log("Current Watchdog Timer = %d\r\n", wdt_timer); + app_printf("Current Watchdog Timer = %d\r\n", wdt_timer); } else { - app_log("Read Watchdog Timer Failed with Err = 0x%lx\r\n", stt); + app_printf("Read Watchdog Timer Failed with Err = 0x%lx\r\n", stt); } break; case 2: - app_log("Start writing new value to the Session Watchdog Timer\r\n"); + app_printf("Start writing new value to the Session Watchdog Timer\r\n"); stt = test_write_session(); if (stt == SL_STATUS_OK) { - app_log("Wrote successful Watchdog Timer to new value = %d\r\n", - wdt_timer); + app_printf("Wrote successful Watchdog Timer to new value = %d\r\n", + wdt_timer); } else { - app_log("Set Watchdog Timer Failed with Err = 0x%lx\r\n", stt); + app_printf("Set Watchdog Timer Failed with Err = 0x%lx\r\n", stt); } break; case 3: // Write an NDEF message into NT3H2111 EEPROM. - app_log("Start writing an NDEF message into NT3H2111 EEPROM\r\n"); + app_printf("Start writing an NDEF message into NT3H2111 EEPROM\r\n"); stt = nt3h2111_write_bytes(16, ndef_rec, sizeof(ndef_rec)); if (stt == SL_STATUS_OK) { - app_log("Write Tag successful\r\n"); + app_printf("Write Tag successful\r\n"); } else { - app_log("Writing Tag failed with Err = 0x%lx\r\n", stt); + app_printf("Writing Tag failed with Err = 0x%lx\r\n", stt); } break; case 4: { uint8_t buff[32]; - app_log("Start reading from NT3H2111 EEPROM\r\n"); + app_printf("Start reading from NT3H2111 EEPROM\r\n"); stt = nt3h2111_read_bytes(16, buff, 32); if (stt == SL_STATUS_OK) { - app_log("Read Tag successful!\r\n"); + app_printf("Read Tag successful!\r\n"); for (int i = 0; i < 8; i++) { - app_log(" 0x%02x, 0x%02x, 0x%02x, 0x%02x\r\n", - buff[4 * i], - buff[4 * i + 1], - buff[4 * i + 2], - buff[4 * i + 3]); + app_printf(" 0x%02x, 0x%02x, 0x%02x, 0x%02x\r\n", + buff[4 * i], + buff[4 * i + 1], + buff[4 * i + 2], + buff[4 * i + 3]); } } else { - app_log("Read failed with Err = 0x%lx\r\n", stt); + app_printf("Read failed with Err = 0x%lx\r\n", stt); } } break; } - app_log("*\r\n*********************************************************\r\n"); + app_printf( + "*\r\n*********************************************************\r\n"); } /* @@ -258,29 +299,34 @@ static uint8_t read_input(void) uint8_t size_len = 0; while (1) { +#if (defined(SLI_SI917)) + char_buff = DEBUGIN(); + bytes_read = 1; +#else sl_iostream_read(default_iostream, &char_buff, 1, &bytes_read); +#endif if (bytes_read > 0) { if ((char_buff >= '0') && (char_buff <= '4')) { if (size_len < 1) { input_cmd = char_buff - '0'; size_len++; - app_log("%c", char_buff); + app_printf("%c", char_buff); } else { - app_log( + app_printf( "\r\ntoo many digits. Please input a number between 0 and 4, press ENTER when you finish:"); size_len = 0; } } else if (char_buff == '\r') { if (size_len == 0) { - app_log( + app_printf( "\r\nPlease input a number between 0 and 9, press ENTER when you finish: "); continue; } - app_log("\r\n"); + app_printf("\r\n"); break; } else { - app_log( + app_printf( "\r\nInvalid character. Please input a number between 0 and 4, press ENTER when you finish: "); size_len = 0; } diff --git a/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp b/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp index 35ce7cf0..ae2fc5c6 100644 --- a/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp +++ b/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111.slcp @@ -35,7 +35,7 @@ define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_nfctag2_nt3h2111/image/hardware_connection.png directory: image diff --git a/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111_si91x.slcp b/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111_si91x.slcp new file mode 100644 index 00000000..bed6dabd --- /dev/null +++ b/app/example/mikroe_nfctag2_nt3h2111/mikroe_nfctag2_nt3h2111_si91x.slcp @@ -0,0 +1,60 @@ +project_name: mikroe_nfctag2_nt3h2111 +label: Third Party Hardware Drivers - NT3H2111 - NFC Tag 2 Click (Mikroe) - I2C +description: | + This example project shows an example for NT3H2111 - NFC Tag 2 Click board driver integration on I2C communication. +category: Example|Platform +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] +package: platform +quality: evaluation +readme: +- path: ../../documentation/example/mikroe_nfctag2_nt3h2111/README.md +source: +- path: app.c +- path: main.c +include: +- path: '' + file_list: + - path: app.h +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: mikroe_nfctag2 + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_nfctag2_nt3h2111/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_nfctag2_nt3h2111/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_nfctag2_nt3h2111/image/log.png + directory: image + - path: ../../documentation/example/mikroe_nfctag2_nt3h2111/image/nfc_tools.png + directory: image +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_obdii_stn1110/app.c b/app/example/mikroe_obdii_stn1110/app.c index 6a946361..c31d9a10 100644 --- a/app/example/mikroe_obdii_stn1110/app.c +++ b/app/example/mikroe_obdii_stn1110/app.c @@ -3,45 +3,78 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ #include #include - #include "sl_status.h" +#include "app_assert.h" #include "sl_sleeptimer.h" +#include "mikroe_stn1110.h" + +#if (defined(SLI_SI917)) +#include "sl_si91x_usart.h" +#include "rsi_debug.h" +#else #include "sl_iostream_init_usart_instances.h" #include "sl_iostream_init_eusart_instances.h" - #include "app_log.h" -#include "app_assert.h" +#endif -#include "mikroe_stn1110.h" +#define PROCESS_BUFFER_SIZE 200 +#define READING_INTERVAL_MSEC 1000 + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define USART_INSTANCE_USED UART_1 +static usart_peripheral_t uart_instance = USART_INSTANCE_USED; +#endif -#define PROCESS_BUFFER_SIZE 200 -#define READING_INTERVAL_MSEC 1000 +static int32_t app_buf_len = 0; +static uint8_t app_buf[PROCESS_BUFFER_SIZE] = { 0 }; static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; +mikroe_uart_handle_t app_uart_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); -static uint8_t app_buf[PROCESS_BUFFER_SIZE] = { 0 }; -static int32_t app_buf_len = 0; - /***************************************************************************//** * @brief * This function clears memory of application buffer and reset its length. @@ -83,11 +116,18 @@ void app_init(void) { sl_status_t ret_code; +#if (defined(SLI_SI917)) + app_uart_instance = &uart_instance; +#else + app_uart_instance = sl_iostream_uart_mikroe_handle; + + sl_iostream_set_default(sl_iostream_vcom_handle); app_log_iostream_set(sl_iostream_vcom_handle); +#endif - ret_code = mikroe_stn1110_init(sl_iostream_uart_mikroe_handle); + ret_code = mikroe_stn1110_init(app_uart_instance); app_assert_status(ret_code); - app_log("Mikroe OBDii Click is initialized.\r\n"); + app_printf("Mikroe OBDii Click is initialized.\r\n"); mikroe_stn1110_reset_device(); sl_sleeptimer_delay_millisecond(1000); @@ -95,18 +135,18 @@ void app_init(void) app_obdii_process(); app_obdii_clear_buf(); - app_log("> Reset device\r\n"); + app_printf("> Reset device\r\n"); mikroe_stn1110_send_command((uint8_t *)MIKROE_OBDII_CMD_RESET_DEVICE); app_obdii_rsp_check((uint8_t *)MIKROE_OBDII_RSP_PROMPT); app_obdii_log_buf(); sl_sleeptimer_delay_millisecond(1000); - app_log(" Disable echo\r\n"); + app_printf(" Disable echo\r\n"); mikroe_stn1110_send_command((uint8_t *)MIKROE_OBDII_CMD_DISABLE_ECHO); app_obdii_rsp_check((uint8_t *)MIKROE_OBDII_RSP_PROMPT); app_obdii_log_buf(); - app_log(" Remove spaces\r\n"); + app_printf(" Remove spaces\r\n"); mikroe_stn1110_send_command((uint8_t *)MIKROE_OBDII_CMD_SPACES_OFF); app_obdii_rsp_check((uint8_t *)MIKROE_OBDII_RSP_PROMPT); app_obdii_log_buf(); @@ -147,7 +187,7 @@ static void application_task(void) uint16_t rpm = 0; uint8_t speed = 0; - app_log(" Get current RPM\r\n"); + app_printf(" Get current RPM\r\n"); mikroe_stn1110_send_command((uint8_t *)MIKROE_OBDII_CMD_GET_CURRENT_RPM); app_obdii_rsp_check((uint8_t *)MIKROE_OBDII_RSP_PROMPT); start_ptr = (uint8_t *)strstr((const char *)app_buf, @@ -156,12 +196,12 @@ static void application_task(void) memcpy(data_buf, (start_ptr + 4), 4); data_buf[4] = 0; rpm = (uint16_t)strtol((const char *)data_buf, &ptr, 16) / 4; - app_log("RPM: %u\r\n\n>", rpm); + app_printf("RPM: %u\r\n\n>", rpm); } else { app_obdii_log_buf(); } - app_log(" Get current speed\r\n"); + app_printf(" Get current speed\r\n"); mikroe_stn1110_send_command((uint8_t *)MIKROE_OBDII_CMD_GET_CURRENT_SPEED); app_obdii_rsp_check((uint8_t *)MIKROE_OBDII_RSP_PROMPT); start_ptr = (uint8_t *)strstr((const char *)app_buf, @@ -170,7 +210,7 @@ static void application_task(void) memcpy(data_buf, (start_ptr + 4), 2); data_buf[2] = 0; speed = (uint8_t)strtol((const char *)data_buf, &ptr, 16); - app_log("Speed: %u km/h\r\n\n>", ( uint16_t ) speed); + app_printf("Speed: %u km/h\r\n\n>", ( uint16_t ) speed); } else { app_obdii_log_buf(); } @@ -207,7 +247,7 @@ static void app_obdii_log_buf(void) { for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ ) { - app_log("%c", app_buf[buf_cnt]); + app_printf("%c", app_buf[buf_cnt]); } } diff --git a/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp b/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp index 179246de..e750d5f8 100644 --- a/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp +++ b/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110.slcp @@ -44,7 +44,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_obdii_stn1110/image/hardware_connection.png diff --git a/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110_si91x.slcp b/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110_si91x.slcp new file mode 100644 index 00000000..a9d7702f --- /dev/null +++ b/app/example/mikroe_obdii_stn1110/mikroe_obdii_stn1110_si91x.slcp @@ -0,0 +1,63 @@ +project_name: mikroe_obdii_stn1110 +label: Third Party Hardware Drivers - STN1110 - OBDII Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe OBDII Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_obdii_stn1110/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: obdii_stn1110 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_obdii_stn1110/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_obdii_stn1110/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_obdii_stn1110/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_obdii_stn1110/image/sw_layers.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_oledc_ssd1351/app.c b/app/example/mikroe_oledc_ssd1351/app.c index f2ea648b..ebcbf117 100644 --- a/app/example/mikroe_oledc_ssd1351/app.c +++ b/app/example/mikroe_oledc_ssd1351/app.c @@ -3,26 +3,55 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "sl_spidrv_instances.h" -#include "sl_sleeptimer.h" - -#include "app_log.h" -#include "app_assert.h" - #include "mikroe_ssd1351_image.h" #include "mikroe_ssd1351.h" #include "glib.h" +#include "app_assert.h" +#include "sl_sleeptimer.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_gspi.h" +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#define app_printf(...) DEBUGOUT(__VA_ARGS__) + +#else /* None Si91x device */ +#include "sl_spidrv_instances.h" +#include "app_log.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define APP_STATE_DISPLAY_RECTANGLE 0 #define APP_STATE_DISPLAY_LINE 1 @@ -34,7 +63,7 @@ static glib_context_t glib_context; static volatile uint8_t state = APP_STATE_DISPLAY_RECTANGLE; static volatile bool timer_is_expire = false; static sl_sleeptimer_timer_handle_t app_timer_handle; - +mikroe_spi_handle_t app_spi_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); static void app_task(void); @@ -45,9 +74,15 @@ void app_init(void) { sl_status_t sc; - app_log("---- Application Init ----\r\n"); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + + app_printf("---- Application Init ----\r\n"); // Click initialization. - sc = mikroe_ssd1351_init(sl_spidrv_mikroe_handle); + sc = mikroe_ssd1351_init(app_spi_instance); app_assert_status(sc); glib_init(&glib_context); glib_set_bg_color(&glib_context, 0xFFFF); @@ -67,12 +102,12 @@ void app_init(void) glib_draw_string(&glib_context, "OLED C CLICK", 10, 65); glib_update_display(); - sl_sleeptimer_start_periodic_timer(&app_timer_handle, - TIMEOUT_MSEC, - app_timer_cb, - (void *) NULL, - 0, - 0); + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + TIMEOUT_MSEC, + app_timer_cb, + (void *) NULL, + 0, + 0); } /***************************************************************************//** diff --git a/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp b/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp index fd132172..a030e3dc 100644 --- a/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp +++ b/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351.slcp @@ -23,9 +23,8 @@ include: - path: app.h component: - id: sl_system +- id: sleeptimer - id: device_init -- id: spidrv - instance: [mikroe] - id: iostream_eusart instance: [vcom] - id: oledc_ssd1351 @@ -34,12 +33,12 @@ component: from: third_party_hw_drivers - id: app_log - id: app_assert -- id: sleeptimer + define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_oledc_ssd1351/image/hardware_connection.png directory: "image" @@ -50,4 +49,4 @@ other_file: ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351_si91x.slcp b/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351_si91x.slcp new file mode 100644 index 00000000..ae55500f --- /dev/null +++ b/app/example/mikroe_oledc_ssd1351/mikroe_oledc_ssd1351_si91x.slcp @@ -0,0 +1,57 @@ +project_name: mikroe_oledc_ssd1351_si91x +package: platform +label: Third Party Hardware Drivers - SSD1351 - OLED C Click Board (Mikroe) +description: | + This example project shows an example for Mikroe OLEDC Click driver integration. +category: Example|Platform +quality: evaluation +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] +readme: +- path: ../../documentation/example/mikroe_oledc_ssd1351/README.md +source: +- path: app.c +- path: main.c +include: +- path: '' + file_list: + - path: app.h +component: +- id: sleeptimer +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: oledc_ssd1351 + from: third_party_hw_drivers +- id: services_oled_glib + from: third_party_hw_drivers +- id: app_assert + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/mikroe_oledc_ssd1351/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_oledc_ssd1351/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_oledc_ssd1351/image/test.gif + directory: "image" +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp index b59122cb..1b814007 100644 --- a/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp +++ b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306.slcp @@ -43,14 +43,12 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_oledw_ssd1306/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png + - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_oledw_ssd1306/image/testing_result.gif directory: "image" diff --git a/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306_si91x.slcp b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306_si91x.slcp index 0e5d800e..a9d42c47 100644 --- a/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306_si91x.slcp +++ b/app/example/mikroe_oledw_ssd1306/mikroe_oledw_ssd1306_si91x.slcp @@ -1,8 +1,8 @@ project_name: mikroe_oledw_ssd1306_si91x package: platform -label: Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe) - Si91x +label: Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe) description: | - This example project shows an example for Mikroe OLEDW Click driver integration on Si91x. + This example project shows an example for Mikroe OLEDW Click driver integration. category: Example|Platform quality: evaluation @@ -40,16 +40,14 @@ component: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 other_file: - path: ../../documentation/example/mikroe_oledw_ssd1306/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example_2.png + - path: ../../documentation/example/mikroe_oledw_ssd1306/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_oledw_ssd1306/image/testing_result.gif directory: "image" diff --git a/app/example/mikroe_oledw_ssd1306_glib/app.c b/app/example/mikroe_oledw_ssd1306_glib/app.c index 4948c4a5..59d49005 100644 --- a/app/example/mikroe_oledw_ssd1306_glib/app.c +++ b/app/example/mikroe_oledw_ssd1306_glib/app.c @@ -3,29 +3,61 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "sl_simple_button_instances.h" -#include "sl_spidrv_instances.h" #include "glib.h" #include "glib_font.h" #include "mikroe_ssd1306.h" +#include "sl_sleeptimer.h" -static void oled_app_init(void); +#if (defined(SLI_SI917)) +#include "sl_si91x_gspi.h" +#include "sl_si91x_button_instances.h" +#else +#include "sl_simple_button_instances.h" +#include "sl_spidrv_instances.h" +#endif -static glib_context_t glib_context; #define DISPLAY_MODE_COUNT (15) + +#if (defined(SLI_SI917)) +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif + +static glib_context_t glib_context; static uint8_t display_mode = 0; +static mikroe_spi_handle_t app_spi_instance = NULL; static const unsigned char silicon_labs_logo_96x35[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -70,8 +102,19 @@ static const unsigned char silicon_labs_logo_96x35[] = { ******************************************************************************/ void app_init(void) { - /* Initialize the oled. */ - oled_app_init(); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + // Initialize the display + mikroe_ssd1306_init(app_spi_instance); + glib_init(&glib_context); + + // Fill lcd with background color + glib_clear(&glib_context); + + display_mode = 0; } /***************************************************************************//** @@ -240,27 +283,27 @@ void app_process_action(void) 96, 35, GLIB_WHITE); glib_update_display(); - sl_udelay_wait(500000); + sl_sleeptimer_delay_millisecond(500); glib_set_invert_color(); - sl_udelay_wait(500000); + sl_sleeptimer_delay_millisecond(500); glib_set_normal_color(); - sl_udelay_wait(500000); + sl_sleeptimer_delay_millisecond(500); glib_set_invert_color(); - sl_udelay_wait(500000); + sl_sleeptimer_delay_millisecond(500); glib_set_normal_color(); for (i = 0x8F; i > 0x00; i--) { glib_set_contrast(i); - sl_udelay_wait(5000); + sl_sleeptimer_delay_millisecond(5); } for (i = 0x00; i < 0x8F; i++) { glib_set_contrast(i); - sl_udelay_wait(5000); + sl_sleeptimer_delay_millisecond(5); } glib_scroll_right(0x00, 0x06); - sl_udelay_wait(1000000); + sl_sleeptimer_delay_millisecond(1000); glib_stop_scroll(); glib_draw_xbitmap(&glib_context, 0, 0, silicon_labs_logo_96x35, @@ -268,7 +311,7 @@ void app_process_action(void) glib_update_display(); glib_scroll_left(0x00, 0x06); - sl_udelay_wait(1000000); + sl_sleeptimer_delay_millisecond(1000); glib_stop_scroll(); glib_draw_xbitmap(&glib_context, 0, 0, silicon_labs_logo_96x35, @@ -276,7 +319,7 @@ void app_process_action(void) glib_update_display(); glib_scroll_diag_right(0x00, 0x06); - sl_udelay_wait(1000000); + sl_sleeptimer_delay_millisecond(1000); glib_stop_scroll(); glib_draw_xbitmap(&glib_context, 0, 0, silicon_labs_logo_96x35, @@ -284,7 +327,7 @@ void app_process_action(void) glib_update_display(); glib_scroll_diag_left(0x00, 0x06); - sl_udelay_wait(1000000); + sl_sleeptimer_delay_millisecond(1000); glib_stop_scroll(); break; } @@ -297,10 +340,17 @@ void app_process_action(void) * module. It is triggered when the user activates one of the buttons. * ******************************************************************************/ +#if (defined(SLI_SI917)) +void sl_si91x_button_isr(uint8_t pin, int8_t state) +{ + if (pin == button_btn0.pin) { + if (state == BUTTON_PRESSED) { +#else void sl_button_on_change(const sl_button_t *handle) { if (sl_button_get_state(handle) == SL_SIMPLE_BUTTON_PRESSED) { if (&sl_button_btn0 == handle) { +#endif if (display_mode < DISPLAY_MODE_COUNT) { display_mode++; } else { @@ -309,16 +359,3 @@ void sl_button_on_change(const sl_button_t *handle) } } } - -/***************************************************************************//** - * Initialize example. - ******************************************************************************/ -static void oled_app_init(void) -{ - /* Initialize the display */ - mikroe_ssd1306_init(sl_spidrv_mikroe_handle); - glib_init(&glib_context); - - /* Fill lcd with background color */ - glib_clear(&glib_context); -} diff --git a/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp b/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp index 90641618..30ee1c20 100644 --- a/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp +++ b/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib.slcp @@ -46,7 +46,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_oledw_ssd1306_glib/image/hardware_connection.png diff --git a/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib_si91x.slcp b/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib_si91x.slcp new file mode 100644 index 00000000..01292efe --- /dev/null +++ b/app/example/mikroe_oledw_ssd1306_glib/mikroe_oledw_ssd1306_glib_si91x.slcp @@ -0,0 +1,67 @@ +project_name: mikroe_oledw_ssd1306_glib_si91x +package: platform +label: Third Party Hardware Drivers - SSD1306 - Mikroe OLEDW Click (Mikroe) with GLIB +description: | + This example project shows an example for Mikroe OLEDW Click driver integration with GLIB. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_oledw_ssd1306_glib/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: services_oled_glib + from: third_party_hw_drivers +- id: mikroe_oledw + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sl_si91x_button_917 + instance: + - btn0 + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_oledw_ssd1306_glib/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_oledw_ssd1306_glib/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_oledw_ssd1306_glib/image/testing_result.gif + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_ozone2_mq131/app.c b/app/example/mikroe_ozone2_mq131/app.c index 6b85cc06..e5d7cec5 100644 --- a/app/example/mikroe_ozone2_mq131/app.c +++ b/app/example/mikroe_ozone2_mq131/app.c @@ -35,14 +35,36 @@ ******************************************************************************/ #include "sl_sleeptimer.h" -#include "sl_spidrv_instances.h" +#include "mikroe_mq131.h" +#if (defined(SLI_SI917)) +#include "sl_adc_instances.h" +#include "sl_si91x_gspi.h" +#include "rsi_debug.h" +#else +#include "em_iadc.h" +#include "sl_spidrv_instances.h" #include "app_log.h" +#endif -#include "mikroe_mq131.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define READING_INTERVAL_MSEC 1000 +#if (defined(SLI_SI917)) +#if MIKROE_OZONE2_ADC_SEL == 0 +static uint8_t channel = SL_ADC_CHANNEL_1; +#else +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif +#endif + +static mikroe_adc_handle_t app_adc_instance = NULL; +static mikroe_spi_handle_t app_spi_instance = NULL; static volatile bool app_timer_expire = false; static sl_sleeptimer_timer_handle_t app_timer; @@ -55,11 +77,39 @@ void app_init(void) { sl_status_t sc; - app_log("---- Application Init ----\r\n"); - sc = mikroe_ozone2_init(sl_spidrv_mikroe_handle); +#if (defined(SLI_SI917)) +#if MIKROE_OZONE2_ADC_SEL == 0 + app_adc_instance = &channel; +#else + app_spi_instance = &gspi_instance; +#endif + +#else +#if MIKROE_OZONE2_ADC_SEL == 0 + app_adc_instance = IADC0; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + +#endif + + app_printf("---- Application Init ----\r\n"); + sc = mikroe_ozone2_init(app_spi_instance, app_adc_instance); + +#if (defined(SLI_SI917)) + + /** + * Due to calling trim_efuse API on ADC init in driver + * it will change the clock frequency, + * if we are not initialize the debug again + * it will print the garbage data in console output. + */ + DEBUGINIT(); +#endif + if (sc != SL_STATUS_OK) { - app_log("---- Application Init Error ----"); - app_log("---- Please, run program again ----"); + app_printf("---- Application Init Error ----"); + app_printf("---- Please, run program again ----"); for ( ; ; ) {} } sl_sleeptimer_start_periodic_timer_ms(&app_timer, @@ -83,7 +133,7 @@ void app_process_action(void) app_timer_expire = false; if (mikroe_ozone2_read_measurement(&o3_ppm) == SL_STATUS_OK) { - app_log(" O3 [ppm] : %u\r\n", o3_ppm); + app_printf(" O3 [ppm] : %u\r\n", o3_ppm); } } diff --git a/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp b/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp index 4bf1ca05..7d639c3c 100644 --- a/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp +++ b/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131.slcp @@ -39,11 +39,11 @@ component: configuration: - name: SL_SPIDRV_MIKROE_CS_CONTROL - value: spidrvCsControlApplication + value: "spidrvCsControlApplication" sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_ozone2_mq131/images/create_example.png @@ -52,8 +52,6 @@ other_file: directory: images - path: ../../documentation/example/mikroe_ozone2_mq131/images/log.png directory: images - - path: ../../documentation/example/mikroe_ozone2_mq131/images/mq131_config.png - directory: images - path: ../../documentation/example/mikroe_ozone2_mq131/images/spidrv_config.png directory: images diff --git a/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131_si91x.slcp b/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131_si91x.slcp new file mode 100644 index 00000000..253c3d66 --- /dev/null +++ b/app/example/mikroe_ozone2_mq131/mikroe_ozone2_mq131_si91x.slcp @@ -0,0 +1,65 @@ +project_name: mikroe_ozone2_mq131_si91x +label: Third Party Hardware Drivers - MQ131 - Ozone 2 Click (Mikroe) +package: platform +description: | + This example project shows an example for Ozone 2 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_ozone2_mq131/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance +- id: mikroe_ozone2 + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_ozone2_mq131/images/create_example.png + directory: images + - path: ../../documentation/example/mikroe_ozone2_mq131/images/hardware_connection.png + directory: images + - path: ../../documentation/example/mikroe_ozone2_mq131/images/log.png + directory: images + - path: ../../documentation/example/mikroe_ozone2_mq131/images/spidrv_config.png + directory: images + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_pcr_xm125/app.c b/app/example/mikroe_pcr_xm125/app.c new file mode 100644 index 00000000..7e212938 --- /dev/null +++ b/app/example/mikroe_pcr_xm125/app.c @@ -0,0 +1,125 @@ +/***************************************************************************//** + * @file app.c + * @brief Example application + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#include "sl_sleeptimer.h" +#include "app_assert.h" +#include "mikroe_xm125.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#define READING_INTERVAL_MSEC 1000 + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +static sl_sleeptimer_timer_handle_t app_timer_handle; +static volatile bool timer_trigger_process = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; + +void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); + +void app_init(void) +{ + sl_status_t ret_code; + app_printf("Silicon Labs - XM125 - PCR Click Driver Example.\r\n"); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + ret_code = mikroe_xm125_init(app_i2c_instance); + app_assert_status(ret_code); + app_printf("mikroe_xm125_init done\r\n"); + + ret_code = mikroe_xm125_default_cfg(); + app_assert_status(ret_code); + app_printf("mikroe_xm125_default_cfg done\r\n"); + + ret_code = sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_callback, + NULL, + 0, + 0); + app_printf("start timer periodic = 0x%lx\r\n", ret_code); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + if (timer_trigger_process == true) { + uint32_t distance_data = 0; + sl_status_t stt = mikroe_xm125_get_distance(&distance_data); + + if (SL_STATUS_OK == stt) { + app_printf("Distance: %lu mm\r\n", distance_data); + } else { + app_printf("Error 0x%lx", stt); + } + timer_trigger_process = false; + } +} + +/***************************************************************************//** + * App timer callback function. + ******************************************************************************/ +void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data) +{ + (void) data; + (void) handle; + + timer_trigger_process = true; +} diff --git a/app/example/mikroe_pcr_xm125/app.h b/app/example/mikroe_pcr_xm125/app.h new file mode 100644 index 00000000..efa2fd7a --- /dev/null +++ b/app/example/mikroe_pcr_xm125/app.h @@ -0,0 +1,31 @@ +/***************************************************************************//** + * @file + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef APP_H +#define APP_H + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); + +#endif // APP_H diff --git a/app/example/mikroe_pcr_xm125/main.c b/app/example/mikroe_pcr_xm125/main.c new file mode 100644 index 00000000..b6aa4e33 --- /dev/null +++ b/app/example/mikroe_pcr_xm125/main.c @@ -0,0 +1,80 @@ +/***************************************************************************//** + * @file main.c + * @brief main() function. + ******************************************************************************* + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "sl_component_catalog.h" +#include "sl_system_init.h" +#include "app.h" +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#include "sl_power_manager.h" +#endif +#if defined(SL_CATALOG_KERNEL_PRESENT) +#include "sl_system_kernel.h" +#else // SL_CATALOG_KERNEL_PRESENT +#include "sl_system_process_action.h" +#endif // SL_CATALOG_KERNEL_PRESENT + +int main(void) +{ + // Initialize Silicon Labs device, system, service(s) and protocol stack(s). + // Note that if the kernel is present, processing task(s) will be created by + // this call. + sl_system_init(); + + // Initialize the application. For example, create periodic timer(s) or + // task(s) if the kernel is present. + app_init(); + +#if defined(SL_CATALOG_KERNEL_PRESENT) + // Start the kernel. Task(s) created in app_init() will start running. + sl_system_kernel_start(); +#else // SL_CATALOG_KERNEL_PRESENT + while (1) { + // Do not remove this call: Silicon Labs components process action routine + // must be called from the super loop. + sl_system_process_action(); + + // Application process. + app_process_action(); + +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + // Let the CPU go to sleep if the system allows it. + sl_power_manager_sleep(); +#endif + } +#endif // SL_CATALOG_KERNEL_PRESENT +} diff --git a/app/example/mikroe_pcr_xm125/mikroe_pcr_xm125.slcp b/app/example/mikroe_pcr_xm125/mikroe_pcr_xm125.slcp new file mode 100644 index 00000000..540a55b3 --- /dev/null +++ b/app/example/mikroe_pcr_xm125/mikroe_pcr_xm125.slcp @@ -0,0 +1,60 @@ +project_name: mikroe_pcr_xm125 +package: platform +label: Third Party Hardware Drivers - XM125 - PCR Click (Mikroe) +description: | + This example project shows an example for Mikroe PCR Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_pcr_xm125/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: device_init +- id: sl_system +- id: component_catalog +- id: sleeptimer +- id: app_assert +- id: app_log +- id: iostream_eusart + instance: [vcom] +- id: mikroe_pcr_xm125 + from: third_party_hw_drivers + +toolchain_settings: +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 + +other_file: + - path: ../../documentation/example/mikroe_pcr_xm125/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_pcr_xm125/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_pcr_xm125/image/console_log.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true diff --git a/app/example/mikroe_pcr_xm125/mikroe_pcr_xm125_si91x.slcp b/app/example/mikroe_pcr_xm125/mikroe_pcr_xm125_si91x.slcp new file mode 100644 index 00000000..e36d1030 --- /dev/null +++ b/app/example/mikroe_pcr_xm125/mikroe_pcr_xm125_si91x.slcp @@ -0,0 +1,64 @@ +project_name: mikroe_pcr_xm125 +package: platform +label: Third Party Hardware Drivers - XM125 - PCR Click (Mikroe) +description: | + This example project shows an example for Mikroe PCR Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_pcr_xm125/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_pcr_xm125 + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_pcr_xm125/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_pcr_xm125/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_pcr_xm125/image/console_log.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_ph2/app.c b/app/example/mikroe_ph2/app.c new file mode 100644 index 00000000..eb74936c --- /dev/null +++ b/app/example/mikroe_ph2/app.c @@ -0,0 +1,167 @@ +/***************************************************************************//** + * @file app.c + * @brief Top level application functions + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ + +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +#include "mikroe_ph2.h" +#include "app_assert.h" +#include "sl_sleeptimer.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define READING_INTERVAL_MSEC 1000 + +static sl_sleeptimer_timer_handle_t app_timer_handle; +static volatile bool trigger_process = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; +void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); + +void app_init(void) +{ + sl_status_t stt; + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + app_printf("Hello World - Mikroe PH2 Click example\r\n"); + stt = mikroe_ph2_init(app_i2c_instance); + app_assert_status(stt); + + app_printf("================================\r\n"); + app_printf("Performing calibration\r\n"); + app_printf("================================\r\n"); + app_printf("Disconect BNC connector, then Short-circuit it\r\n"); + app_printf("Adjust offset potentiometer\r\n"); + app_printf("================================\r\n"); + app_printf("STAT1 Blink --> turn clockwise\r\n"); + app_printf("STAT2 Blink --> turn counter-clockwise\r\n"); + app_printf("================================\r\n"); + + stt = mikroe_ph2_calibrate_offset(); + app_assert_status(stt); + + app_printf("Offset calibration completed!\r\n"); + app_printf("================================\r\n"); + app_printf("Connect probe back\r\n"); + app_printf("================================\r\n"); + sl_sleeptimer_delay_millisecond(5000); + app_printf("Place probe into pH \r\n"); + app_printf("neutral substance for\r\n"); + app_printf("mid point calibration\r\n"); + app_printf("================================\r\n"); + sl_sleeptimer_delay_millisecond(5000); + app_printf("Starting calibration \r\n"); + app_printf("================================\r\n"); + + stt = mikroe_ph2_calibrate(7); + app_assert_status(stt); + + app_printf("PH Calibration completed! \r\n"); + app_printf("================================\r\n"); + + stt = mikroe_ds18b20_init(); + app_assert_status(stt); + + stt = mikroe_ds18b20_check_communication(); + app_assert_status(stt); + + stt = mikroe_ds18b20_default_cfg(); + app_assert_status(stt); + + app_printf("Ds18b20 ininit done! \r\n"); + + app_printf("sl_sleeptimer_start_periodic = 0x%lx\r\n", + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_callback, + NULL, + 0, + 0)); + app_printf(" Application Task \r\n"); + app_printf("================================\r\n"); +} + +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void) +{ + if (trigger_process) { + trigger_process = false; + + float ph_value = 0.0; + sl_status_t stt = mikroe_ph2_calculate_ph(&ph_value); + if (SL_STATUS_OK == stt) { + app_printf(" pH value: %.3f \r\n", ph_value); + app_printf(" ================================ \r\n"); + } + + float temperature = 0.0; + stt = mikroe_ds18b20_read_temperature(&temperature); + if (SL_STATUS_OK == stt) { + app_printf(" Temperature value: %.3f \r\n", temperature); + app_printf(" ================================ \r\n"); + } + } +} + +void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data) +{ + (void) data; + (void) handle; + + trigger_process = true; +} diff --git a/driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_dma_config.h b/app/example/mikroe_ph2/app.h similarity index 72% rename from driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_dma_config.h rename to app/example/mikroe_ph2/app.h index 97fab49f..ccbd32e6 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_dma_config.h +++ b/app/example/mikroe_ph2/app.h @@ -1,10 +1,9 @@ /***************************************************************************//** - * @file adafruit_st7789_spi_dma_config.h - * @brief Configuration file for Adafruit RGB LED Driver board. - * @version 1.0.0 + * @file app.h + * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -28,32 +27,23 @@ * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************* - * # Evaluation Quality + * # Experimental Quality * This code has been minimally tested to ensure that it builds and is suitable * as a demonstration for evaluation purposes only. This code will be maintained * at the sole discretion of Silicon Labs. ******************************************************************************/ -#ifndef ADAFRUIT_ST7789_CONFIG_H_ -#define ADAFRUIT_ST7789_CONFIG_H_ -#ifdef __cplusplus -extern "C" -{ -#endif +#ifndef APP_H +#define APP_H +/***************************************************************************//** + * Initialize application. + ******************************************************************************/ +void app_init(void); -// <<< sl:start pin_tool >>> - -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#warning "ST7789 SPI DC Pin not configured" -// [GPIO_ST7789_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif +/***************************************************************************//** + * App ticking function. + ******************************************************************************/ +void app_process_action(void); -#endif /* ADAFRUIT_ST7789_CONFIG_H_ */ +#endif // APP_H diff --git a/app/example/mikroe_ph2/main.c b/app/example/mikroe_ph2/main.c new file mode 100644 index 00000000..2da253ba --- /dev/null +++ b/app/example/mikroe_ph2/main.c @@ -0,0 +1,58 @@ +/***************************************************************************//** + * @file main.c + * @brief main() function. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ +#include "sl_component_catalog.h" +#include "sl_system_init.h" +#include "app.h" +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#include "sl_power_manager.h" +#endif +#if defined(SL_CATALOG_KERNEL_PRESENT) +#include "sl_system_kernel.h" +#else // SL_CATALOG_KERNEL_PRESENT +#include "sl_system_process_action.h" +#endif // SL_CATALOG_KERNEL_PRESENT + +int main(void) +{ + // Initialize Silicon Labs device, system, service(s) and protocol stack(s). + // Note that if the kernel is present, processing task(s) will be created by + // this call. + sl_system_init(); + + // Initialize the application. For example, create periodic timer(s) or + // task(s) if the kernel is present. + app_init(); + +#if defined(SL_CATALOG_KERNEL_PRESENT) + // Start the kernel. Task(s) created in app_init() will start running. + sl_system_kernel_start(); +#else // SL_CATALOG_KERNEL_PRESENT + while (1) { + // Do not remove this call: Silicon Labs components process action routine + // must be called from the super loop. + sl_system_process_action(); + + // Application process. + app_process_action(); + +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + // Let the CPU go to sleep if the system allows it. + sl_power_manager_sleep(); +#endif + } +#endif // SL_CATALOG_KERNEL_PRESENT +} diff --git a/app/example/mikroe_ph2/mikroe_ph2.slcp b/app/example/mikroe_ph2/mikroe_ph2.slcp new file mode 100644 index 00000000..8f33c28f --- /dev/null +++ b/app/example/mikroe_ph2/mikroe_ph2.slcp @@ -0,0 +1,63 @@ +project_name: mikroe_ph2 +package: platform +label: Third Party Hardware Drivers - PH2 Click (Mikroe) +description: | + This example project shows an example for - PH2 Click (Mikroe). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_ph2/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: device_init +- id: ph2 + from: third_party_hw_drivers +- id: iostream_usart + instance: [vcom] +- id: i2cspm + instance: [mikroe] +- id: sleeptimer +- id: app_log +- id: app_assert + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 + +other_file: + - path: ../../documentation/example/mikroe_ph2/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_ph2/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_ph2/image/ph2_click.png + directory: "image" + - path: ../../documentation/example/mikroe_ph2/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true diff --git a/app/example/mikroe_ph2/mikroe_ph2_si91x.slcp b/app/example/mikroe_ph2/mikroe_ph2_si91x.slcp new file mode 100644 index 00000000..93eece76 --- /dev/null +++ b/app/example/mikroe_ph2/mikroe_ph2_si91x.slcp @@ -0,0 +1,73 @@ +project_name: mikroe_ph2 +package: platform +label: Third Party Hardware Drivers - PH2 Click (Mikroe) +description: | + This example project shows an example for - PH2 Click (Mikroe). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_ph2/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: ph2 + from: third_party_hw_drivers +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance +- id: app_assert + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_ph2/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_ph2/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_ph2/image/ph2_click.png + directory: "image" + - path: ../../documentation/example/mikroe_ph2/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_pir_pl_n823_01/app.c b/app/example/mikroe_pir_pl_n823_01/app.c index 870c68e5..84d09fd2 100644 --- a/app/example/mikroe_pir_pl_n823_01/app.c +++ b/app/example/mikroe_pir_pl_n823_01/app.c @@ -3,27 +3,66 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "sl_status.h" -#include "sl_i2cspm_instances.h" -#include "app_log.h" #include "sl_sleeptimer.h" #include "mikroe_pl_n823_01.h" -#define APP_TIMER_INTERVAL_MS 1000 +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define APP_TIMER_INTERVAL_MS 1000 static sl_sleeptimer_timer_handle_t app_timer; static volatile bool update = true; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_timer_handler(sl_sleeptimer_timer_handle_t *timer, void *data); @@ -44,14 +83,21 @@ static void app_timer_handler(sl_sleeptimer_timer_handle_t *timer, void *data) void app_init(void) { sl_status_t sc; - app_log("=======================================\n"); - app_log("Silicon Labs Example - MikroE PIR Click.\n"); - app_log(" Application initialized successfully.\n"); - sc = mikroe_pl_n823_01_init(sl_i2cspm_mikroe); + app_printf("=======================================\n"); + app_printf("Silicon Labs Example - MikroE PIR Click.\n"); + app_printf(" Application initialized successfully.\n"); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + + sc = mikroe_pl_n823_01_init(app_i2c_instance); if (sc != SL_STATUS_OK) { - app_log("MikroE PIR Click initialized failed!\n"); + app_printf("MikroE PIR Click initialized failed!\n"); } - app_log("=======================================\n"); + app_printf("=======================================\n"); sl_sleeptimer_start_periodic_timer_ms(&app_timer, APP_TIMER_INTERVAL_MS, app_timer_handler, @@ -72,7 +118,7 @@ void app_process_action(void) adc_val = mikroe_pl_n823_01_get_adc(); map_out = mikroe_pl_n823_01_scale_results(adc_val, 0, 3303); - app_log("[PL-N823-01]: Voltage: %.2f mV\n", map_out); + app_printf("[PL-N823-01]: Voltage: %.2f mV\n", map_out); update = false; } } diff --git a/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp b/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp index 3b573ada..f416efdb 100644 --- a/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp +++ b/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01.slcp @@ -45,15 +45,13 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/create_project.png directory: "image" - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/console_log.png directory: "image" - - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/install_float.png - directory: "image" - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/hardware_connection.png directory: "image" - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/software_layer.png @@ -62,4 +60,4 @@ other_file: ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01_si91x.slcp b/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01_si91x.slcp new file mode 100644 index 00000000..b7a7c790 --- /dev/null +++ b/app/example/mikroe_pir_pl_n823_01/mikroe_pir_pl_n823_01_si91x.slcp @@ -0,0 +1,69 @@ +project_name: mikroe_pir_pl_n823_01 +package: platform +label: Third Party Hardware Drivers - PL-N823-01 - PIR Click (Mikroe) +description: | + This example project shows an example for Mikroe PIR Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_pir_pl_n823_01/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: mikroe_pir_pl_n823_01 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/create_project.png + directory: "image" + - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_pir_pl_n823_01/image/software_layer.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_pressure3_dps310/app.c b/app/example/mikroe_pressure3_dps310/app.c index b820733a..5e3c9601 100644 --- a/app/example/mikroe_pressure3_dps310/app.c +++ b/app/example/mikroe_pressure3_dps310/app.c @@ -3,32 +3,83 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ + #include "sl_status.h" #include "sl_sleeptimer.h" +#include "sl_component_catalog.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else #include "app_log.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #ifdef SL_CATALOG_MIKROE_PRESSURE3_SPI_PRESENT -#include "sl_spidrv_instances.h" #include "mikroe_dps310_spi.h" + +#if (defined(SLI_SI917)) +#include "sl_si91x_gspi.h" + +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#else +#include "sl_spidrv_instances.h" +#endif + +mikroe_spi_handle_t app_spi_instance = NULL; #endif #ifdef SL_CATALOG_MIKROE_PRESSURE3_I2C_PRESENT -#include "sl_i2cspm_instances.h" #include "mikroe_dps310_i2c.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#else +#include "sl_i2cspm_instances.h" #endif -#define READING_INTERVAL_MSEC 500 +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +static mikroe_i2c_handle_t app_i2c_instance = NULL; +#endif + +#define READING_INTERVAL_MSEC 1000 static volatile bool enable_reading_data = false; static sl_sleeptimer_timer_handle_t app_periodic_timer; @@ -42,21 +93,32 @@ static void app_periodic_timer_cb(sl_sleeptimer_timer_handle_t *timer, void app_init(void) { #ifdef SL_CATALOG_MIKROE_PRESSURE3_SPI_PRESENT - mikroe_pressure3_init(sl_spidrv_mikroe_handle); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + + mikroe_pressure3_init(app_spi_instance); #endif #ifdef SL_CATALOG_MIKROE_PRESSURE3_I2C_PRESENT - mikroe_pressure3_init(sl_i2cspm_mikroe); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + mikroe_pressure3_init(app_i2c_instance); #endif - app_log("Sensor initialization done.\n"); + app_printf("Sensor initialization done.\n"); // Start periodic timer used for read data from sensor. - sl_sleeptimer_start_periodic_timer(&app_periodic_timer, - READING_INTERVAL_MSEC, - app_periodic_timer_cb, - (void *) NULL, - 0, - 0); + sl_sleeptimer_start_periodic_timer_ms(&app_periodic_timer, + READING_INTERVAL_MSEC, + app_periodic_timer_cb, + (void *) NULL, + 0, + 0); } /***************************************************************************//** @@ -71,9 +133,9 @@ void app_process_action(void) enable_reading_data = false; mikroe_pressure3_get_t_p_data(&temperature, &pressure); - app_log(" * Pressure: %.2f mbar * \r\n", pressure); - app_log(" * Temperature: %.2f C * \r\n", temperature); - app_log(" ----------------------- \r\n"); + app_printf(" * Pressure: %.2f mbar * \r\n", pressure); + app_printf(" * Temperature: %.2f C * \r\n", temperature); + app_printf(" ----------------------- \r\n"); } } diff --git a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp index 0b68703b..d269eea6 100644 --- a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp +++ b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c.slcp @@ -5,6 +5,7 @@ description: | This example project shows an example for Mikroe Pressure 3 Click board driver integration using I2C communication. category: Example|Platform quality: evaluation + filter: - name: Device Type value: [SoC] @@ -12,15 +13,19 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] + readme: - path: ../../documentation/example/mikroe_pressure3_dps310/README.md + source: - path: app.c - path: main.c + include: - path: '' file_list: - path: app.h + component: - id: sl_system - id: device_init @@ -34,14 +39,18 @@ component: - id: sleeptimer - id: mikroe_pressure3_i2c from: third_party_hw_drivers + toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" + define: - name: DEBUG_EFM + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 + other_file: - path: ../../documentation/example/mikroe_pressure3_dps310/image/create_example.png directory: "image" @@ -51,7 +60,12 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_pressure3_dps310/image/float.png directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/spi_config.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/pressure3_config.png + directory: "image" + ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c_si91x.slcp b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c_si91x.slcp new file mode 100644 index 00000000..8094941a --- /dev/null +++ b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_i2c_si91x.slcp @@ -0,0 +1,73 @@ +project_name: mikroe_pressure3_dps310_i2c_si91x +package: platform +label: Third Party Hardware Drivers - DPS310 - Pressure 3 Click (Mikroe) - I2C +description: | + This example project shows an example for Mikroe Pressure 3 Click board driver integration using I2C communication. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_pressure3_dps310/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_pressure3_i2c + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_pressure3_dps310/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/float.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/spi_config.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/pressure3_config.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp index 1f20cb26..88121430 100644 --- a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp +++ b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi.slcp @@ -5,6 +5,7 @@ description: | This example project shows an example for Mikroe Pressure 3 Click board driver integration using SPI communication. category: Example|Platform quality: evaluation + filter: - name: Device Type value: [SoC] @@ -12,15 +13,19 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] + readme: - path: ../../documentation/example/mikroe_pressure3_dps310/README.md + source: - path: app.c - path: main.c + include: - path: '' file_list: - path: app.h + component: - id: sl_system - id: device_init @@ -34,17 +39,22 @@ component: - id: sleeptimer - id: mikroe_pressure3_spi from: third_party_hw_drivers + toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" + define: - name: DEBUG_EFM + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 + configuration: - name: SL_SPIDRV_MIKROE_CS_CONTROL value: "spidrvCsControlApplication" + other_file: - path: ../../documentation/example/mikroe_pressure3_dps310/image/create_example.png directory: "image" @@ -54,7 +64,12 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_pressure3_dps310/image/float.png directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/spi_config.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/pressure3_config.png + directory: "image" + ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi_si91x.slcp b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi_si91x.slcp new file mode 100644 index 00000000..d81f31eb --- /dev/null +++ b/app/example/mikroe_pressure3_dps310/mikroe_pressure3_dps310_spi_si91x.slcp @@ -0,0 +1,70 @@ +project_name: mikroe_pressure3_dps310_spi_si91x +package: platform +label: Third Party Hardware Drivers - DPS310 - Pressure 3 Click (Mikroe) - SPI +description: | + This example project shows an example for Mikroe Pressure 3 Click board driver integration using SPI communication. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_pressure3_dps310/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_pressure3_spi + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_pressure3_dps310/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/float.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/spi_config.png + directory: "image" + - path: ../../documentation/example/mikroe_pressure3_dps310/image/pressure3_config.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_pwm_driver_si8711cc/app.c b/app/example/mikroe_pwm_driver_si8711cc/app.c index c73d4e7a..cc409f8d 100644 --- a/app/example/mikroe_pwm_driver_si8711cc/app.c +++ b/app/example/mikroe_pwm_driver_si8711cc/app.c @@ -1,28 +1,49 @@ /***************************************************************************//** - * @file + * @file app.c * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" -#include "sl_pwm_instances.h" #include "mikroe_si8711cc.h" +#include "sl_pwm_instances.h" #include "sl_sleeptimer.h" +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else /* None Si91x device */ +#include "app_log.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif + static const float DUTY_CYCLE_STEP = 0.1; static const uint16_t FREQUENCY = 1000; static const uint16_t TIMER_PERIOD = 2000; @@ -31,35 +52,41 @@ static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool timer_trigger = false; static uint8_t step_count = 1; static float duty_cycle; - +static mikroe_pwm_handle_t app_pwm_instance = NULL; static void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); void app_init(void) { - sl_status_t stt; - - app_log("Hello World - PWM Driver Click !!!\r\n"); - - if (mikroe_si8711cc_init(&sl_pwm_mikroe) == SL_STATUS_OK) { - app_log("PWM Driver Click board driver init successfully\r\n"); - - stt = sl_sleeptimer_restart_periodic_timer_ms(&app_timer_handle, - TIMER_PERIOD, - app_timer_callback, - NULL, - 0, - 0); - - app_log("sl_sleeptimer_restart_periodic_timer = 0x%lx\r\n", stt); +#if (defined(SLI_SI917)) + app_pwm_instance = &sl_pwm_channel_0_config; +#else + app_pwm_instance = &sl_pwm_mikroe; +#endif + + app_printf("Hello World - PWM Driver Click !!!\r\n"); + + if (mikroe_si8711cc_init(app_pwm_instance) == SL_STATUS_OK) { + app_printf("PWM Driver Click board driver init successfully\r\n"); + + sl_status_t stt = sl_sleeptimer_restart_periodic_timer_ms(&app_timer_handle, + TIMER_PERIOD, + app_timer_callback, + NULL, + 0, + 0); + + app_printf("Start periodic timer %d(ms), status = 0x%lx\r\n", + TIMER_PERIOD, + stt); duty_cycle = step_count * DUTY_CYCLE_STEP; mikroe_si8711cc_set_frequency(FREQUENCY); mikroe_si8711cc_pwm_start(); - app_log("mikroe_si8711cc_pwm_start \r\n"); + app_printf("mikroe_si8711cc_pwm_start \r\n"); } else { - app_log("PWM Driver Click board driver init failed," \ - " please run program again.\r\n"); + app_printf("PWM Driver Click board driver init failed," \ + " please run program again.\r\n"); } } @@ -72,7 +99,7 @@ void app_process_action(void) timer_trigger = false; mikroe_si8711cc_set_duty_cycle(duty_cycle); - app_log("PWM Driver set duty = %d%%\r\n", (uint16_t)(duty_cycle * 100)); + app_printf("PWM Driver set duty = %d%%\r\n", (uint16_t)(duty_cycle * 100)); step_count++; duty_cycle = step_count * DUTY_CYCLE_STEP; diff --git a/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp b/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp index 6bbea1eb..41184617 100644 --- a/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp +++ b/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc.slcp @@ -32,15 +32,14 @@ component: - vcom - id: pwm_driver_si8711cc from: third_party_hw_drivers + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/create_example.png directory: "image" - - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_1.png - directory: "image" - - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection_2.png + - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection.png directory: "image" - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/log.png directory: "image" diff --git a/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc_si91x.slcp b/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc_si91x.slcp new file mode 100644 index 00000000..33e7702e --- /dev/null +++ b/app/example/mikroe_pwm_driver_si8711cc/mikroe_pwm_driver_si8711cc_si91x.slcp @@ -0,0 +1,64 @@ +project_name: mikroe_pwm_driver_si8711cc +label: Third Party Hardware Drivers - Si8711CC - PWM Driver Click (Mikroe) +package: platform +description: | + This example project shows an example for SI8711CC - PWM Driver Click (Mikroe) integration. +category: Example|Platform +quality: evaluation +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] +readme: +- path: ../../documentation/example/mikroe_pwm_driver_si8711cc/README.md +source: +- path: app.c +- path: main.c +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [channel_0] + from: wiseconnect3_sdk + id: pwm_instance +- id: pwm_driver_si8711cc + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/result_1.png + directory: "image" + - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/result_2.png + directory: "image" + - path: ../../documentation/example/mikroe_pwm_driver_si8711cc/image/result_3.png + directory: "image" +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_radar_mm5d91_00/app.c b/app/example/mikroe_radar_mm5d91_00/app.c index 7da813b2..ad14f808 100644 --- a/app/example/mikroe_radar_mm5d91_00/app.c +++ b/app/example/mikroe_radar_mm5d91_00/app.c @@ -34,26 +34,46 @@ ******************************************************************************/ #include +#include "mikroe_mm5d91_00.h" + +#if (defined(SLI_SI917)) +#include "sl_si91x_usart.h" +#include "rsi_debug.h" +#else #include "sl_iostream_init_usart_instances.h" #include "sl_iostream_init_eusart_instances.h" #include "app_log.h" -#include "mikroe_mm5d91_00.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define USART_INSTANCE_USED UART_1 -static mikroe_radar_t mikroe_radar; +static usart_peripheral_t uart_instance = USART_INSTANCE_USED; +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +mikroe_uart_handle_t app_uart_instance = NULL; /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { +#if (defined(SLI_SI917)) + app_uart_instance = &uart_instance; +#else + app_uart_instance = sl_iostream_uart_mikroe_handle; + sl_iostream_set_default(sl_iostream_vcom_handle); app_log_iostream_set(sl_iostream_vcom_handle); - if (SL_STATUS_OK == mikroe_radar_usart_init(&mikroe_radar, - sl_iostream_uart_mikroe_handle, - 0)) { - app_log("Init: Success\r\n"); +#endif + + if (SL_STATUS_OK == mikroe_radar_init(app_uart_instance)) { + app_printf("Init: Success\r\n"); } else { - app_log("Init: Failed\r\n"); + app_printf("Init: Failed\r\n"); } } @@ -66,32 +86,29 @@ void app_process_action(void) uint8_t evt_payload_size; uint8_t evt_payload[16]; - if (SL_STATUS_OK == mikroe_radar_get_event(&mikroe_radar, - &evt_id, + if (SL_STATUS_OK == mikroe_radar_get_event(&evt_id, evt_payload, &evt_payload_size)) { if (RADAR_CMD_ID_DETECT_IN_EVT == evt_id) { - app_log(" EVENT: IN\r\n"); + app_printf(" EVENT: IN\r\n"); radar_float_bytes_t distance; memcpy(distance.b_data, &evt_payload[8], 4); radar_float_ieee_to_mchip(&distance.f_data); - app_log(" Target distance: %.3f m\r\n", distance.f_data); + app_printf(" Target distance: %.3f m\r\n", distance.f_data); memcpy(distance.b_data, &evt_payload[12], 4); radar_float_ieee_to_mchip(&distance.f_data); - app_log(" Accuracy (+/-): %.3f m\r\n", distance.f_data); + app_printf(" Accuracy (+/-): %.3f m\r\n", distance.f_data); } else { - app_log(" EVENT: OUT\r\n"); + app_printf(" EVENT: OUT\r\n"); } uint32_t evt_time = (( uint32_t ) evt_payload[3] << 24) | (( uint32_t ) evt_payload[2] << 16) | (( uint16_t ) evt_payload[1] << 8) | evt_payload[0]; - app_log(" Elapsed time: %.2f s\r\n", - evt_time / 1000.0); + app_printf(" Elapsed time: %.2f s\r\n", evt_time / 1000.0); float temperature; - if (SL_STATUS_OK == mikroe_radar_get_temperature(&mikroe_radar, - &temperature)) { - app_log(" Temperature: %.2f C\r\n\n", temperature); + if (SL_STATUS_OK == mikroe_radar_get_temperature(&temperature)) { + app_printf(" Temperature: %.2f C\r\n\n", temperature); } } } diff --git a/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp b/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp index cbe9eff4..379fa21c 100644 --- a/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp +++ b/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00.slcp @@ -48,15 +48,13 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_radar_mm5d91_00/image/hardware_connection.png directory: "image" - path: ../../documentation/example/mikroe_radar_mm5d91_00/image/create_example.png directory: "image" - - path: ../../documentation/example/mikroe_radar_mm5d91_00/image/printf_float.png - directory: "image" - path: ../../documentation/example/mikroe_radar_mm5d91_00/image/log.png directory: "image" diff --git a/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00_si91x.slcp b/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00_si91x.slcp new file mode 100644 index 00000000..0010f739 --- /dev/null +++ b/app/example/mikroe_radar_mm5d91_00/mikroe_radar_mm5d91_00_si91x.slcp @@ -0,0 +1,64 @@ +project_name: mikroe_radar_mm5d91_00_si91x +package: platform +label: Third Party Hardware Drivers - MM5D91-00 - Radar Click (Mikroe) +description: | + This example project shows an example for Mikroe Radar Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_radar_mm5d91_00/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_radar + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +configuration: + - name: SL_UART1_DMA_CONFIG_ENABLE + value: "0" + +other_file: + - path: ../../documentation/example/mikroe_radar_mm5d91_00/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_radar_mm5d91_00/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_radar_mm5d91_00/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_relay2_lca717/app.c b/app/example/mikroe_relay2_lca717/app.c index 16e7fd0d..9e696f78 100644 --- a/app/example/mikroe_relay2_lca717/app.c +++ b/app/example/mikroe_relay2_lca717/app.c @@ -1,20 +1,41 @@ - /***************************************************************************//** * @file * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ + #include "mikroe_relay2.h" #include "sl_sleeptimer.h" diff --git a/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp b/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp index 8c19ce54..80bace8e 100644 --- a/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp +++ b/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717.slcp @@ -38,7 +38,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_relay2_lca717/image/hardware_connection.png @@ -47,6 +47,8 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_relay2_lca717/image/configuration.png directory: "image" + - path: ../../documentation/example/mikroe_relay2_lca717/image/configuration_si91x.png + directory: "image" ui_hints: highlight: diff --git a/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717_si91x.slcp b/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717_si91x.slcp new file mode 100644 index 00000000..9976973c --- /dev/null +++ b/app/example/mikroe_relay2_lca717/mikroe_relay2_lca717_si91x.slcp @@ -0,0 +1,62 @@ +project_name: mikroe_relay2_si91x +package: platform +label: Third Party Hardware Drivers - LCA717 - Relay 2 Click (Mikroe) +description: | + This example project shows an example for Mikroe Relay 2 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_relay2_lca717/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: mikroe_relay2 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_relay2_lca717/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_relay2_lca717/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_relay2_lca717/image/configuration.png + directory: "image" + - path: ../../documentation/example/mikroe_relay2_lca717/image/configuration_si91x.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_rf_meter_ad8318/app.c b/app/example/mikroe_rf_meter_ad8318/app.c index 042ad540..6d0898c4 100644 --- a/app/example/mikroe_rf_meter_ad8318/app.c +++ b/app/example/mikroe_rf_meter_ad8318/app.c @@ -3,29 +3,54 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ - -#include "sl_spidrv_instances.h" #include "sl_sleeptimer.h" +#include "mikroe_ad8318.h" +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_gspi.h" +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else /* None Si91x device */ #include "app_log.h" - -#include "mikroe_ad8318.h" +#include "sl_spidrv_instances.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define READING_INTERVAL_MSEC 1000 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; +static mikroe_spi_handle_t app_spi_instance = NULL; static void application_task(void); static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -37,13 +62,19 @@ void app_init(void) { sl_status_t sc; - app_log("Application initialization.\n"); + app_printf("Application initialization.\r\n"); + +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif - sc = mikroe_ad8318_init(sl_spidrv_mikroe_handle); + sc = mikroe_ad8318_init(app_spi_instance); if (sc == SL_STATUS_OK) { - app_log("RF Meter Click is initialized.\n"); + app_printf("RF Meter Click is initialized.\r\n"); } else { - app_log("RF Meter Click initialization is failed!\n"); + app_printf("RF Meter Click initialization is failed!\r\n"); } sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, @@ -79,9 +110,9 @@ static void application_task(void) MIKROE_AD8318_DEF_INTERCEPT, &signal); if (sc == SL_STATUS_OK) { - app_log("Signal strength: %.2f dBm\n", signal); + app_printf("Signal strength: %.2f dBm\r\n", signal); } else { - app_log("Reading signal strength is failed!\n"); + app_printf("Reading signal strength is failed!\r\n"); } } diff --git a/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp b/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp index 1788a13d..2d925f4f 100644 --- a/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp +++ b/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318.slcp @@ -47,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/create_example.png @@ -56,8 +56,6 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/console_log.png directory: "image" - - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/install_float.png - directory: "image" - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/software_layer.png directory: "image" diff --git a/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318_si91x.slcp b/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318_si91x.slcp new file mode 100644 index 00000000..6d4d9117 --- /dev/null +++ b/app/example/mikroe_rf_meter_ad8318/mikroe_rf_meter_ad8318_si91x.slcp @@ -0,0 +1,66 @@ +project_name: mirkoe_rf_meter_ad8318 +label: Third Party Hardware Drivers - AD8318 - RF Meter Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe RF Meter Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_rf_meter_ad8318/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: app_assert +- id: sleeptimer +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mirkoe_rf_meter + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_rf_meter_ad8318/image/software_layer.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_rng/app.c b/app/example/mikroe_rng/app.c index 398489d0..20acf25e 100644 --- a/app/example/mikroe_rng/app.c +++ b/app/example/mikroe_rng/app.c @@ -3,30 +3,66 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" #include "mikroe_rng.h" -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#define READING_INTERVAL_MSEC 500 +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define READING_INTERVAL_MSEC 500 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool trigger_process = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -34,19 +70,26 @@ void app_init(void) { sl_status_t stt; - app_log("Hello World - Mikroe RNG Click example\r\n"); + app_printf("Hello World - Mikroe RNG Click example\r\n"); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif - stt = mikroe_rng_init(sl_i2cspm_mikroe); + stt = mikroe_rng_init(app_i2c_instance); + app_printf("mikroe_rng_init = 0x%lx\r\n", stt); mikroe_rng_default_cfg(); - app_log("mikroe_rng_init = 0x%x\r\n", (uint16_t)stt); - - app_log("sl_sleeptimer_start_periodic = 0x%lx\r\n", - sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, - READING_INTERVAL_MSEC, - app_timer_callback, - NULL, - 0, - 0)); + + stt = sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_callback, + NULL, + 0, + 0); + + app_printf("sl_sleeptimer_start_periodic = 0x%lx\r\n", stt); } /***************************************************************************//** @@ -60,8 +103,8 @@ void app_process_action(void) float voltage; sl_status_t stt = mikroe_rng_get_voltage(&voltage); - app_log("mikroe_rng_get_voltage = 0x%lx, voltage = %.3f(mV)\r\n", - stt, voltage); + app_printf("mikroe_rng_get_voltage = 0x%lx, voltage = %.3f(mV)\r\n", + stt, voltage); } } diff --git a/app/example/mikroe_rng/mikroe_rng.slcp b/app/example/mikroe_rng/mikroe_rng.slcp index 7d4d6529..4a5bfeb9 100644 --- a/app/example/mikroe_rng/mikroe_rng.slcp +++ b/app/example/mikroe_rng/mikroe_rng.slcp @@ -47,21 +47,18 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_rng/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_rng/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_rng/image/rng_click.png - directory: "image" - - path: ../../documentation/example/mikroe_rng/image/rng_click_details.png - directory: "image" - path: ../../documentation/example/mikroe_rng/image/log.png directory: "image" - path: ../../documentation/example/mikroe_rng/image/driver_layer.png directory: "image" + ui_hints: highlight: - path: README.md diff --git a/app/example/mikroe_rng/mikroe_rng_si91x.slcp b/app/example/mikroe_rng/mikroe_rng_si91x.slcp new file mode 100644 index 00000000..700dd1b6 --- /dev/null +++ b/app/example/mikroe_rng/mikroe_rng_si91x.slcp @@ -0,0 +1,69 @@ +project_name: mikroe_rng_si91x +package: platform +label: Third Party Hardware Drivers - RNG Click (Mikroe) +description: | + This example project shows an example for RNG Click (Mikroe). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_rng/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: rng + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_rng/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_rng/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_rng/image/log.png + directory: "image" + - path: ../../documentation/example/mikroe_rng/image/driver_layer.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_rtc10_ds3231m/app.c b/app/example/mikroe_rtc10_ds3231m/app.c index 8a471733..d6f76027 100644 --- a/app/example/mikroe_rtc10_ds3231m/app.c +++ b/app/example/mikroe_rtc10_ds3231m/app.c @@ -1,26 +1,65 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" -#include "app_log.h" #include "mikroe_ds3231m.h" -#define READING_INTERVAL_MSEC 1000 +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif +#define READING_INTERVAL_MSEC 1000 + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +static mikroe_i2c_handle_t app_i2c_instance = NULL; static volatile bool flag = false; static uint8_t sec_flag; static sl_sleeptimer_timer_handle_t app_timer_handle; @@ -32,25 +71,25 @@ static void display_day_of_the_week(uint8_t day_of_the_week) { switch (day_of_the_week) { case 1: - app_log(" Monday \r\n\n "); + app_printf(" Monday \r\n\n "); break; case 2: - app_log(" Tuesday \r\n\n "); + app_printf(" Tuesday \r\n\n "); break; case 3: - app_log(" Wednesday \r\n\n "); + app_printf(" Wednesday \r\n\n "); break; case 4: - app_log(" Thursday \r\n\n "); + app_printf(" Thursday \r\n\n "); break; case 5: - app_log(" Friday \r\n\n "); + app_printf(" Friday \r\n\n "); break; case 6: - app_log(" Sunday \r\n\n "); + app_printf(" Sunday \r\n\n "); break; case 7: - app_log(" Saturday \r\n\n "); + app_printf(" Saturday \r\n\n "); break; default: break; @@ -73,17 +112,23 @@ static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data) ******************************************************************************/ void app_init(void) { - app_log("---- Application Init ----"); + app_printf("---- Application Init ----"); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif // Click initialization. - mikroe_ds3231m_init(sl_i2cspm_mikroe); + mikroe_ds3231m_init(app_i2c_instance); sl_sleeptimer_delay_millisecond(1000); sec_flag = 0xFF; - app_log("------------------- \r\n"); - app_log(" Hardware Reset \r\n"); + app_printf("------------------- \r\n"); + app_printf(" Hardware Reset \r\n"); mikroe_ds3231m_hw_reset(); sl_sleeptimer_delay_millisecond(1000); @@ -96,11 +141,11 @@ void app_init(void) mikroe_ds3231m_set_date(3, 6, 12, 2023); sl_sleeptimer_delay_millisecond(100); - app_log("------------------- \r\n"); - app_log(" Enable Counting \r\n"); - app_log("------------------- \r\n"); - app_log(" Start RTC \r\n"); - app_log("------------------- \r\n"); + app_printf("------------------- \r\n"); + app_printf(" Enable Counting \r\n"); + app_printf("------------------- \r\n"); + app_printf(" Start RTC \r\n"); + app_printf("------------------- \r\n"); mikroe_ds3231m_enable_counting(); sl_sleeptimer_delay_millisecond(100); sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, @@ -136,23 +181,23 @@ void app_process_action(void) sl_sleeptimer_delay_millisecond(100); if (sec_flag != time_seconds) { - app_log(" \r\n\n Time: %02u:%02u:%02u ", - (uint16_t)time_hours, - (uint16_t)time_minutes, - (uint16_t)time_seconds); - - app_log("Date: %u. %u. 20%u. ", - (uint16_t)date_day, - (uint16_t)date_month, - (uint16_t)date_year); + app_printf(" \r\n\n Time: %02u:%02u:%02u ", + (uint16_t)time_hours, + (uint16_t)time_minutes, + (uint16_t)time_seconds); + + app_printf("Date: %u. %u. 20%u. ", + (uint16_t)date_day, + (uint16_t)date_month, + (uint16_t)date_year); display_day_of_the_week(day_of_the_week); if (time_seconds == 0) { temperature = mikroe_ds3231m_get_temperature(); - app_log("\r\n\n Temp: %.2f C", temperature); + app_printf("\r\n\n Temp: %.2f C", temperature); } - app_log("--------------------------------------------"); + app_printf("--------------------------------------------"); sec_flag = time_seconds; } diff --git a/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp b/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp index 9b0f1bd7..9f930535 100644 --- a/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp +++ b/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m.slcp @@ -47,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/create_project.png @@ -58,6 +58,8 @@ other_file: directory: "image" - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/console_log.png directory: "image" + - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/print_float.png + directory: "image" ui_hints: highlight: diff --git a/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m_si91x.slcp b/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m_si91x.slcp new file mode 100644 index 00000000..c40df431 --- /dev/null +++ b/app/example/mikroe_rtc10_ds3231m/mikroe_rtc10_ds3231m_si91x.slcp @@ -0,0 +1,71 @@ +project_name: mikroe_rtc_ds3231 +package: platform +label: Third Party Hardware Drivers - DS3231M - RTC10 Click (Mikroe) +description: | + This example project shows an example for Mikroe RTC10 Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_rtc10_ds3231m/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: rtc10_ds3231m + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/create_project.png + directory: "image" + - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/software_layer.png + directory: "image" + - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_rtc10_ds3231m/image/print_float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_servo_pca9685/app.c b/app/example/mikroe_servo_pca9685/app.c index 95cee9e3..a5dab653 100644 --- a/app/example/mikroe_servo_pca9685/app.c +++ b/app/example/mikroe_servo_pca9685/app.c @@ -3,24 +3,64 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "sl_i2cspm_instances.h" + #include "sl_sleeptimer.h" -#include "app_log.h" #include "mikroe_pca9685.h" -#define INTERVAL_MSEC 10 +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#include "app_log.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#else +#include "sl_i2cspm_instances.h" +#endif + +#define INTERVAL_MSEC 10 + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif +static mikroe_i2c_handle_t app_i2c_instance = NULL; static mikroe_servo_pos_and_res_t pos_res_setting = { .min_position = 0, @@ -28,7 +68,6 @@ static mikroe_servo_pos_and_res_t pos_res_setting = .low_resolution = 0, .high_resolution = 330, }; - static sl_sleeptimer_timer_handle_t servo_position_handle; static int16_t count; static bool counter_clockwise = true; @@ -43,14 +82,18 @@ static void servo_position_cb(sl_sleeptimer_timer_handle_t *handle, void *data); void app_init(void) { sl_status_t sc; - - app_log("Application Initialization.\n"); - sc = mikroe_pca9685_init(sl_i2cspm_mikroe); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + app_printf("Application Initialization.\n"); + sc = mikroe_pca9685_init(app_i2c_instance); if (sc == SL_STATUS_OK) { - app_log("Mikroe Servo Click is initialized.\n"); + app_printf("Mikroe Servo Click is initialized.\n"); } else { - app_log("Mikroe Servo Click initialization failed.\n"); + app_printf("Mikroe Servo Click initialization failed.\n"); } mikroe_pca9685_default_cfg(); @@ -74,27 +117,27 @@ void app_process_action(void) } servo_position_expire = false; if (counter_clockwise) { - app_log("----------------------------\n"); - app_log("------Counter clockwise-----\n"); + app_printf("----------------------------\n"); + app_printf("------Counter clockwise-----\n"); count = pos_res_setting.min_position; while (count <= pos_res_setting.max_position) { if (adjust_position) { mikroe_pca9685_set_position(MIKROE_SERVO_MOTOR_1, count); - app_log("Position: %u\n", (uint16_t)count); + app_printf("Position: %u\n", (uint16_t)count); count++; adjust_position = false; } } } else { - app_log("---------------------------\n"); - app_log("---------Clockwise---------\n"); + app_printf("---------------------------\n"); + app_printf("---------Clockwise---------\n"); count = pos_res_setting.max_position; while (count >= pos_res_setting.min_position) { if (adjust_position) { mikroe_pca9685_set_position(MIKROE_SERVO_MOTOR_1, count); - app_log("Position: %u\n", (uint16_t)count); + app_printf("Position: %u\n", (uint16_t)count); count--; adjust_position = false; } diff --git a/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp b/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp index 9a0aadc7..851d15d4 100644 --- a/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp +++ b/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685.slcp @@ -43,7 +43,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_servo_pca9685/image/create_project.png diff --git a/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685_si91x.slcp b/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685_si91x.slcp new file mode 100644 index 00000000..a26c2c6c --- /dev/null +++ b/app/example/mikroe_servo_pca9685/mikroe_servo_pca9685_si91x.slcp @@ -0,0 +1,70 @@ +project_name: mikroe_servo +package: platform +label: Third Party Hardware Drivers - PCA9685 - Servo Click (Mikroe) +description: | + This example project shows an example for Mikroe Servo Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_servo_pca9685/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: servo_pca9685 + from: third_party_hw_drivers +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +define: + - name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_servo_pca9685/image/create_project.png + directory: "image" + - path: ../../documentation/example/mikroe_servo_pca9685/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_servo_pca9685/image/software_layer.png + directory: "image" + - path: ../../documentation/example/mikroe_servo_pca9685/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_servo_pca9685/image/servo_operation.gif + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_smoke2_adpd188bi/app.c b/app/example/mikroe_smoke2_adpd188bi/app.c index 9f4be14d..9ea0736d 100644 --- a/app/example/mikroe_smoke2_adpd188bi/app.c +++ b/app/example/mikroe_smoke2_adpd188bi/app.c @@ -3,38 +3,72 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ +#include "sl_sleeptimer.h" -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#else #include "app_log.h" -#include "sl_sleeptimer.h" -#include "sl_component_catalog.h" +#endif -#if defined(SL_CATALOG_SMOKE2_ADPD188BI_I2C_PRESENT) -#include "sl_i2cspm_instances.h" #include "mikroe_adpd188bi_i2c.h" -#elif defined(SL_CATALOG_SMOKE2_ADPD188BI_SPI_PRESENT) -#include "sl_spidrv_instances.h" -#include "mikroe_adpd188bi_spi.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#else +#include "sl_i2cspm_instances.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; #endif -#define SMOKE_THRESHOLD_VALUE 500 +#define SMOKE_THRESHOLD_VALUE 500 -#define EXAMPLE_MODE_SMOKE 0 -#define EXAMPLE_MODE_PROXIMITY 1 -#define EXAMPLE_MODE EXAMPLE_MODE_SMOKE +#define EXAMPLE_MODE_SMOKE 0 +#define EXAMPLE_MODE_PROXIMITY 1 +#define EXAMPLE_MODE EXAMPLE_MODE_SMOKE + +static mikroe_i2c_handle_t app_i2c_instance = NULL; #if (EXAMPLE_MODE == EXAMPLE_MODE_SMOKE) static void smoke_example (void); @@ -47,42 +81,44 @@ static void proximity_example (void); void app_init(void) { sl_status_t stt; -#if defined(SL_CATALOG_SMOKE2_ADPD188BI_I2C_PRESENT) - app_log("Mikroe Smoke 2 Click - I2C Interface example\r\n"); - stt = mikroe_adpd188bi_init(sl_i2cspm_mikroe); -#elif defined(SL_CATALOG_SMOKE2_ADPD188BI_SPI_PRESENT) - app_log("Mikroe Smoke 2 Click - SPI Interface example\r\n"); - stt = mikroe_adpd188bi_init(sl_spidrv_mikroe_handle); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; #endif - app_log("mikroe_adpd188bi_init = 0x%x\r\n", (uint16_t)stt); + app_printf("Mikroe Smoke 2 Click - I2C Interface example\r\n"); + stt = mikroe_adpd188bi_init(app_i2c_instance); + app_printf("mikroe_adpd188bi_init = 0x%lx\r\n", stt); mikroe_adpd188bi_soft_reset(); - app_log("mikroe_adpd188bi_soft_reset\r\n"); + app_printf("mikroe_adpd188bi_soft_reset\r\n"); mikroe_adpd188bi_set_mode(MIKROE_ADPD188BI_MODE_IDLE); - app_log("mikroe_adpd188bi_set_mode MIKROE_ADPD188BI_MODE_IDLE\r\n"); + app_printf("mikroe_adpd188bi_set_mode MIKROE_ADPD188BI_MODE_IDLE\r\n"); uint16_t devid = mikroe_adpd188bi_read_data(MIKROE_ADPD188BI_REG_DEVID); - app_log("Smoke2 Click ID: 0x%.2X\r\n", ( uint16_t ) (devid & 0xFF)); - app_log("Smoke2 Click REV: 0x%.2X\r\n", ( uint16_t ) ((devid >> 8) & 0xFF)); + app_printf("Smoke2 Click ID: 0x%.2X\r\n", ( uint16_t ) (devid & 0xFF)); + app_printf("Smoke2 Click REV: 0x%.2X\r\n", + ( uint16_t ) ((devid >> 8) & 0xFF)); sl_sleeptimer_delay_millisecond(1000); mikroe_adpd188bi_default_cfg(); - app_log("mikroe_adpd188bi_default_cfg\r\n"); + app_printf("mikroe_adpd188bi_default_cfg\r\n"); #if (EXAMPLE_MODE == EXAMPLE_MODE_SMOKE) - app_log("SMOKE MODE \r\n"); - app_log("Calibration Start\r\n"); + app_printf("SMOKE MODE \r\n"); + app_printf("Calibration Start\r\n"); uint16_t calib_data = mikroe_adpd188bi_smoke_calibration( SMOKE_THRESHOLD_VALUE); - app_log("Calibration data: %u\r\n", calib_data); + app_printf("Calibration data: %u\r\n", calib_data); #elif (EXAMPLE_MODE == EXAMPLE_MODE_PROXIMITY) - app_log("PROXIMITY MODE \r\n"); + app_printf("PROXIMITY MODE \r\n"); #endif - app_log("Application Task \r\n"); + app_printf("Application Task \r\n"); } /***************************************************************************//** @@ -105,11 +141,11 @@ static void smoke_example(void) if (last_state != smoke_detected) { if (MIKROE_ADPD188BI_SMOKE_DETECTED == smoke_detected) { - app_log("SMOKE_DETECTED <<\r\n"); + app_printf("SMOKE_DETECTED <<\r\n"); } else if (MIKROE_ADPD188BI_SMOKE_NOT_DETECTED == smoke_detected) { - app_log("SMOKE_CLEAR <<\r\n"); + app_printf("SMOKE_CLEAR <<\r\n"); } else { - app_log("ERROR <<\r\n"); + app_printf("ERROR <<\r\n"); for ( ; ; ) {} } last_state = smoke_detected; @@ -129,24 +165,24 @@ static void proximity_example(void) if (0 != slot_a_int) { sens_data = mikroe_adpd188bi_read_sens_data(MIKROE_ADPD188BI_SLOT_A, MIKROE_ADPD188BI_CHN_1); - app_log("DATA A: %d\r\n", sens_data); + app_printf("DATA A: %d\r\n", sens_data); slot_a_int = 0; sl_sleeptimer_delay_millisecond(100); } if (0 != slot_b_int) { sens_data = mikroe_adpd188bi_read_sens_data(MIKROE_ADPD188BI_SLOT_B, MIKROE_ADPD188BI_CHN_1); - app_log("DATA B: %d\r\n", sens_data); + app_printf("DATA B: %d\r\n", sens_data); slot_b_int = 0; sl_sleeptimer_delay_millisecond(100); } if (0 != fifo_int) { - app_log("Fifo int: --------------------\r\n"); + app_printf("Fifo int: --------------------\r\n"); for ( uint8_t fifo_cnt = 0; fifo_cnt < fifo_int; fifo_cnt++ ) { sens_data = mikroe_adpd188bi_read_data( MIKROE_ADPD188BI_REG_FIFO_ACCESS); - app_log("FIFO: %d\r\n", sens_data); + app_printf("FIFO: %d\r\n", sens_data); } sl_sleeptimer_delay_millisecond(100); } diff --git a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp index abf621fe..b10cb69e 100644 --- a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp +++ b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c.slcp @@ -44,7 +44,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png diff --git a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_spi.slcp b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c_si91x.slcp similarity index 75% rename from app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_spi.slcp rename to app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c_si91x.slcp index ae1f1c17..f8c7ad77 100644 --- a/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_spi.slcp +++ b/app/example/mikroe_smoke2_adpd188bi/mikroe_smoke2_adpd188bi_i2c_si91x.slcp @@ -1,8 +1,8 @@ -project_name: mikroe_smoke2_adpd188bi_spi +project_name: mikroe_smoke2_adpd188bi_i2c_si91x package: platform -label: Third Party Hardware Drivers - ADPD188BI - Smoke 2 Click (Mikroe) - SPI +label: Third Party Hardware Drivers - ADPD188BI - Smoke 2 Click (Mikroe) description: | - This example project shows an example for Smoke 2 Click (Mikroe) using SPI Interface. + This example project shows an example for Smoke 2 Click (Mikroe) using I2C Interface. category: Example|Platform quality: evaluation @@ -28,23 +28,23 @@ include: component: - id: sl_system -- id: device_init -- id: smoke2_adpd188bi_spi +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: smoke2_adpd188bi_i2c from: third_party_hw_drivers -- id: iostream_eusart - instance: [vcom] -- id: spidrv - instance: [mikroe] -- id: sleeptimer -- id: app_log - -toolchain_settings: -define: -- name: DEBUG_EFM +- id: sleeptimer_si91x + from: wiseconnect3_sdk sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 other_file: - path: ../../documentation/example/mikroe_smoke2_adpd188bi/image/create_example.png @@ -62,8 +62,10 @@ other_file: - path: ../../documentation/example/mikroe_smoke2_adpd188bi/image/smoke2_click_details.png directory: "image" - ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp b/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp index dd244efa..94a5861b 100644 --- a/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp +++ b/app/example/mikroe_stepper2_a4988/mikroe_stepper2_a4988.slcp @@ -42,7 +42,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_stepper2_a4988/image/create_example.png diff --git a/app/example/mikroe_stepper_a3967/app.c b/app/example/mikroe_stepper_a3967/app.c index 3a082196..c8cdf018 100644 --- a/app/example/mikroe_stepper_a3967/app.c +++ b/app/example/mikroe_stepper_a3967/app.c @@ -3,21 +3,52 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # EXPERIMENTAL QUALITY + * This code has not been formally tested and is provided as-is. + * It is not suitable for production environments. + * This code will not be maintained. ******************************************************************************/ + #include "mikroe_a3967.h" -#include "app_log.h" #include "sl_sleeptimer.h" +#if (defined(SLI_SI917)) + +#include "rsi_debug.h" +#else +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + // The 28BYJ-48 motor features a 1/64 reduction gear set. #define MOTOR_GEAR_RATIO 64 @@ -28,7 +59,7 @@ void app_init(void) { sl_status_t sc = SL_STATUS_OK; - app_log("Stepper Click demo application!!!\r\n"); + app_printf("Stepper Click demo application!!!\r\n"); // specifications of the motor mikroe_a3967_init(); @@ -36,13 +67,13 @@ void app_init(void) mikroe_a3967_set_step_frequency(500); mikroe_a3967_config_mode(MIKROE_A3967_FULL_STEP); - app_log("A3967 Stepper Start\r\n"); + app_printf("A3967 Stepper Start\r\n"); // The 28BYJ-48 motor have 64 steps per revolution. // So it need (64 * MOTOR_GEAR_RATIO) step to complete one revolution. sc = mikroe_a3967_step(16 * MOTOR_GEAR_RATIO); if (sc != SL_STATUS_OK) { - app_log("error code = 0x%lx\r\n", sc); + app_printf("error code = 0x%lx\r\n", sc); } // Need to wait until the motor stop @@ -50,7 +81,7 @@ void app_init(void) mikroe_a3967_set_direction(MIKROE_A3967_COUNTERCLOCKWISE); sc = mikroe_a3967_step(32 * MOTOR_GEAR_RATIO); if (sc != SL_STATUS_OK) { - app_log("error code = 0x%lx\r\n", sc); + app_printf("error code = 0x%lx\r\n", sc); } // Need to wait until the motor stop @@ -58,7 +89,7 @@ void app_init(void) mikroe_a3967_set_direction(MIKROE_A3967_CLOCKWISE); sc = mikroe_a3967_step(64 * MOTOR_GEAR_RATIO); if (sc != SL_STATUS_OK) { - app_log("error code = 0x%lx\r\n", sc); + app_printf("error code = 0x%lx\r\n", sc); } } diff --git a/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp b/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp index d5f78c05..40929240 100644 --- a/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp +++ b/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967.slcp @@ -40,7 +40,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_stepper_a3967/image/create_example.png diff --git a/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967_si91x.slcp b/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967_si91x.slcp new file mode 100644 index 00000000..568b6291 --- /dev/null +++ b/app/example/mikroe_stepper_a3967/mikroe_stepper_a3967_si91x.slcp @@ -0,0 +1,63 @@ +project_name: mikroe_stepper_a3967_si91x +package: platform +label: Third Party Hardware Drivers - A3967 - Stepper Click (Mikroe) +description: | + This example project shows an example for A3967 - Stepper Click (Mikroe). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_stepper_a3967/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mikroe_stepper_a3967 + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_stepper_a3967/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_stepper_a3967/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_stepper_a3967/image/pwm.png + directory: "image" + - path: ../../documentation/example/mikroe_stepper_a3967/image/test.gif + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_stretch/app.c b/app/example/mikroe_stretch/app.c index 879d118a..8ac52b23 100644 --- a/app/example/mikroe_stretch/app.c +++ b/app/example/mikroe_stretch/app.c @@ -1,28 +1,63 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#include "em_iadc.h" #include "sl_status.h" -#include "app_log.h" #include "sl_sleeptimer.h" #include "mikroe_stretch.h" +#if (defined(SLI_SI917)) +#include "sl_adc_instances.h" +#include "rsi_debug.h" +#else +#include "em_iadc.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +static uint8_t channel = SL_ADC_CHANNEL_1; +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + static volatile bool stretch_timer_expire = false; static sl_sleeptimer_timer_handle_t stretch_timer; +static mikroe_adc_handle_t app_adc_handle = NULL; static void stretch_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, void *data); @@ -32,15 +67,32 @@ static void stretch_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, ******************************************************************************/ void app_init(void) { - app_log("Application Init\n"); + sl_status_t status; + app_printf("Application Init\n"); + +#if (defined(SLI_SI917)) + app_adc_handle = &channel; +#else + app_adc_handle = IADC0; +#endif + status = mikroe_stretch_init(app_adc_handle); +#if (defined(SLI_SI917)) - if (mikroe_stretch_init(IADC0) != SL_STATUS_OK) { - app_log("Application Init Error!\n"); - app_log("Please, run program again ...\n"); + /** + * Due to calling trim_efuse API on ADC init in driver + * it will change the clock frequency, + * if we are not initialize the debug again + * it will print the garbage data in console output. + */ + DEBUGINIT(); +#endif + if (status != SL_STATUS_OK) { + app_printf("Application Init Error!\n"); + app_printf("Please, run program again ...\n"); for (;;) {} } - app_log("Stretch Click is initialized.\n"); + app_printf("Stretch Click is initialized.\n"); sl_sleeptimer_start_periodic_timer_ms(&stretch_timer, 500, stretch_sleeptimer_callback, @@ -59,13 +111,13 @@ void app_process_action(void) if (stretch_timer_expire == true) { stretch_timer_expire = false; if (mikroe_stretch_generic_read(&stretch_an_value) == SL_STATUS_OK) { - app_log("ADC Value: %u\r\n", stretch_an_value); + app_printf("ADC Value: %u\r\n", stretch_an_value); if (stretch_an_value < 500) { mikroe_stretch_turn_on_led(); } else { mikroe_stretch_turn_off_led(); } - app_log("Resistance Value: %u\r\n", stretch_an_value); + app_printf("Resistance Value: %u\r\n", stretch_an_value); } } } diff --git a/app/example/mikroe_stretch/mikroe_stretch.slcp b/app/example/mikroe_stretch/mikroe_stretch.slcp index 7a060c83..9925daeb 100644 --- a/app/example/mikroe_stretch/mikroe_stretch.slcp +++ b/app/example/mikroe_stretch/mikroe_stretch.slcp @@ -41,7 +41,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_stretch/image/console_log.png diff --git a/app/example/mikroe_stretch/mikroe_stretch_si91x.slcp b/app/example/mikroe_stretch/mikroe_stretch_si91x.slcp new file mode 100644 index 00000000..1d127357 --- /dev/null +++ b/app/example/mikroe_stretch/mikroe_stretch_si91x.slcp @@ -0,0 +1,70 @@ +project_name: mikroe_stretch +package: platform +label: Third Party Hardware Drivers - Stretch Click (Mikroe) +description: | + This example project shows an example for Mikroe Stretch Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_stretch/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_stretch + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance + +define: + - name: DEBUG_EFM + +sdk_extension: +- id: wiseconnect3_sdk + version: 3.3.4 +- id: third_party_hw_drivers + version: 4.0.0 + +other_file: + - path: ../../documentation/example/mikroe_stretch/image/console_log.png + directory: "image" + - path: ../../documentation/example/mikroe_stretch/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_stretch/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_stretch/image/software_component.png + directory: "image" + - path: ../../documentation/example/mikroe_stretch/image/software_layer.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_temphum15_sht40/app.c b/app/example/mikroe_temphum15_sht40/app.c index cd505507..d9576ace 100644 --- a/app/example/mikroe_temphum15_sht40/app.c +++ b/app/example/mikroe_temphum15_sht40/app.c @@ -1,32 +1,69 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application + * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" +#include "sl_sleeptimer.h" #include "mikroe_sht40.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" -#include "sl_sleeptimer.h" +#include "app_log.h" +#endif -#define READING_INTERVAL_MSEC 1000 +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define READING_INTERVAL_MSEC 1000 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool trigger_process = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -35,21 +72,28 @@ void app_init(void) sl_status_t stt; uint32_t sht40_serial; - app_log("Hello World - Mikroe Temp&Hum 15 SHT40 example\r\n"); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif - stt = mikroe_sht40_init(sl_i2cspm_mikroe); - app_log("mikroe_sht40_init = 0x%x\r\n", (uint16_t)stt); + app_printf("Hello World - Mikroe Temp&Hum 15 SHT40 example\r\n"); + + stt = mikroe_sht40_init(app_i2c_instance); + app_printf("mikroe_sht40_init = 0x%lx\r\n", stt); stt = mikroe_sht40_read_serial(&sht40_serial); - app_log("mikroe_sht40_read_serial = 0x%x Serial = 0x%lx\r\n", - (uint16_t)stt, sht40_serial); - app_log("sl_sleeptimer_start_periodic = 0x%lx\r\n", - sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, - READING_INTERVAL_MSEC, - app_timer_callback, - NULL, - 0, - 0)); + app_printf("mikroe_sht40_read_serial = 0x%lx Serial = 0x%lx\r\n", + stt, sht40_serial); + + stt = sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_callback, + NULL, + 0, + 0); + app_printf("sl_sleeptimer_start_periodic = 0x%lx\r\n", stt); } /***************************************************************************//** @@ -66,12 +110,12 @@ void app_process_action(void) stt = mikroe_sht40_get_temp_and_hum(mikroe_sht40_precision_mode_high, &sht40_data); if (SL_STATUS_OK == stt) { - app_log("temperature = %0.2f%cC, humidity = %0.2f %%\r\n", - sht40_data.temperature, - 176, - sht40_data.humidity); + app_printf("temperature = %0.2f%cC, humidity = %0.2f %%\r\n", + sht40_data.temperature, + 176, + sht40_data.humidity); } else { - app_log("mikroe_sht40_get_temp_and_hum error = 0x%lx\r\n", stt); + app_printf("mikroe_sht40_get_temp_and_hum error = 0x%lx\r\n", stt); } } } diff --git a/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp b/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp index 356e5043..b01b13ac 100644 --- a/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp +++ b/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40.slcp @@ -2,7 +2,7 @@ project_name: mikroe_temphum15_sht40 package: platform label: Third Party Hardware Drivers - SHT40 - Temp&Hump 15 Click (Mikroe) description: | - This example project shows an example for Mikroe Temp&Hum 15 Click board integration.. + This example project shows an example for Mikroe Temp&Hum 15 Click board integration. category: Example|Platform quality: evaluation @@ -47,19 +47,17 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_temphum15_sht40/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_temphum15_sht40/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_temphum15_sht40/image/float.png - directory: "image" - path: ../../documentation/example/mikroe_temphum15_sht40/image/log.png directory: "image" ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40_si91x.slcp b/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40_si91x.slcp new file mode 100644 index 00000000..e78b0a2f --- /dev/null +++ b/app/example/mikroe_temphum15_sht40/mikroe_temphum15_sht40_si91x.slcp @@ -0,0 +1,63 @@ +project_name: mikroe_temphum15_sht40_si91x +package: platform +label: Third Party Hardware Drivers - SHT40 - Temp&Hump 15 Click (Mikroe) +description: | + This example project shows an example for Mikroe Temp&Hum 15 Click board integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_temphum15_sht40/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_temphum15 + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_temphum15_sht40/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_temphum15_sht40/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_temphum15_sht40/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp index 95085f94..19227850 100644 --- a/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp +++ b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3.slcp @@ -47,12 +47,10 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png + - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_temphum9_shtc3/image/hardware_connection.png directory: "image" diff --git a/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3_si91x.slcp b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3_si91x.slcp index 90b2b082..7c04b58a 100644 --- a/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3_si91x.slcp +++ b/app/example/mikroe_temphum9_shtc3/mikroe_temphum9_shtc3_si91x.slcp @@ -1,8 +1,8 @@ project_name: mikroe_temphum9_shtc3_si91x package: platform -label: Third Party Hardware Drivers - SHTC3 - Temp&Hum 9 Click (Mikroe) - Si91x +label: Third Party Hardware Drivers - SHTC3 - Temp&Hum 9 Click (Mikroe) description: | - This example project shows an example for Mikroe Temp&Hum 9 Click board driver integration on Si91x. + This example project shows an example for Mikroe Temp&Hum 9 Click board driver integration. category: Example|Platform quality: evaluation @@ -42,14 +42,12 @@ component: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 other_file: - - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example_2.png + - path: ../../documentation/example/mikroe_temphum9_shtc3/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_temphum9_shtc3/image/hardware_connection.png directory: "image" diff --git a/app/example/mikroe_thunder_as3935/app.c b/app/example/mikroe_thunder_as3935/app.c index 56a36727..71ffe252 100644 --- a/app/example/mikroe_thunder_as3935/app.c +++ b/app/example/mikroe_thunder_as3935/app.c @@ -3,33 +3,61 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "sl_spidrv_instances.h" #include "sl_sleeptimer.h" -#include "app_log.h" #include "mikroe_thunder_as3935.h" #define READING_INTERVAL_MSEC 1000 +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_ssi.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) + +static sl_ssi_instance_t ssi_instance = SL_SSI_MASTER_ACTIVE; +#else /* None Si91x device */ +#include "app_log.h" +#include "sl_spidrv_instances.h" + +#define app_printf(...) app_log(__VA_ARGS__) +#endif + static volatile bool flag = false; -static uint8_t storm_mode; -static uint32_t storm_energy; -static uint8_t storm_distance; static sl_sleeptimer_timer_handle_t app_timer_handle; +static mikroe_spi_handle_t app_spi_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -38,17 +66,23 @@ void app_init(void) { sl_status_t sc; - app_log("---- Application Init ----\r\n"); +#if (defined(SLI_SI917)) + app_spi_instance = &ssi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif - sc = mikroe_thunder_as3935_init(sl_spidrv_mikroe_handle); + app_printf("---- Application Init ----\r\n"); + + sc = mikroe_thunder_as3935_init(app_spi_instance); if (sc != SL_STATUS_OK) { - app_log("---- Application Init Error ----"); - app_log("---- Please, run program again ----"); + app_printf("---- Application Init Error ----"); + app_printf("---- Please, run program again ----"); for ( ; ; ) {} } mikroe_thunder_as3935_default_cfg(); - app_log("---- Application Init Done ----\r\n"); + app_printf("---- Application Init Done ----\r\n"); sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, READING_INTERVAL_MSEC, app_timer_cb, @@ -62,17 +96,22 @@ void app_init(void) ******************************************************************************/ void app_process_action(void) { + uint8_t storm_mode; + uint32_t storm_energy; + uint8_t storm_distance; + if (flag) { storm_mode = mikroe_thunder_as3935_check_int(); if (THUNDER_NOISE_LEVEL_INTERR == storm_mode) { - app_log("Noise level too high\r\n\n"); + app_printf("Noise level too high\r\n\n"); } else if (THUNDER_DISTURBER_INTERR == storm_mode) { - app_log("Disturber detected\r\n\n"); + app_printf("Disturber detected\r\n\n"); } else if (THUNDER_LIGHTNING_INTERR == storm_mode) { mikroe_thunder_as3935_get_storm_info(&storm_energy, &storm_distance); - app_log("Energy of the single lightning : %lu\r\n", storm_energy); - app_log("Distance estimation : %u km\r\n\n", ( uint16_t ) storm_distance); + app_printf("Energy of the single lightning : %lu\r\n", storm_energy); + app_printf("Distance estimation : %u km\r\n\n", + ( uint16_t ) storm_distance); // Reset configuration to prepare for the next measurement mikroe_thunder_as3935_default_cfg(); } diff --git a/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp b/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp index 95969723..3055bc67 100644 --- a/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp +++ b/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935.slcp @@ -38,30 +38,28 @@ component: - id: sleeptimer - id: app_log +configuration: + - name: SL_SPIDRV_MIKROE_CS_CONTROL + value: "spidrvCsControlApplication" + define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_thunder_as3935/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_thunder_as3935/image/hardware_connection.png directory: "image" - - path: ../../documentation/example/mikroe_thunder_as3935/image/mikroe_spi_config.png - directory: "image" - path: ../../documentation/example/mikroe_thunder_as3935/image/result.png directory: "image" - -configuration: - - name: SL_SPIDRV_MIKROE_CS_CONTROL - value: "spidrvCsControlApplication" - - name: SL_SPIDRV_MIKROE_CLOCK_MODE - value: "spidrvClockMode1" + - path: ../../documentation/example/mikroe_thunder_as3935/image/spi_config.png + directory: "image" ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935_si91x.slcp b/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935_si91x.slcp new file mode 100644 index 00000000..85be6bf9 --- /dev/null +++ b/app/example/mikroe_thunder_as3935/mikroe_thunder_as3935_si91x.slcp @@ -0,0 +1,62 @@ +project_name: mikroe_thunder +package: platform +label: Third Party Hardware Drivers - AS3935 - Thunder Click (Mikroe) +description: | + This example project shows an example for Third Party Hardware Drivers - AS3935 - Thunder Click (Mikroe) integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_thunder_as3935/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_thunder + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_thunder_as3935/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_thunder_as3935/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_thunder_as3935/image/result.png + directory: "image" + - path: ../../documentation/example/mikroe_thunder_as3935/image/spi_config.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_turbidity_tsd10/app.c b/app/example/mikroe_turbidity_tsd10/app.c index 9f11b5d2..0baa486f 100644 --- a/app/example/mikroe_turbidity_tsd10/app.c +++ b/app/example/mikroe_turbidity_tsd10/app.c @@ -1,44 +1,86 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "app_log.h" #include "mikroe_tsd10.h" -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" #include "sl_status.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + static float sensor_ntu_value; static volatile bool turbidity_timer_expire = false; static sl_sleeptimer_timer_handle_t turbidity_timer; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void turbidity_sleeptimer_callback(sl_sleeptimer_timer_handle_t *timer, void *data); void app_init(void) { - app_log("Mikroe Turbidity - TSD10 sensor example\r\n"); + app_printf("Mikroe Turbidity - TSD10 sensor example\r\n"); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif - if (SL_STATUS_OK == mikroe_turbidity_init(sl_i2cspm_mikroe)) { - app_log("Sensor initialization done.\n"); + if (SL_STATUS_OK == mikroe_turbidity_init(app_i2c_instance)) { + app_printf("Sensor initialization done.\n"); } else { - app_log("Sensor initialization failed.\n"); + app_printf("Sensor initialization failed.\n"); } sl_sleeptimer_start_periodic_timer_ms(&turbidity_timer, @@ -60,9 +102,9 @@ void app_process_action(void) ret = mikroe_turbidity_get_ntu(&sensor_ntu_value); if (SL_STATUS_OK == ret) { - app_log("NTU value: %.2f\n", sensor_ntu_value); + app_printf("NTU value: %.2f\n", sensor_ntu_value); } else { - app_log("Sensor read failed\n"); + app_printf("Sensor read failed\n"); } } } diff --git a/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp b/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp index a3f21881..f4634c92 100644 --- a/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp +++ b/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10.slcp @@ -47,7 +47,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_turbidity_tsd10/image/create_example.png @@ -66,4 +66,4 @@ other_file: ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10_si91x.slcp b/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10_si91x.slcp new file mode 100644 index 00000000..69bca8a6 --- /dev/null +++ b/app/example/mikroe_turbidity_tsd10/mikroe_turbidity_tsd10_si91x.slcp @@ -0,0 +1,73 @@ +project_name: mikroe_turbidity_tsd10_si91x +package: platform +label: Third Party Hardware Drivers - TSD-10 - Turbidity Click (Mikroe) +description: | + This example project shows an example for Third Party Hardware Drivers - TSD-10 - Turbidity 15 Click (Mikroe) integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_turbidity_tsd10/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: turbidity_tsd10 + from: third_party_hw_drivers +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +other_file: + - path: ../../documentation/example/mikroe_turbidity_tsd10/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_turbidity_tsd10/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/mikroe_turbidity_tsd10/image/float.png + directory: "image" + - path: ../../documentation/example/mikroe_turbidity_tsd10/image/hardware_connection1.png + directory: "image" + - path: ../../documentation/example/mikroe_turbidity_tsd10/image/driver_layer.png + directory: "image" + - path: ../../documentation/example/mikroe_turbidity_tsd10/image/log.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_utm7segr_max6969/app.c b/app/example/mikroe_utm7segr_max6969/app.c index 81700dbf..535b3fc6 100644 --- a/app/example/mikroe_utm7segr_max6969/app.c +++ b/app/example/mikroe_utm7segr_max6969/app.c @@ -1,9 +1,9 @@ /***************************************************************************//** - * @file + * @file app.c * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -27,25 +27,33 @@ * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ - -#include "sl_spidrv_instances.h" -#include "sl_pwm_instances.h" +#include "mikroe_max6969.h" #include "sl_sleeptimer.h" +#include "sl_pwm_instances.h" +#include "app_assert.h" -#include "mikroe_max6969.h" +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_gspi.h" +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else /* None Si91x device */ +#include "app_log.h" +#include "sl_spidrv_instances.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define TIMEOUT_MS 1000 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; +mikroe_pwm_handle_t app_pwm_instance = NULL; +static mikroe_spi_handle_t app_spi_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -54,7 +62,34 @@ static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); ******************************************************************************/ void app_init(void) { - mikroe_max6969_init(sl_spidrv_mikroe_handle, &sl_pwm_mikroe); + app_printf("UT-M 7-SEG R Click Example\r\n"); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; + app_pwm_instance = &sl_pwm_channel_0_config; +#else + app_spi_instance = sl_spidrv_mikroe_handle; + app_pwm_instance = &sl_pwm_mikroe; +#endif + sl_status_t stt = mikroe_max6969_init(app_spi_instance, app_pwm_instance); + app_assert_status(stt); + + mikroe_max6969_display_number(0x00, MIKROE_UTM7SEGR_NO_DOT); + app_printf("UT-M 7-SEG R Test contrast:\r\n"); + app_printf("Value(%%):"); + + for (uint8_t i = 0; i < 10; i++) + { + uint8_t contrast_value = (i + 1) * 10; + app_printf(" %02d", contrast_value); + mikroe_max6969_set_contrast(contrast_value); + + sl_sleeptimer_delay_millisecond(1000); + } + + app_printf("\r\nUT-M 7-SEG R set contrast default: 50%%\r\n"); + mikroe_max6969_set_contrast(50); + + app_printf("Start periodic timer %d(ms)\r\n", TIMEOUT_MS); sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, TIMEOUT_MS, app_timer_cb, @@ -74,8 +109,8 @@ void app_process_action(void) return; } app_timer_expire = false; - - mikroe_max6969_display_number(cnt, MIKROE_UTM7SEGR_DOT_LEFT); + app_printf("mikroe_max6969_display_number: %d\r\n", cnt); + mikroe_max6969_display_number(cnt, MIKROE_UTM7SEGR_NO_DOT); cnt++; if (cnt >= 100) { cnt = 0; diff --git a/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp b/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp index 436ee2a2..c96be691 100644 --- a/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp +++ b/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969.slcp @@ -27,8 +27,12 @@ include: - path: app.h component: +- id: app_assert +- id: app_log - id: sl_system - id: device_init +- id: iostream_eusart + instance: [vcom] - id: mikroe_utm7segr from: third_party_hw_drivers - id: spidrv @@ -42,7 +46,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/mikroe_utm7segr_max6969/image/create_example.png diff --git a/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969_si91x.slcp b/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969_si91x.slcp new file mode 100644 index 00000000..78851838 --- /dev/null +++ b/app/example/mikroe_utm7segr_max6969/mikroe_utm7segr_max6969_si91x.slcp @@ -0,0 +1,64 @@ +project_name: mikroe_utm7segr_max6969 +label: Third Party Hardware Drivers - MAX6969 - UT-M 7-SEG R Click (Mikroe) +package: platform +description: | + This example project shows an example for Mikroe UT-M 7-SEG R Click board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_utm7segr_max6969/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: app_assert +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [channel_0] + from: wiseconnect3_sdk + id: pwm_instance +- id: mikroe_utm7segr + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/mikroe_utm7segr_max6969/image/create_example.png + directory: "image" + - path: ../../documentation/example/mikroe_utm7segr_max6969/image/image_test.png + directory: "image" + - path: ../../documentation/example/mikroe_utm7segr_max6969/image/hardware_connection.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/mikroe_uv_ml8511a/app.c b/app/example/mikroe_uv_ml8511a/app.c index 72e8aacd..74605443 100644 --- a/app/example/mikroe_uv_ml8511a/app.c +++ b/app/example/mikroe_uv_ml8511a/app.c @@ -3,28 +3,67 @@ * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ +#include "sl_sleeptimer.h" +#include "mikroe_ml8511a.h" +#include "mikroe_ml8511a_config.h" -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ +#if (defined(SLI_SI917)) +#include "sl_adc_instances.h" +#include "sl_si91x_gspi.h" +#include "rsi_debug.h" +#else +#include "em_iadc.h" #include "sl_spidrv_instances.h" -#include "sl_sleeptimer.h" #include "app_log.h" -#include "mikroe_ml8511a.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#define READING_INTERVAL_MSEC 1000 -#define READING_INTERVAL_MSEC 1000 +#if (defined(SLI_SI917)) +static uint8_t channel = SL_ADC_CHANNEL_1; +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#endif +static mikroe_adc_handle_t app_adc_instance = NULL; +static mikroe_spi_handle_t app_spi_instance = NULL; static volatile bool uv_timer_expire = false; static sl_sleeptimer_timer_handle_t uv_timer; @@ -35,19 +74,38 @@ void app_init(void) { sl_status_t sc; - app_log("---- Application Init ----\r\n"); +#if (defined(SLI_SI917)) + app_adc_instance = &channel; + app_spi_instance = &gspi_instance; +#else + app_adc_instance = IADC0; + app_spi_instance = sl_spidrv_mikroe_handle; +#endif - sc = mikroe_ml8511a_init(sl_spidrv_mikroe_handle); + app_printf("---- Application Init ----\r\n"); + + sc = mikroe_ml8511a_init(app_spi_instance, app_adc_instance); + +#if (defined(SLI_SI917)) + + /** + * Due to calling trim_efuse API on ADC init in driver + * it will change the clock frequency, + * if we are not initialize the debug again + * it will print the garbage data in console output. + */ + DEBUGINIT(); +#endif if (sc != SL_STATUS_OK) { - app_log("---- Application Init Error ----"); - app_log("---- Please, run program again ----"); + app_printf("---- Application Init Error ----"); + app_printf("---- Please, run program again ----"); for ( ; ; ) {} } mikroe_ml8511a_set_callback_handler(application_callback); mikroe_ml8511a_device_enable(); sl_sleeptimer_delay_millisecond(1000); - app_log("---- Application Init Done ----\r\n"); + app_printf("---- Application Init Done ----\r\n"); sl_sleeptimer_start_periodic_timer_ms(&uv_timer, READING_INTERVAL_MSEC, uv_timer_cb, @@ -69,18 +127,23 @@ void app_process_action(void) } uv_timer_expire = false; +#if MIKROE_ML8511A_OPERATION_MODE == ADC_MODE if (mikroe_ml8511a_read_adc_voltage(&uv_voltage) == SL_STATUS_OK) { mikroe_ml8511a_calc_index(uv_voltage, &uv_index); - - app_log(" UV Index [0-15] : %u\r\n", (uint16_t)uv_index); - app_log(" UV ADC Voltage [V] : %.2f\r\n", uv_voltage); - app_log("------------------------------\r\n"); } +#elif MIKROE_ML8511A_OPERATION_MODE == AN_MODE + mikroe_ml8511a_read_an_pin_voltage(&uv_voltage); + mikroe_ml8511a_calc_index(uv_voltage, &uv_index); +#endif + + app_printf(" UV Index [0-15] : %u\r\n", (uint16_t)uv_index); + app_printf(" UV ADC Voltage [V] : %.2f\r\n", uv_voltage); + app_printf("------------------------------\r\n"); } static void application_callback(char *message) { - app_log("*** %s ***\r\n", message); + app_printf("*** %s ***\r\n", message); } static void uv_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data) diff --git a/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp b/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp index fe2b5576..084fe078 100644 --- a/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp +++ b/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a.slcp @@ -5,6 +5,7 @@ description: | This example project shows an example for Third Party Hardware Drivers - ML8511A - UV Click (Mikroe) integration. category: Example|Platform quality: evaluation + filter: - name: Device Type value: [SoC] @@ -12,15 +13,19 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] + readme: - path: ../../documentation/example/mikroe_uv_ml8511a/README.md + source: - path: app.c - path: main.c + include: - path: '' file_list: - path: app.h + component: - id: sl_system - id: device_init @@ -32,14 +37,18 @@ component: instance: [mikroe] - id: sleeptimer - id: app_log + toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" + define: - name: DEBUG_EFM + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 + other_file: - path: ../../documentation/example/mikroe_uv_ml8511a/image/hardware_connection.png directory: image @@ -49,6 +58,7 @@ other_file: directory: image - path: ../../documentation/example/mikroe_uv_ml8511a/image/float.png directory: image + ui_hints: highlight: - path: README.md diff --git a/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a_si91x.slcp b/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a_si91x.slcp new file mode 100644 index 00000000..b1707dd4 --- /dev/null +++ b/app/example/mikroe_uv_ml8511a/mikroe_uv_ml8511a_si91x.slcp @@ -0,0 +1,72 @@ +project_name: mikroe_uv_ml8511a_si91x +label: Third Party Hardware Drivers - ML8511A - UV Click (Mikroe) +package: platform +description: | + This example project shows an example for Third Party Hardware Drivers - ML8511A - UV Click (Mikroe) integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/mikroe_uv_ml8511a/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: mikroe_uv + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [channel_1] + from: wiseconnect3_sdk + id: adc_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +other_file: + - path: ../../documentation/example/mikroe_uv_ml8511a/image/hardware_connection.png + directory: image + - path: ../../documentation/example/mikroe_uv_ml8511a/image/create_example.png + directory: image + - path: ../../documentation/example/mikroe_uv_ml8511a/image/result.png + directory: image + - path: ../../documentation/example/mikroe_uv_ml8511a/image/float.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp b/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp index a8e71563..4731f197 100644 --- a/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp +++ b/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000.slcp @@ -38,7 +38,6 @@ component: - id: device_init - id: sl_system - id: component_catalog -- id: app_assert - id: app_log - instance: [vcom] id: iostream_eusart @@ -54,7 +53,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../linker_files/brd2703a/linkerfile.ld diff --git a/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000_si91x.slcp b/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000_si91x.slcp new file mode 100644 index 00000000..e60af0a4 --- /dev/null +++ b/app/example/mikroe_uwb2_dwm3000/SimplicityStudio/mikroe_uwb2_dwm3000_si91x.slcp @@ -0,0 +1,79 @@ +project_name: mikroe_uwb2_dwm3000 +package: platform +label: Third Party Hardware Drivers - DWM3000 - UWB2 Click (Mikroe) +description: This example project shows an example for DWM3000 - UWB2 Click (Mikroe). +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../../documentation/example/mikroe_uwb2_dwm3000/README.md + +source: +- path: ../app_files/app.c + directory: app_files +- path: ../app_files/config_options.c + directory: app_files +- path: ../app_files/shared_functions.c + directory: app_files +- path: ../main.c + +include: +- path: ../app_files + file_list: + - path: app.h + - path: config_options.h + - path: shared_defines.h + - path: shared_functions.h + directory: app_files + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: mikroe_uwb2_dwm3000 + from: third_party_hw_drivers + +toolchain_settings: + - option: linkerfile + value: linkerfile_SoC.ld + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../linker_files/brd4338a/linkerfile_SoC.ld + condition: [brd4338a] + - path: ../../../documentation/example/mikroe_uwb2_dwm3000/image/create_example.png + directory: image + - path: ../../../documentation/example/mikroe_uwb2_dwm3000/image/hardware_connection.png + directory: image + - path: ../../../documentation/example/mikroe_uwb2_dwm3000/image/custom_linker.png + directory: image + - path: ../../../documentation/example/mikroe_uwb2_dwm3000/image/tx_log.png + directory: image + - path: ../../../documentation/example/mikroe_uwb2_dwm3000/image/rx_log.png + directory: image + +post_build: + path: ../../../../utilities/postbuild_profile/wiseconnect_soc.slpb + +ui_hints: + highlight: + - path: README.md + focus: true diff --git a/app/example/mikroe_uwb2_dwm3000/app_files/app.c b/app/example/mikroe_uwb2_dwm3000/app_files/app.c index 91f9871d..d346bd3e 100644 --- a/app/example/mikroe_uwb2_dwm3000/app_files/app.c +++ b/app/example/mikroe_uwb2_dwm3000/app_files/app.c @@ -19,17 +19,27 @@ * Initialize application. ******************************************************************************/ #include "app.h" -#include "em_gpio.h" -#include "sl_system_init.h" -#include "sl_event_handler.h" -#include "port.h" -#include "deca_probe_interface.h" +#include "sl_component_catalog.h" +#include "sl_sleeptimer.h" +#include "string.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_gspi.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#else #include "app_log.h" +#include "sl_spidrv_instances.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#include "deca_probe_interface.h" +#include "port_dw3000.h" #include "shared_functions.h" #include "shared_defines.h" -#include "string.h" #include "config_options.h" -#include "sl_sleeptimer.h" // Comment out the line below in order to switch the application mode to // receiver @@ -102,21 +112,29 @@ static uint16_t frame_len; #endif +mikroe_spi_handle_t app_spi_instance = NULL; + void app_init(void) { - app_log("DWM3000 - UWB 2 Click Driver\r\n"); + app_printf("DWM3000 - UWB 2 Click Driver\r\n"); #ifdef DEMO_APP_TRANSMITTER - app_log("Application Mode: Transmitter\r\n"); + app_printf("Application Mode: Transmitter\r\n"); +#else + app_printf("Application Mode: Receiver\r\n"); +#endif + +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; #else - app_log("Application Mode: Receiver\r\n"); + app_spi_instance = sl_spidrv_mikroe_handle; #endif - port_init_dw_chip(); + port_init_dw_chip(app_spi_instance); reset_DW3000(); if (dwt_probe((struct dwt_probe_s *)&dw3000_probe_interf)) { - app_log("DWM 3000 probe fail\r\n"); + app_printf("DWM 3000 probe fail\r\n"); while (1) {} } @@ -124,7 +142,7 @@ void app_init(void) * that writes inside local data * like setxtaltrim */ if (dwt_initialise(DWT_DW_INIT) != DWT_SUCCESS) { - app_log("DWM 3000 init fail\r\n"); + app_printf("DWM 3000 init fail\r\n"); while (1) {} } @@ -133,19 +151,19 @@ void app_init(void) /* Reads and validate device ID returns DWT_ERROR if it does not match * expected else DWT_SUCCESS */ if (dwt_check_dev_id() == DWT_SUCCESS) { - app_log("DWM3000 dev id = 0x%lx\r\n", dev_id); + app_printf("DWM3000 dev id = 0x%lx\r\n", dev_id); } else { - app_log("DWM3000 read dev id failed\r\n"); + app_printf("DWM3000 read dev id failed\r\n"); } uint32_t part_id = dwt_getpartid(); - app_log("DWM3000 part id = 0x%lx\r\n", part_id); + app_printf("DWM3000 part id = 0x%lx\r\n", part_id); uint32_t lot_id = dwt_getlotid(); - app_log("DWM3000 lot id = 0x%lx\r\n", lot_id); + app_printf("DWM3000 lot id = 0x%lx\r\n", lot_id); uint8_t otprevision = dwt_otprevision(); - app_log("DWM3000 otp revision = 0x%x\r\n", otprevision); + app_printf("DWM3000 otp revision = 0x%x\r\n", otprevision); /* Enabling LEDs here for debug so that for each TX the D1 LED will flash on * DW3000 red eval-shield boards. */ @@ -156,7 +174,7 @@ void app_init(void) /* if the dwt_configure returns DWT_ERROR either the PLL or RX calibration has * failed the host should reset the device */ if (dwt_configure(&config)) { - app_log("DWM3000 config failed\r\n"); + app_printf("DWM3000 config failed\r\n"); while (1) {} } @@ -165,13 +183,13 @@ void app_init(void) /* Configure the TX spectrum parameters (power PG delay and PG Count) */ dwt_configuretxrf(&txconfig_options); - app_log("Start TX timer periodic = 0x%lx\r\n", - sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, - TRANSMITTING_INTERVAL_MSEC, - app_tx_timer_callback, - NULL, - 0, - 0)); + app_printf("Start TX timer periodic = 0x%lx\r\n", + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + TRANSMITTING_INTERVAL_MSEC, + app_tx_timer_callback, + NULL, + 0, + 0)); #endif } @@ -207,7 +225,7 @@ void app_process_action(void) /* Clear TX frame sent event. */ dwt_writesysstatuslo(DWT_INT_TXFRS_BIT_MASK); - app_log("TX Frame Sent #%d\r\n", tx_msg[BLINK_FRAME_SN_IDX]); + app_printf("TX Frame Sent #%d\r\n", tx_msg[BLINK_FRAME_SN_IDX]); /* Increment the blink frame sequence number (modulo 256). */ tx_msg[BLINK_FRAME_SN_IDX]++; @@ -248,8 +266,8 @@ void app_process_action(void) memcpy(rx_msg, (rx_buffer + RX_MSG_DATA_IDX), (frame_len - FCS_LEN - RX_MSG_DATA_IDX)); - app_log("Message received #%u: %s\r\n", - ( uint16_t ) frame_id, rx_msg); + app_printf("Message received #%u: %s\r\n", + ( uint16_t ) frame_id, rx_msg); /* Clear good RX frame event in the DW IC status register. */ dwt_writesysstatuslo(DWT_INT_RXFCG_BIT_MASK); diff --git a/app/example/mikroe_uwb2_dwm3000/app_files/shared_functions.c b/app/example/mikroe_uwb2_dwm3000/app_files/shared_functions.c index fbb69e99..2fedb5d6 100644 --- a/app/example/mikroe_uwb2_dwm3000/app_files/shared_functions.c +++ b/app/example/mikroe_uwb2_dwm3000/app_files/shared_functions.c @@ -13,7 +13,6 @@ #include "config_options.h" #include #include -#include #include "shared_defines.h" #include "shared_functions.h" #include diff --git a/app/example/mikroe_uwb2_dwm3000/linker_files/brd4338a/linkerfile_SoC.ld b/app/example/mikroe_uwb2_dwm3000/linker_files/brd4338a/linkerfile_SoC.ld new file mode 100644 index 00000000..92fd63ed --- /dev/null +++ b/app/example/mikroe_uwb2_dwm3000/linker_files/brd4338a/linkerfile_SoC.ld @@ -0,0 +1,185 @@ +/***************************************************************************//** + * GCC Linker script for Silicon Labs devices + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + + + MEMORY + { + rom (rx) : ORIGIN = 0x8202000, LENGTH = 0x1fe000 + + ram (rwx) : ORIGIN = 0xc, LENGTH = 0x2fbf4 + } + MEMORY + { + udma0 (rwx) : ORIGIN = 0x2fc00, LENGTH = 0x400 + udma1 (rwx) : ORIGIN = 0x24061c00, LENGTH = 0x400 + } + +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + + *(.text*) + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + *(.rodata*) + + KEEP(*(.eh_fram e*)) + } > rom + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > rom + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > rom + __exidx_end = .; + + .dw_drivers ALIGN(4): + { + __dw_drivers_start = . ; + KEEP(*(.dw_drivers*)) + __dw_drivers_end = . ; + } > rom + + __etext = .; + + + + + /* _sidata is used in code startup code */ + _sidata = __etext; + + .data : + + { + __data_start__ = .; + + /* _sdata is used in startup code */ + _sdata = __data_start__; + *(.data*) + + + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + /* _edata is used in startup code */ + _edata = __data_end__; + } > ram AT> rom + + .bss (NOLOAD) : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > ram + + + .stack (NOLOAD): + { + __StackLimit = .; + KEEP(*(.stack*)) + . = ALIGN(4); + __StackTop = .; + PROVIDE(__stack = __StackTop); + } > ram + + .heap (COPY): + { + __HeapBase = .; + __end__ = .; + end = __end__; + _end = __end__; + KEEP(*(.heap*)) + . = ORIGIN(ram) + LENGTH(ram); + + __HeapLimit = .; + } > ram + + __heap_size = __HeapLimit - __HeapBase; + .udma_addr0 : + { + *(.udma_addr0*) + } > udma0 AT> rom + + + .udma_addr1 : + { + *(.udma_addr1*) + } > udma1 AT> rom + +} \ No newline at end of file diff --git a/app/example/mikroe_uwb_dwm1000/app.c b/app/example/mikroe_uwb_dwm1000/app.c index 22d00297..faba356b 100644 --- a/app/example/mikroe_uwb_dwm1000/app.c +++ b/app/example/mikroe_uwb_dwm1000/app.c @@ -38,20 +38,19 @@ ******************************************************************************/ // ------------------------------------------------------------------- INCLUDES - #include "mikroe_uwb_dwm1000.h" -#include "sl_spidrv_instances.h" -#include "app_log.h" #include "app_assert.h" - +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_si91x_gspi.h" +#include "sl_si91x_button_instances.h" +static sl_gspi_instance_t gspi_instance = SL_GSPI_MASTER; +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else /* None Si91x device */ +#include "app_log.h" +#include "sl_spidrv_instances.h" #include "sl_simple_button_instances.h" - -#include "sl_udelay.h" - -// ------------------------------------------------------------------- DEFINES - -#ifndef BUTTON_INSTANCE_0 -#define BUTTON_INSTANCE_0 sl_button_btn0 +#define app_printf(...) app_log(__VA_ARGS__) #endif // ------------------------------------------------------------------ VARIABLES @@ -75,36 +74,42 @@ static uint8_t received_data[256] = { 0 }; // Dev_status var static uint8_t dev_status = { 0 }; +static mikroe_spi_handle_t app_spi_instance = NULL; + void app_init(void) { sl_status_t sc; - app_log("---- Application Init ----\r\n\n"); + app_printf("---- Application Init ----\r\n"); - if (mikroe_dwm1000_init(sl_spidrv_mikroe_handle) == SL_STATUS_OK) { - app_log("---- UWB DWM1000 Click initialized successfully ----\r\n\n"); +#if (defined(SLI_SI917)) + app_spi_instance = &gspi_instance; +#else + app_spi_instance = sl_spidrv_mikroe_handle; +#endif + + if (mikroe_dwm1000_init(app_spi_instance) == SL_STATUS_OK) { + app_printf("---- UWB DWM1000 Click initialized successfully ----\r\n"); } else { - app_log("****** Error initializing the uwb device ******\r\n\n"); + app_printf("****** Error initializing the uwb device ******\r\n"); } sl_udelay_wait(100000); - mikroe_dwm1000_enable(); - sl_udelay_wait(100000); uint8_t id_raw[4] = { 0 }; - app_log("----- Reading Device TAG ----\r\n\n"); + app_printf("----- Reading Device TAG ----\r\n"); mikroe_dwm1000_generic_read(MIKROE_DWM1000_REG_DEV_ID, &id_raw[0], 4); uint16_t tag_data = (( uint16_t ) id_raw[3] << 8) | id_raw[2]; if (MIKROE_DWM1000_TAG != tag_data) { - app_log(" ***** TAG ERROR ***** \r\n\n"); + app_printf(" ***** TAG ERROR ***** \r\n"); sc = SL_STATUS_FAIL; } else { - app_log("---- TAG OK ----\r\n\n"); + app_printf("---- TAG OK ----\r\n"); sc = SL_STATUS_OK; } @@ -121,15 +126,15 @@ void app_init(void) mikroe_dwm1000_clear_status(); // Setting device address and network ID - app_log(" ------------------ \r\n"); + app_printf(" ------------------ \r\n"); if (MIKROE_DWM1000_MODE_RX == dev_mode) { mikroe_dwm1000_set_dev_adr_n_network_id(6, 10); - app_log(" -----RECEIVER----- \r\n"); + app_printf(" -----RECEIVER----- \r\n"); } else if (MIKROE_DWM1000_MODE_TX == dev_mode) { mikroe_dwm1000_set_dev_adr_n_network_id(5, 10); - app_log(" ---TRANSMITTER--- \r\n"); + app_printf(" ---TRANSMITTER--- \r\n"); } - app_log(" ------------------ \r\n\n"); + app_printf(" ------------------ \r\n"); sl_udelay_wait(100000); @@ -155,7 +160,7 @@ void app_init(void) mikroe_dwm1000_start_transceiver(); } else if (MIKROE_DWM1000_MODE_TX == dev_mode) { // Setup for first transmit - app_log("Setting up first transmit. \r\n\n"); + app_printf("Setting up first transmit. \r\n"); mikroe_dwm1000_set_mode(MIKROE_DWM1000_MODE_IDLE); mikroe_dwm1000_clear_status(); mikroe_dwm1000_set_transmit(&data_tx[0], 7); @@ -163,7 +168,7 @@ void app_init(void) mikroe_dwm1000_start_transceiver(); transmit_cnt++; - app_log(" - Transmit %u done - \r\n", transmit_cnt); + app_printf(" - Transmit %u done - \r\n", transmit_cnt); } sl_udelay_wait(2000000); @@ -182,8 +187,8 @@ void app_process_action(void) mikroe_dwm1000_clear_status(); temp_len = mikroe_dwm1000_get_transmit_len(); mikroe_dwm1000_get_transmit(&received_data[0], temp_len); - app_log("Received data: %s\r\n", received_data); - app_log(" - Receive done - \r\n\n"); + app_printf("Received data: %s\r\n", received_data); + app_printf(" - Receive done - \r\n"); mikroe_dwm1000_set_mode(MIKROE_DWM1000_MODE_RX); mikroe_dwm1000_start_transceiver(); mikroe_dwm1000_int_mask_set(); @@ -201,18 +206,29 @@ void app_process_action(void) mikroe_dwm1000_start_transceiver(); transmit_cnt++; - app_log(" - Transmit %u done - \r\n", transmit_cnt); + app_printf(" - Transmit %u done - \r\n", transmit_cnt); } } /****************************************************************************** * Button callback, called if any button is pressed or released. *****************************************************************************/ +#if (defined(SLI_SI917)) +void sl_si91x_button_isr(uint8_t pin, int8_t state) +{ + if ((pin == button_btn0.pin) && (state == 0)) { + tx_requested = true; + } +} + +#else void sl_button_on_change(const sl_button_t *handle) { if (sl_button_get_state(handle) == SL_SIMPLE_BUTTON_PRESSED) { - if (&BUTTON_INSTANCE_0 == handle) { + if (&sl_button_btn0 == handle) { tx_requested = true; } } } + +#endif diff --git a/app/example/mikroe_uwb_dwm1000/mikroe_uwb_dwm1000.slcp b/app/example/mikroe_uwb_dwm1000/mikroe_uwb_dwm1000.slcp index 20735aa9..51cf7983 100644 --- a/app/example/mikroe_uwb_dwm1000/mikroe_uwb_dwm1000.slcp +++ b/app/example/mikroe_uwb_dwm1000/mikroe_uwb_dwm1000.slcp @@ -27,43 +27,43 @@ include: file_list: - path: app.h component: - - id: sl_system - - id: device_init - - id: uwb_dwm1000 - from: third_party_hw_drivers - - id: iostream_eusart - instance: - - vcom - - id: simple_button - instance: - - btn0 - - id: spidrv - instance: - - mikroe - - id: app_assert - - id: app_log - - id: udelay +- id: sl_system +- id: device_init +- id: uwb_dwm1000 + from: third_party_hw_drivers +- id: iostream_eusart + instance: + - vcom +- id: simple_button + instance: + - btn0 +- id: spidrv + instance: + - mikroe +- id: app_assert +- id: app_log + configuration: - name: SL_SPIDRV_MIKROE_CS_CONTROL value: spidrvCsControlApplication sdk_extension: - - id: third_party_hw_drivers - version: 2.0.1 +- id: third_party_hw_drivers + version: 4.0.0 + define: - name: DEBUG_EFM other_file: - - path: ../../documentation/example/mikroe_uwb_dwm1000/image/hardware_connection.png - directory: image - - path: ../../documentation/example/mikroe_uwb_dwm1000/image/sw_layer.png - directory: image - - path: ../../documentation/example/mikroe_uwb_dwm1000/image/create_example.png - directory: image - - path: ../../documentation/example/mikroe_uwb_dwm1000/image/receive_cli.png - directory: image - - path: ../../documentation/example/mikroe_uwb_dwm1000/image/transmit_cli.png - directory: image - - path: ../../documentation/example/mikroe_uwb_dwm1000/image/uwb_config.png - directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/hardware_connection.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/sw_layer.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/create_example.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/receive_cli.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/transmit_cli.png + directory: image + ui_hints: highlight: - path: README.md diff --git a/app/example/mikroe_uwb_dwm1000/mikroe_uwb_dwm1000_si91x.slcp b/app/example/mikroe_uwb_dwm1000/mikroe_uwb_dwm1000_si91x.slcp new file mode 100644 index 00000000..2e002846 --- /dev/null +++ b/app/example/mikroe_uwb_dwm1000/mikroe_uwb_dwm1000_si91x.slcp @@ -0,0 +1,72 @@ +--- +project_name: mikroe_uwb_dwm1000_si91x +label: Third Party Hardware Drivers - DWM1000 - UWB Click (Mikroe) - Si91x +package: platform +description: > + This example project shows an example for the Microe DWM1000 - UWB with Si91x + Click board driver integration. +category: Example|Platform +quality: evaluation +filter: + - name: Device Type + value: + - SoC + - name: MCU + value: + - 32-bit MCU + - name: Project Difficulty + value: + - Beginner +readme: + - path: ../../documentation/example/mikroe_uwb_dwm1000/README.md +source: + - path: app.c + - path: main.c +include: + - path: "" + file_list: + - path: app.h +component: +- id: app_assert +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: uwb_dwm1000 + from: third_party_hw_drivers +- instance: [btn0] + from: wiseconnect3_sdk + id: sl_si91x_button_917 + +configuration: + - name: SL_BUTTON_CONFIG_BTN0_INTR + value: FALL_EDGE_INTERRUPT + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +define: + - name: DEBUG_EFM +other_file: +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/hardware_connection.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/sw_layer.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/create_example.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/receive_cli.png + directory: image +- path: ../../documentation/example/mikroe_uwb_dwm1000/image/transmit_cli.png + directory: image + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/mikroe_water_detect/app.c b/app/example/mikroe_water_detect/app.c index cc4221cb..16b9ca47 100644 --- a/app/example/mikroe_water_detect/app.c +++ b/app/example/mikroe_water_detect/app.c @@ -114,11 +114,10 @@ void app_init(void) GPIO_ExtIntConfig(WATER_DETECT_INT_PORT, WATER_DETECT_INT_PIN, WATER_DETECT_INT_PIN, - 1, - 1, - 1); + true, + true, + true); GPIOINT_CallbackRegister(WATER_DETECT_INT_PIN, wd_int_callback); - GPIO_IntEnable(WATER_DETECT_INT_PIN); #endif #endif app_printf(" Initialization Driver \r\n"); diff --git a/app/example/mikroe_water_detect/mikroe_water_detect.slcp b/app/example/mikroe_water_detect/mikroe_water_detect.slcp index 28442669..013d22a8 100644 --- a/app/example/mikroe_water_detect/mikroe_water_detect.slcp +++ b/app/example/mikroe_water_detect/mikroe_water_detect.slcp @@ -42,12 +42,10 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - - path: ../../documentation/example/mikroe_water_detect/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_water_detect/image/create_example_2.png + - path: ../../documentation/example/mikroe_water_detect/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_water_detect/image/hardware_connection.png directory: "image" diff --git a/app/example/mikroe_water_detect/mikroe_water_detect_si91x.slcp b/app/example/mikroe_water_detect/mikroe_water_detect_si91x.slcp index 0ef3751d..2956c269 100644 --- a/app/example/mikroe_water_detect/mikroe_water_detect_si91x.slcp +++ b/app/example/mikroe_water_detect/mikroe_water_detect_si91x.slcp @@ -1,8 +1,8 @@ project_name: mikroe_water_detect_si91x package: platform -label: Third Party Hardware Drivers - MCP606 - Water Detect Click (Mikroe) - Si91x +label: Third Party Hardware Drivers - MCP606 - Water Detect Click (Mikroe) description: | - This example project shows an example for Mikroe Water Detect Click board driver integration on Si91x. + This example project shows an example for Mikroe Water Detect Click board driver integration. category: Example|Platform quality: evaluation @@ -39,14 +39,12 @@ component: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 other_file: - - path: ../../documentation/example/mikroe_water_detect/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/mikroe_water_detect/image/create_example_2.png + - path: ../../documentation/example/mikroe_water_detect/image/create_example.png directory: "image" - path: ../../documentation/example/mikroe_water_detect/image/hardware_connection.png directory: "image" diff --git a/app/example/silabs_ir_generate/silabs_ir_generate.slcp b/app/example/silabs_ir_generate/silabs_ir_generate.slcp index 7f1a2c13..34b42764 100644 --- a/app/example/silabs_ir_generate/silabs_ir_generate.slcp +++ b/app/example/silabs_ir_generate/silabs_ir_generate.slcp @@ -33,7 +33,7 @@ define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/silabs_ir_generate/image/create_example.png directory: "image" diff --git a/app/example/silabs_lin_bus/master/silabs_lin_master.slcp b/app/example/silabs_lin_bus/master/silabs_lin_master.slcp index 3ff5f89f..b16fc2a8 100644 --- a/app/example/silabs_lin_bus/master/silabs_lin_master.slcp +++ b/app/example/silabs_lin_bus/master/silabs_lin_master.slcp @@ -61,7 +61,7 @@ config_file: sdk_extension: - id: third_party_hw_drivers - version: 2.0.0 + version: 4.0.0 other_file: - path: ../../../documentation/example/silabs_lin_bus/images/hardware_connection.jpg diff --git a/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp b/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp index a4947a7d..ddfac3a4 100644 --- a/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp +++ b/app/example/silabs_lin_bus/slave/silabs_lin_slave1.slcp @@ -86,7 +86,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../../documentation/example/silabs_lin_bus/images/hardware_connection.jpg diff --git a/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp b/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp index cb6f93e8..52299a5d 100644 --- a/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp +++ b/app/example/silabs_lin_bus/slave/silabs_lin_slave2.slcp @@ -85,7 +85,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../../documentation/example/silabs_lin_bus/images/hardware_connection.jpg diff --git a/app/example/silabs_pir_ira_s210st01/app.c b/app/example/silabs_pir_ira_s210st01/app.c deleted file mode 100644 index 9a7b5870..00000000 --- a/app/example/silabs_pir_ira_s210st01/app.c +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************//** - * @file - * @brief PIR driver simple example. - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ -#include -#include -#include - -#include "em_device.h" -#include "em_chip.h" -#include "em_gpio.h" -#include "em_emu.h" - -#include "sl_simple_led.h" -#include "sl_simple_led_instances.h" - -#include -#define QUEUE_LENGTH 4 - -static pir_sample_t pir_queue[QUEUE_LENGTH]; // User defined sample queue -static volatile bool adc_int = false; // ADC interrupt flag - -/***************************************************************************//** - * @brief - * Motion detection callback - * - * @note - * Use the LED on Occupancy-Sensor-EXP board to indicate motion on/off - ******************************************************************************/ -static void pir_motion_detect_callback(bool motion_status) -{ - if (motion_status) { - sl_led_turn_on(SL_SIMPLE_LED_INSTANCE(0)); - } else { - sl_led_turn_off(SL_SIMPLE_LED_INSTANCE(0)); - } -} - -/***************************************************************************//** - * @brief - * ADC IRQ callback - ******************************************************************************/ -static void pir_adc_irq_callback(void) -{ - adc_int = true; -} - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -void app_init(void) -{ - // Initialize PIR - pir_init_t pir = PIR_INIT_DEFAULT; - pir.opamp_mode = pir_opamp_mode_external; - pir.motion_detection_callback = pir_motion_detect_callback; - pir.sample_queue_size = QUEUE_LENGTH; - pir.sample_queue = pir_queue; - pir.use_timestamp = true; - pir.adc_irq_callback = pir_adc_irq_callback; - pir_init(&pir, true); - - // Start PIR - pir_start(); -} - -/***************************************************************************//** - * App ticking function. - ******************************************************************************/ -void app_process_action(void) -{ - // Infinite loop - if (adc_int) { - adc_int = false; - // Run motion detection algorithm - pir_detect_motion(); - // Debug PIR samples if necessary - while (1) { - uint16_t size = 0; - - if ((SL_STATUS_OK == pir_get_queue_size(&size)) && (size > 0)) { - pir_sample_t sample; - - pir_read_queue(&sample); - } else { - break; - } - } - } - EMU_EnterEM2(true); -} diff --git a/app/example/silabs_pir_ira_s210st01/silabs_pir_ira_s210st01.slcp b/app/example/silabs_pir_ira_s210st01/silabs_pir_ira_s210st01.slcp deleted file mode 100644 index 5504749c..00000000 --- a/app/example/silabs_pir_ira_s210st01/silabs_pir_ira_s210st01.slcp +++ /dev/null @@ -1,50 +0,0 @@ -project_name: silabs_pir_ira_s210st01 -package: platform -label: Third Party Hardware Drivers - IRA-S210ST01 - PIR Sensor (Silabs) -description: | - This example project shows an example for PIR sensor on the occupancy sensor EXP board driver integration. -category: Example|Platform -quality: evaluation -filter: -- name: Device Type - value: [SoC] -- name: MCU - value: [32-bit MCU] -- name: Project Difficulty - value: [Beginner] -readme: -- path: ../../documentation/example/silabs_pir_ira_s210st01/README.md -source: -- path: app.c -- path: main.c -include: -- path: '' - file_list: - - path: app.h -component: -- id: sl_system -- id: device_init -- id: silabs_pir_ira_s210st01 - from: third_party_hw_drivers -- id: simple_led - instance: [led0] -other_file: -- path: ../../documentation/example/silabs_pir_ira_s210st01/image/create_example.png - directory: "image" -- path: ../../documentation/example/silabs_pir_ira_s210st01/image/api.png - directory: "image" -- path: ../../documentation/example/silabs_pir_ira_s210st01/image/peripherals.png - directory: "image" -- path: ../../documentation/example/silabs_pir_ira_s210st01/image/workflow.png - directory: "image" -- path: ../../documentation/example/silabs_pir_ira_s210st01/image/hardware_connection.png - directory: "image" -define: -- name: DEBUG_EFM -sdk_extension: -- id: third_party_hw_drivers - version: 3.0.0 -ui_hints: - highlight: - - path: README.md - focus: true \ No newline at end of file diff --git a/app/example/silabs_triac/app.c b/app/example/silabs_triac/app.c deleted file mode 100644 index 3028e038..00000000 --- a/app/example/silabs_triac/app.c +++ /dev/null @@ -1,142 +0,0 @@ -/***************************************************************************//** - * @file - * @brief Top level application functions - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ -#include "em_letimer.h" -#include "em_gpio.h" -#include "em_emu.h" -#include "em_cmu.h" - -#include "sl_simple_button_instances.h" -#include "triacdrv.h" - -/* - * Using the LFXO for the LETIMER clock, 32768/120 = 273.066666. Note - * that the output low/high time has to be half of one 60 Hz period, - * thus the 120 Hz output overflow frequency for the LETIMER. Use 273 - * for the counter top value. Use 328 to get a 50 Hz output. - */ -#define LETIMER_TOP 273 - -// Duty cycle value -uint32_t triacDuty; // initially off - -/**************************************************************************//** - * @brief - * Initialize the LETIMER to output a 50/60 Hz square wave for testing. - *****************************************************************************/ -void letimerLineHz(void) -{ - LETIMER_Init_TypeDef letimerInit = LETIMER_INIT_DEFAULT; - - CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO); - - CMU_ClockEnable(cmuClock_LETIMER0, true); - - // Enable LETIMER0 output0 on PC14 (EXP header pin 12) - LETIMER0->ROUTEPEN |= LETIMER_ROUTEPEN_OUT0PEN; - LETIMER0->ROUTELOC0 = LETIMER_ROUTELOC0_OUT0LOC_LOC5; - - // Reload COMP0 on underflow, pulse output, and run in repeat mode - letimerInit.comp0Top = true; - letimerInit.ufoa0 = letimerUFOAToggle; - letimerInit.topValue = LETIMER_TOP; - - // Need REP0 != 0 to pulse on underflow - LETIMER_RepeatSet(LETIMER0, 0, 1); - - // Initialize and enable LETIMER - LETIMER_Init(LETIMER0, &letimerInit); -} - -void initGPIO(void) -{ - CMU_ClockEnable(cmuClock_GPIO, true); - - /* - * Use minimum slew rate alternate setting for port C pins. This - * results in a 100 ns rise/fall time when viewed on a scope. The - * default primary slew rate of 5 is retained for other puns. - */ - GPIO_SlewrateSet(gpioPortC, 5, 0); - GPIO_PinModeSet(gpioPortC, 14, gpioModePushPullAlternate, 0); -} - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -void app_init(void) -{ - TRIACDRV_Init_TypeDef triacInit = TRIAC_INIT_DEFAULT; - - initGPIO(); - - letimerLineHz(); - - triacInit.acmpInput = acmpInputAPORT0YCH0; // PC0, EXP header pin 3 - triacInit.acmpPrsChannel = 3; - triacInit.timerPrsBaseChannel = 4; - triacInit.timerPrsOutputPort = gpioPortC; - triacInit.timerPrsOutputPin = 8; - triacInit.timerPrsOutputLoc = 0; // PC8, EXP header pin 10 - triacInit.pulseWidth = TRIACDRV_MAX_ENABLE_PULSE_WIDTH; - - // Halt if initialization fails - if (triacdrv_init(&triacInit) != SL_STATUS_OK) { - __BKPT(0); - } - - // Set initial duty cycle - triacDuty = 25; - triacdrv_set_duty_cycle(triacDuty); - - // Calibrate - triacdrv_calibrate(60); -} - -/***************************************************************************//** - * App ticking function. - ******************************************************************************/ -void app_process_action(void) -{ - // Sit in EM1 and wait for button presses - EMU_EnterEM1(); -} - -/***************************************************************************//** - * Callback on button change. - ******************************************************************************/ -void sl_button_on_change(const sl_button_t *handle) -{ - if (sl_button_get_state(handle) == SL_SIMPLE_BUTTON_PRESSED) { - if (&sl_button_btn0 == handle) { - // PB0 pressed; reduce duty cycle by 5% - if (triacDuty > 0) { - triacDuty -= 5; - } else { - triacDuty = 0; - } - } else if (&sl_button_btn1 == handle) { - // PB1 pressed; increase duty cycle by 5% - if (triacDuty < 100) { - triacDuty += 5; - } else { - triacDuty = 100; - } - } - - triacdrv_set_duty_cycle(triacDuty); - } -} diff --git a/app/example/silabs_triac/silabs_triac.slcp b/app/example/silabs_triac/silabs_triac.slcp deleted file mode 100644 index 3cf8635b..00000000 --- a/app/example/silabs_triac/silabs_triac.slcp +++ /dev/null @@ -1,53 +0,0 @@ -project_name: silabs_triac -label: Third Party Hardware Drivers - Triac Driver (Silabs) -description: | - This example project shows an example for using TRIAC driver. -category: Example|Platform -filter: -- name: Device Type - value: [SoC] -- name: MCU - value: [32-bit MCU] -- name: Project Difficulty - value: [Beginner] -package: platform -quality: evaluation -readme: -- path: ../../documentation/example/silabs_triac/README.md -source: -- path: app.c -- path: main.c -include: -- path: '' - file_list: - - path: app.h -component: -- id: sl_system -- id: device_init -- id: emlib_letimer -- id: simple_button - instance: [btn0, btn1] -- id: silabs_triac - from: third_party_hw_drivers -define: -- name: DEBUG_EFM -sdk_extension: -- id: third_party_hw_drivers - version: 3.0.0 -other_file: - - path: ../../documentation/example/silabs_triac/image/create_example.png - directory: "image" - - path: ../../documentation/example/silabs_triac/image/triacdrv_ac_sine.png - directory: "image" - - path: ../../documentation/example/silabs_triac/image/triacdrv_diagram.png - directory: "image" - - path: ../../documentation/example/silabs_triac/image/triacdrv_offset_sine.png - directory: "image" - - path: ../../documentation/example/silabs_triac/image/triacdrv_rectified_sine.png - directory: "image" - - path: ../../documentation/example/silabs_triac/image/oscilloscope_output.png - directory: "image" -ui_hints: - highlight: - - path: README.md - focus: true \ No newline at end of file diff --git a/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270.slcp b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270.slcp index cf84149b..51019bc8 100644 --- a/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270.slcp +++ b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270.slcp @@ -42,7 +42,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 toolchain_settings: - option: gcc_linker_option @@ -51,8 +51,6 @@ toolchain_settings: other_file: - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example.png directory: "image" - - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png - directory: "image" - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/hardware_connection.png directory: "image" - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/log.png diff --git a/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270_si91x.slcp b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270_si91x.slcp index 97b939a3..5fb23d9a 100644 --- a/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270_si91x.slcp +++ b/app/example/sparkfun_6dof_imu_bmi270/sparkfun_6dof_imu_bmi270_si91x.slcp @@ -1,4 +1,4 @@ -project_name: sparkfun_6dof_imu_bmi270 +project_name: sparkfun_6dof_imu_bmi270_si91x label: Third Party Hardware Drivers - BMI270 - 6DOF IMU Breakout (Sparkfun). package: platform description: | @@ -43,9 +43,9 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 toolchain_settings: - option: gcc_linker_option @@ -54,8 +54,6 @@ toolchain_settings: other_file: - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example.png directory: "image" - - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/create_example_si91x.png - directory: "image" - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/hardware_connection.png directory: "image" - path: ../../documentation/example/sparkfun_6dof_imu_bmi270/image/log.png diff --git a/app/example/sparkfun_accelerometer_mma8452q/app.c b/app/example/sparkfun_accelerometer_mma8452q/app.c index a20da2ce..5a706074 100644 --- a/app/example/sparkfun_accelerometer_mma8452q/app.c +++ b/app/example/sparkfun_accelerometer_mma8452q/app.c @@ -33,25 +33,49 @@ * maintained and there may be no bug maintenance planned for these resources. * Silicon Labs may update projects from time to time. ******************************************************************************/ +#include "mma8452q.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" -#include "app_assert.h" #include "app_log.h" -#include "mma8452q.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +static mikroe_i2c_handle_t app_i2c_instance = NULL; #define TEST_BASIC_READING -#define TEST_RAW_DATA_READING -#define TEST_ORIENTATION -#define TEST_READ_TAPS -#define TEST_FF_MT +// #define TEST_RAW_DATA_READING +// #define TEST_ORIENTATION +// #define TEST_READ_TAPS +// #define TEST_FF_MT /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { - mma8452q_init(sl_i2cspm_qwiic); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + mma8452q_init(app_i2c_instance); mma8452q_set_address(SL_MMA8452Q_I2C_BUS_ADDRESS2); + #ifdef TEST_ORIENTATION mma8452q_orientation_config_t orient_cfg = { .db_cnt_mode = true, @@ -60,6 +84,7 @@ void app_init(void) }; mma8452q_config_orientation(orient_cfg); #endif + #ifdef TEST_READ_TAPS mma8452q_pulse_config_t pulse_cfg = { .double_abort = false, @@ -78,6 +103,7 @@ void app_init(void) }; mma8452q_config_pulse(&pulse_cfg); #endif + #ifdef TEST_FF_MT mma8452q_ff_mt_config_t ff_mt_cfg = { .en_event_latch = true, @@ -116,28 +142,29 @@ void app_init(void) mma8452q_config_interrupt(&int_cfg); mma8452q_config_ff_mt(&ff_mt_cfg); #endif + mma8452q_enable_fast_read(false); mma8452q_active(true); - app_log(" Initialize MMA8452Q Successfully!!\r\n"); + app_printf(" Initialize MMA8452Q Successfully!!\r\n"); #ifdef TEST_BASIC_READING - app_log(" Basic Reading Test\r\n"); - app_log("---------------------------------------\r\n"); + app_printf(" Basic Reading Test\r\n"); + app_printf("---------------------------------------\r\n"); #endif #ifdef TEST_RAW_DATA_READING - app_log(" Raw Data Reading Test\r\n"); - app_log("---------------------------------------\r\n"); + app_printf(" Raw Data Reading Test\r\n"); + app_printf("---------------------------------------\r\n"); #endif #ifdef TEST_ORIENTATION - app_log(" Orientation Reading Test\r\n"); - app_log("---------------------------------------\r\n"); + app_printf(" Orientation Reading Test\r\n"); + app_printf("---------------------------------------\r\n"); #endif #ifdef TEST_READ_TAPS - app_log(" Tap Detection Test\r\n"); - app_log("---------------------------------------\r\n"); + app_printf(" Tap Detection Test\r\n"); + app_printf("---------------------------------------\r\n"); #endif #ifdef TEST_FF_MT - app_log(" Free Fall/ Motion Test\r\n"); - app_log("---------------------------------------\r\n"); + app_printf(" Free Fall/ Motion Test\r\n"); + app_printf("---------------------------------------\r\n"); #endif } @@ -153,8 +180,8 @@ void app_process_action(void) mma8452q_check_for_data_ready(&is_ready); if (is_ready) { sl_mma8452q_get_calculated_acceleration(value); - app_log( - "acceleration x direction: %f, acceleration y direction: %f, acceleration z direction: %f\r\n", + app_printf( + "acceleration x direction: %.4f, acceleration y direction: %.4f, acceleration z direction: %.4f\r\n", value[0], value[1], value[2]); @@ -167,7 +194,7 @@ void app_process_action(void) mma8452q_check_for_data_ready(&is_ready_raw); if (is_ready_raw) { sl_mma8452q_get_acceleration(value_raw); - app_log( + app_printf( "raw acceleration x direction: %d, raw acceleration y direction: %d, raw acceleration z direction: %d\r\n", value_raw[0], value_raw[1], @@ -182,19 +209,19 @@ void app_process_action(void) if (is_ready_orien) { mma8452q_get_pl_status(&pl_status); if (pl_status == MMA8452Q_PORTRAIT_U) { - app_log("Orientation status: up\r\n"); + app_printf("Orientation status: up\r\n"); } if (pl_status == MMA8452Q_PORTRAIT_D) { - app_log("Orientation status: down\r\n"); + app_printf("Orientation status: down\r\n"); } if (pl_status == MMA8452Q_LANDSCAPE_R) { - app_log("Orientation status: right\r\n"); + app_printf("Orientation status: right\r\n"); } if (pl_status == MMA8452Q_LANDSCAPE_L) { - app_log("Orientation status: left\r\n"); + app_printf("Orientation status: left\r\n"); } if (pl_status == MMA8452Q_LOCKOUT) { - app_log("Orientation status: flat\r\n"); + app_printf("Orientation status: flat\r\n"); } } #endif @@ -210,7 +237,7 @@ void app_process_action(void) tap = pulse_source & 0x7F; } if (tap > 0) { - app_log("TAP Detected\r\n"); + app_printf("TAP Detected\r\n"); } } #endif @@ -226,25 +253,25 @@ void app_process_action(void) // x-motion detected if ((temp_ff_mt & 0x01) == 0x01) { // If XHP is 1, x event was // negative - app_log(" x- \r\n"); + app_printf(" x- \r\n"); } else { - app_log(" x+ \r\n"); + app_printf(" x+ \r\n"); } } if ((temp_ff_mt & 0x08) == 0x08) { // If YHE bit is set, y-motion // detected if ((temp_ff_mt & 0x04) == 0x04) { // If YHP is set, y event was // negative - app_log(" y- \r\n"); + app_printf(" y- \r\n"); } else { - app_log(" y+ \r\n"); + app_printf(" y+ \r\n"); } } if ((temp_ff_mt & 0x20) == 0x20) { // If ZHE bit is set, z-motion detected if ((temp_ff_mt & 0x10) == 0x10) { - app_log(" z-(mg) \r\n"); + app_printf(" z-(mg) \r\n"); } else { - app_log(" z+(mg) \r\n"); + app_printf(" z+(mg) \r\n"); } } } diff --git a/app/example/sparkfun_accelerometer_mma8452q/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_accelerometer_mma8452q/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_accelerometer_mma8452q/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp b/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp index 8ae38817..65943ed2 100644 --- a/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp +++ b/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q.slcp @@ -35,24 +35,19 @@ component: instance: [vcom] - id: i2cspm instance: [qwiic] -- id: app_assert - id: app_log -- id: sleeptimer -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/api_overview.png diff --git a/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q_si91x.slcp b/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q_si91x.slcp new file mode 100644 index 00000000..e3eab9a9 --- /dev/null +++ b/app/example/sparkfun_accelerometer_mma8452q/sparkfun_accelerometer_mma8452q_si91x.slcp @@ -0,0 +1,82 @@ +project_name: sparkfun_accelerometer_mma8452q +label: Third Party Hardware Drivers - MMA8452Q - Triple Axis Accelerometer Breakout (Sparkfun) +package: platform +description: | + This example project shows an example for Sparkfun Triple Axis Accelerometer Breakout board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_accelerometer_mma8452q/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_accelerometer_mma8452q + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/api_overview.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/basic_reading.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/hardware_jumper.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/motion_freefall.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/orientation_reading.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/power_mode.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/raw_data_reading.png + directory: "image" + - path: ../../documentation/example/sparkfun_accelerometer_mma8452q/image/tap_reading.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_air_quality_sgp40/app.c b/app/example/sparkfun_air_quality_sgp40/app.c index 9d9ff033..a504a9c5 100644 --- a/app/example/sparkfun_air_quality_sgp40/app.c +++ b/app/example/sparkfun_air_quality_sgp40/app.c @@ -1,31 +1,68 @@ -/***************************************************************************//** - * @file - * @brief Top level application functions +/******************************************************************************* + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "sl_sleeptimer.h" -#include "sl_i2cspm_instances.h" +#include "sparkfun_sgp40.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" #include "app_log.h" +#endif -#include "sparkfun_sgp40.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif -#define READING_INTERVAL_MSEC 1000 +#define READING_INTERVAL_MSEC 1000 static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); static sl_status_t app_sgp40_init(void); @@ -36,19 +73,19 @@ static sl_status_t app_sgp40_init(void); void app_init(void) { // Click initialization. - app_log(" Application Task \r\n"); - app_log("-----------------------\r\n"); - app_log(" Air Quality Sensor \r\n"); - app_log("-----------------------\r\n"); + app_printf(" Application Task \r\n"); + app_printf("-----------------------\r\n"); + app_printf(" Air Quality Sensor \r\n"); + app_printf("-----------------------\r\n"); if (app_sgp40_init() != SL_STATUS_OK) { - app_log(" SPG40 inits failed \r\n"); - app_log("-----------------------\r\n"); + app_printf(" SPG40 inits failed \r\n"); + app_printf("-----------------------\r\n"); } else { - app_log(" SPG40 inits successfully \r\n"); - app_log("-----------------------\r\n"); - app_log(" Start measure \r\n"); - app_log("-----------------------\r\n"); + app_printf(" SPG40 inits successfully \r\n"); + app_printf("-----------------------\r\n"); + app_printf(" Start measure \r\n"); + app_printf("-----------------------\r\n"); } } @@ -66,12 +103,12 @@ void app_process_action(void) app_timer_expire = false; sparkfun_sgp40_measure_raw(&air_quality, 50, 25); - app_log(" RAW data : %d \r\n", air_quality); - app_log("-----------------------\r\n"); + app_printf(" RAW data : %d \r\n", air_quality); + app_printf("-----------------------\r\n"); sparkfun_sgp40_get_voc_index(&voc_index, 50, 25); - app_log(" VOC Index : %ld \r\n", voc_index); - app_log("-----------------------\r\n"); + app_printf(" VOC Index : %ld \r\n", voc_index); + app_printf("-----------------------\r\n"); } static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data) @@ -87,7 +124,13 @@ static sl_status_t app_sgp40_init(void) sl_status_t ret; uint16_t results; - ret = sparkfun_sgp40_init(sl_i2cspm_qwiic); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + ret = sparkfun_sgp40_init(app_i2c_instance); if (ret != SL_STATUS_OK) { return SL_STATUS_FAIL; } diff --git a/app/example/sparkfun_air_quality_sgp40/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_air_quality_sgp40/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_air_quality_sgp40/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp b/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp index 39dfe83f..5ff3dca6 100644 --- a/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp +++ b/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40.slcp @@ -35,23 +35,14 @@ component: from: third_party_hw_drivers - id: iostream_usart instance: [vcom] -- id: sleeptimer - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/create_example.png @@ -64,9 +55,10 @@ other_file: directory: "image" - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/log3.png directory: "image" - + - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/yt_thumbnail.jpg + directory: "image" + ui_hints: highlight: - path: README.md focus: true - diff --git a/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40_si91x.slcp b/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40_si91x.slcp new file mode 100644 index 00000000..52aa9fb1 --- /dev/null +++ b/app/example/sparkfun_air_quality_sgp40/sparkfun_air_quality_sgp40_si91x.slcp @@ -0,0 +1,67 @@ +project_name: sparkfun_air_quality_sgp40_si91x +label: Third Party Hardware Drivers - SGP40 - Air Quality Sensor (Sparkfun) +package: platform +description: | + This example project shows an example for the Sparkfun SGP40 Air Quality Sensor board. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_air_quality_sgp40/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sparkfun_air_quality_sgp40_qwiic + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/log1.png + directory: "image" + - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/log2.png + directory: "image" + - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/log3.png + directory: "image" + - path: ../../documentation/example/sparkfun_air_quality_sgp40/image/yt_thumbnail.jpg + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/sparkfun_distance_vl53l1x/app.c b/app/example/sparkfun_distance_vl53l1x/app.c index bf17902a..1bb558f2 100644 --- a/app/example/sparkfun_distance_vl53l1x/app.c +++ b/app/example/sparkfun_distance_vl53l1x/app.c @@ -26,41 +26,70 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * ******************************************************************************/ #include "sl_sleeptimer.h" +#include "sparkfun_vl53l1x.h" +#include "sparkfun_vl53l1x_config.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" #include "app_log.h" +#endif -#include "sparkfun_vl53l1x.h" -#include "sparkfun_vl53l1x_config.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif // This define enables the periodic distance printing via UART #define VL53_TEST_APP_PERIODIC_DISTANCE +#define READING_INTERVAL_MSEC 1000 -// VL53 Timer callback function -void vl53_read_distance_periodic(sl_sleeptimer_timer_handle_t *handle, - void *data); +static volatile bool trigger_process = false; +static sl_sleeptimer_timer_handle_t app_timer_handle; +static mikroe_i2c_handle_t app_i2c_instance = NULL; + +static void vl53_read_distance(void); +static void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, + void *data); /**************************************************************************//** * Application Init. *****************************************************************************/ void app_init(void) { - static sl_sleeptimer_timer_handle_t handle_vl53; uint8_t sensor_state = 0; sl_status_t vl53_status = SL_STATUS_OK; - ///////////////////////////////////////////////////////////////////////////// - // Put your additional application init code here! // - // This is called once during start-up. // - ///////////////////////////////////////////////////////////////////////////// +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif - app_log("==== VL53L1X Test application ====\n"); - app_log("app_init function called...\n"); + app_printf("==== VL53L1X Test application ====\n"); + app_printf("app_init function called...\n"); // Initialize the sensor with the default settings - vl53_status = vl53l1x_init(VL53L1X_ADDR, sl_i2cspm_qwiic); + vl53_status = vl53l1x_init(VL53L1X_ADDR, app_i2c_instance); // Waiting for device to boot up... while (0 == sensor_state) { @@ -76,15 +105,15 @@ void app_init(void) } if (SL_STATUS_OK == vl53_status) { - app_log("Platform I2C communication is OK.\n"); + app_printf("Platform I2C communication is OK.\n"); } else { - app_log("Platform I2C communication test has been failed.\n" - "Please check the I2C bus connection and " - "the I2C (I2CSPM) configuration.\n"); + app_printf("Platform I2C communication test has been failed.\n" + "Please check the I2C bus connection and " + "the I2C (I2CSPM) configuration.\n"); return; } - app_log("VL53L1X booted\n"); + app_printf("VL53L1X booted\n"); // Optional sensor configuration example function calls, see API documentation // for options @@ -103,9 +132,9 @@ void app_init(void) // Check return codes of the optional configuration function calls if (SL_STATUS_OK == vl53_status) { - app_log("Sensor initialization and configuration are done.\n"); + app_printf("Sensor initialization and configuration are done.\n"); } else { - app_log("Sensor initialization and configuration has been failed.\n"); + app_printf("Sensor initialization and configuration has been failed.\n"); return; } @@ -114,38 +143,49 @@ void app_init(void) // Check ranging status if (SL_STATUS_OK == vl53_status) { - app_log("VL53L1X ranging has been started ...\n"); + app_printf("VL53L1X ranging has been started ...\n"); // Get measurement result - vl53_read_distance_periodic(NULL, NULL); + vl53_read_distance(); } else { - app_log("Start ranging has been failed.\n"); + app_printf("Start ranging has been failed.\n"); return; } #if defined(VL53_TEST_APP_PERIODIC_DISTANCE) // Setup a periodic sleep timer with 1000 ms time period - sl_sleeptimer_start_periodic_timer_ms(&handle_vl53, 1000, - vl53_read_distance_periodic, NULL, 0, + sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, + READING_INTERVAL_MSEC, + app_timer_callback, + NULL, + 0, 0); - app_log("Periodic timer is configured to send periodic distance data.\n"); + app_printf("Periodic timer is configured to send periodic distance data.\n"); #endif - app_log("==================================\n"); + app_printf("==================================\n"); #if defined(VL53_TEST_APP_PERIODIC_DISTANCE) - app_log("> Periodic measurement:\n"); + app_printf("> Periodic measurement:\n"); #endif } -void vl53_read_distance_periodic(sl_sleeptimer_timer_handle_t *handle, - void *data) +/**************************************************************************//** + * Application Process Action. + *****************************************************************************/ +void app_process_action(void) +{ + if (trigger_process) { + trigger_process = false; + vl53_read_distance(); + } +} + +static void vl53_read_distance(void) { sl_status_t vl53_status = SL_STATUS_OK; uint8_t is_data_ready = 0; vl53l1x_result_t result; - (void) handle; - (void) data; // Check measurement data status vl53_status = vl53l1x_check_for_data_ready(VL53L1X_ADDR, &is_data_ready); @@ -155,24 +195,25 @@ void vl53_read_distance_periodic(sl_sleeptimer_timer_handle_t *handle, vl53_status = vl53l1x_get_result(VL53L1X_ADDR, &result); // Print result - app_log(" > Distance: %4u mm, Range status: %1u, " - "Signal rate: %5u, Ambient rate: %5u, " - "Number of SPADS: %4u\n", result.distance, result.status, - result.signal_per_spad, result.ambient, result.signal_per_spad); + app_printf(" > Distance: %4u mm, Range status: %1u, " + "Signal rate: %5u, Ambient rate: %5u, " + "Number of SPADS: %4u\n", result.distance, result.status, + result.signal_per_spad, result.ambient, result.signal_per_spad); // Clear sensor's interrupt status vl53_status = vl53l1x_clear_interrupt(VL53L1X_ADDR); } if (SL_STATUS_OK != vl53_status) { - app_log("VL53L1X sensor operation has been failed " - "during the periodic distancing.\n"); + app_printf("VL53L1X sensor operation has been failed " + "during the periodic distancing.\n"); } } -/**************************************************************************//** - * Application Process Action. - *****************************************************************************/ -void app_process_action(void) +static void app_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data) { + (void) data; + (void) handle; + + trigger_process = true; } diff --git a/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp b/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp index c0068072..8b34ceb6 100644 --- a/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp +++ b/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x.slcp @@ -39,20 +39,12 @@ component: - id: sleeptimer - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_distance_vl53l1x/image/create_example.png @@ -67,4 +59,4 @@ other_file: ui_hints: highlight: - path: README.md - focus: true \ No newline at end of file + focus: true diff --git a/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x_si91x.slcp b/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x_si91x.slcp new file mode 100644 index 00000000..622bc807 --- /dev/null +++ b/app/example/sparkfun_distance_vl53l1x/sparkfun_distance_vl53l1x_si91x.slcp @@ -0,0 +1,66 @@ +project_name: sparkfun_distance_vl53l1x_si91x +label: Third Party Hardware Drivers - VL53L1X - Distance Sensor (Sparkfun) +package: platform + +description: | + This example project shows an example for Sparkfun VL53L1X Distance board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_distance_vl53l1x/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: sparkfun_distance_vl53l1x + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_distance_vl53l1x/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_distance_vl53l1x/image/connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_distance_vl53l1x/image/console.png + directory: "image" + - path: ../../documentation/example/sparkfun_distance_vl53l1x/image/software_layers.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/sparkfun_dosimeter_type5/app.c b/app/example/sparkfun_dosimeter_type5/app.c index 99fa9ba9..2a65fa88 100644 --- a/app/example/sparkfun_dosimeter_type5/app.c +++ b/app/example/sparkfun_dosimeter_type5/app.c @@ -1,26 +1,52 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * - ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. ******************************************************************************/ #include "sparkfun_type5.h" + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else #include "app_log.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif + static void noise_callback(void); static void radiation_callback(void); @@ -44,10 +70,10 @@ void app_process_action(void) *****************************************************************************/ void radiation_callback(void) { - app_log("A wild gamma ray appeared\r\n"); - app_log("%2f uSv/h +/- %.2f\r\n", - sparkfun_type5_get_usvh(), - sparkfun_type5_get_usvh_error()); + app_printf("A wild gamma ray appeared\r\n"); + app_printf("%2f uSv/h +/- %.2f\r\n", + sparkfun_type5_get_usvh(), + sparkfun_type5_get_usvh_error()); } /**************************************************************************//** @@ -55,5 +81,5 @@ void radiation_callback(void) *****************************************************************************/ void noise_callback(void) { - app_log("Noise! Please stop moving\r\n"); + app_printf("Noise! Please stop moving\r\n"); } diff --git a/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp b/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp index aca40995..2d87a9ab 100644 --- a/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp +++ b/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5.slcp @@ -44,7 +44,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_dosimeter_type5/image/connection.png diff --git a/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5_si91x.slcp b/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5_si91x.slcp new file mode 100644 index 00000000..61141da8 --- /dev/null +++ b/app/example/sparkfun_dosimeter_type5/sparkfun_dosimeter_type5_si91x.slcp @@ -0,0 +1,64 @@ +project_name: sparkfun_dosimeter_type5_si91x +label: Third Party Hardware Drivers - Pocket Geiger Radiation Sensor - Type 5 (Sparkfun) +package: platform +description: | + This example project shows an example for Sparkfun Pocket Geiger Radiation Sensor - Type 5 board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_dosimeter_type5/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sparkfun_dosimeter_type5 + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_dosimeter_type5/image/connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_dosimeter_type5/image/log.png + directory: "image" + - path: ../../documentation/example/sparkfun_dosimeter_type5/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_dosimeter_type5/image/float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/sparkfun_environmental_bme280_ccs811/app.c b/app/example/sparkfun_environmental_bme280_ccs811/app.c index a7e14a2e..a9104262 100644 --- a/app/example/sparkfun_environmental_bme280_ccs811/app.c +++ b/app/example/sparkfun_environmental_bme280_ccs811/app.c @@ -1,34 +1,66 @@ /***************************************************************************//** - * @file app.c - * @brief Top level application functions for Qwiic BME280 and CCS811 driver + * @file + * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -/***************************************************************************//** - * Include. - ******************************************************************************/ +#include "sparkfun_bme280.h" +#include "sparkfun_ccs811.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" -#include "sl_sleeptimer.h" - #include "app_log.h" +#endif -#include "sparkfun_bme280.h" -#include "sparkfun_ccs811.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#define READING_INTERVAL_MSEC 1000 -#define READING_INTERVAL_MSEC 1000 +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif +static mikroe_i2c_handle_t app_i2c_instance = NULL; static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; @@ -39,36 +71,39 @@ static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); ******************************************************************************/ void app_init(void) { - sparkfun_bme280_i2c_t bme280_init_default; + app_printf("Application Initialization.\n"); - app_log("Application Initialization.\n"); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif - bme280_init_default = (sparkfun_bme280_i2c_t) BME280_I2C_DEFAULT; - sparkfun_bme280_i2c(&bme280_init_default); + sparkfun_bme280_i2c(app_i2c_instance, SPARKFUN_BME280_ADDR); if (sparkfun_bme280_init() == SL_STATUS_OK) { - app_log("BME280 on 0x%02X I2C address found and initialized.\n", - BME_280_DEFAULT_I2C_ADDR); + app_printf("BME280 on 0x%02X I2C address found and initialized.\n", + SPARKFUN_BME280_ADDR); } else { - app_log("BME280 on 0x%02X I2C address not found. Check cables. " - "\n\r Try also alternative address:", BME_280_DEFAULT_I2C_ADDR); - if (BME_280_DEFAULT_I2C_ADDR == 0x77) { - app_log(" 0x76\n"); + app_printf("BME280 on 0x%02X I2C address not found. Check cables. " + "\n\r Try also alternative address:", SPARKFUN_BME280_ADDR); + if (SPARKFUN_BME280_ADDR == 0x77) { + app_printf(" 0x76\n"); } else { - app_log(" 0x77\n"); + app_printf(" 0x77\n"); } } - if (!sparkfun_ccs811_init(sl_i2cspm_qwiic)) { - app_log("CCS811 on 0x%02X I2C address found and initialized.\n", - SPARKFUN_CCS811_DEFAULT_ADDR); + if (!sparkfun_ccs811_init(app_i2c_instance)) { + app_printf("CCS811 on 0x%02X I2C address found and initialized.\n", + SPARKFUN_CCS811_ADDR); } else { - app_log("CCS811 on 0x%02X I2C address not found. Check cables. " - "\n\r Try also alternative address\n", - SPARKFUN_CCS811_DEFAULT_ADDR); - if (SPARKFUN_CCS811_DEFAULT_ADDR == 0x5B) { - app_log(" 0x5A\n"); + app_printf("CCS811 on 0x%02X I2C address not found. Check cables. " + "\n\r Try also alternative address\n", + SPARKFUN_CCS811_ADDR); + if (SPARKFUN_CCS811_ADDR == 0x5B) { + app_printf(" 0x5A\n"); } else { - app_log(" 0x5B\n"); + app_printf(" 0x5B\n"); } } @@ -98,20 +133,20 @@ void app_process_action(void) sparkfun_bme280_ctrl_measure_set_to_work(); if (SL_STATUS_OK == sparkfun_bme280_read_temperature(&temp)) { - app_log("Temperature: %ld %cC\n", (temp / 100), 0XF8); + app_printf("Temperature: %ld %cC\n", (temp / 100), 0XF8); } if (SL_STATUS_OK == sparkfun_bme280_read_humidity(&hum)) { - app_log("Humidity: %ld%%\n", hum / 1000); + app_printf("Humidity: %ld%%\n", hum / 1000); } if (SL_STATUS_OK == sparkfun_bme280_read_pressure(&press)) { - app_log("Presure: %ld mBar\n", press); + app_printf("Presure: %ld mBar\n", press); } - if (!sparkfun_ccs811_get_measurement(sl_i2cspm_qwiic, &eco2, &tvoc)) { - app_log("CO2: %d ppm\n", eco2); - app_log("TVOC: %d ppb\n", tvoc); + if (!sparkfun_ccs811_get_measurement(&eco2, &tvoc)) { + app_printf("CO2: %d ppm\n", eco2); + app_printf("TVOC: %d ppb\n", tvoc); } } diff --git a/app/example/sparkfun_environmental_bme280_ccs811/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_environmental_bme280_ccs811/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_environmental_bme280_ccs811/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp b/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp index 2d33a533..b6829bc3 100644 --- a/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp +++ b/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811.slcp @@ -40,20 +40,12 @@ component: - id: sparkfun_air_quality_ccs811 from: third_party_hw_drivers -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_environmental_bme280_ccs811/image/console_log.png diff --git a/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811_si91x.slcp b/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811_si91x.slcp new file mode 100644 index 00000000..83419ef8 --- /dev/null +++ b/app/example/sparkfun_environmental_bme280_ccs811/sparkfun_environmental_bme280_ccs811_si91x.slcp @@ -0,0 +1,66 @@ +project_name: sparkfun_environmental_bme280_ccs811_si91x +label: Third Party Hardware Drivers - BME280 & CCS811 - Environmental Sensor Combo Breakout (Sparkfun) +package: platform +description: | + This example project shows an example for Sparkfun BME280 & CCS811 Environmental Sensor Combo board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_environmental_bme280_ccs811/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_atmospheric_bme280 + from: third_party_hw_drivers +- id: sparkfun_air_quality_ccs811 + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_environmental_bme280_ccs811/image/console_log.png + directory: "image" + - path: ../../documentation/example/sparkfun_environmental_bme280_ccs811/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_environmental_bme280_ccs811/image/hardware_connection.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_gnss_max_m10s/app.c b/app/example/sparkfun_gnss_max_m10s/app.c index 29f38093..461a23ab 100644 --- a/app/example/sparkfun_gnss_max_m10s/app.c +++ b/app/example/sparkfun_gnss_max_m10s/app.c @@ -68,7 +68,7 @@ static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; #define GNSS_DATA_RETRY_COUNT 5 #define GNSS_DATA_TIMEOUT_RETRY_DELAY 200 ///< In ms #define GNSS_PER_RETRY_DELAY 500 ///< In ms -#define GNSS_TASK_DELAY 2000 ///< In ms +#define GNSS_TASK_DELAY 1000 ///< In ms /// @brief Structure for MAX-M10s GNSS receiver data typedef struct { diff --git a/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s.slcp b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s.slcp index 193b64a7..8c0783a9 100644 --- a/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s.slcp +++ b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s.slcp @@ -47,14 +47,12 @@ toolchain_settings: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/hw_connection.png directory: "image" - - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png + - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example.png directory: "image" - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/log.png directory: "image" diff --git a/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s_si91x.slcp b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s_si91x.slcp index 51cc8a6a..afab6450 100644 --- a/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s_si91x.slcp +++ b/app/example/sparkfun_gnss_max_m10s/sparkfun_gnss_max_m10s_si91x.slcp @@ -1,8 +1,8 @@ project_name: sparkfun_gnss_max_m10s_si91x package: platform -label: Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun) - Si91x +label: Third Party Hardware Drivers - MAX-M10S - GNSS Receiver Breakout (Sparkfun) description: | - This example project shows an example for Sparkfun MAX-M10S - GNSS Receiver Breakout board driver integration on Si91x. + This example project shows an example for Sparkfun MAX-M10S - GNSS Receiver Breakout board driver integration. category: Example|Platform quality: evaluation @@ -42,16 +42,14 @@ component: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 other_file: - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/hw_connection.png directory: "image" - - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example_2.png + - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/create_example.png directory: "image" - path: ../../documentation/example/sparkfun_gnss_max_m10s/image/log.png directory: "image" diff --git a/app/example/sparkfun_hr_po_max30101_max32664/app.c b/app/example/sparkfun_hr_po_max30101_max32664/app.c index fada35c2..2dc0f9cb 100644 --- a/app/example/sparkfun_hr_po_max30101_max32664/app.c +++ b/app/example/sparkfun_hr_po_max30101_max32664/app.c @@ -33,18 +33,29 @@ * maintained and there may be no bug maintenance planned for these resources. * Silicon Labs may update projects from time to time. ******************************************************************************/ +#include "sl_component_catalog.h" #include "sl_sleeptimer.h" -#include "sl_i2cspm_instances.h" +#include "sparkfun_max30101_max32664.h" -#include "app_log.h" +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#include "sl_i2c_instances.h" -#include "sparkfun_max30101_max32664.h" +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#else /* None Si91x device */ +#include "sl_i2cspm_instances.h" +#include "app_log.h" +#define app_printf(...) app_log(__VA_ARGS__) +#endif #define READING_INTERVAL_MSEC 250 static bio_hub_data_t libBpm; static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_bio_hub_init(void); static void app_bio_hub_process(void); @@ -77,51 +88,57 @@ static void app_bio_hub_init(void) uint16_t sample_val; sl_status_t ret_code; - ret_code = bio_hub_init(sl_i2cspm_qwiic, 0); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + ret_code = bio_hub_init(app_i2c_instance, 0); if (SL_STATUS_OK == ret_code) { - app_log("Init success\r\n"); + app_printf("Init success\r\n"); } else { - app_log("Init failed\r\n"); + app_printf("Init failed\r\n"); } // Configuring just the BPM settings. if (SL_STATUS_OK == bio_hub_config_bpm(BIO_HUB_ALGO_MODE_ONE)) { - app_log("Sensor configured.\r\n"); + app_printf("Sensor configured.\r\n"); } else { - app_log("Error configuring sensor.\r\n"); + app_printf("Error configuring sensor.\r\n"); } // Set pulse width. if (SL_STATUS_OK == bio_hub_set_pulse_width(411)) { - app_log("Pulse Width Set.\r\n"); + app_printf("Pulse Width Set.\r\n"); } else { - app_log("Could not set Pulse Width.\r\n"); + app_printf("Could not set Pulse Width.\r\n"); } // Check that the pulse width was set. if (SL_STATUS_OK == bio_hub_read_pulse_width(&pulse_width)) { - app_log("Pulse Width: %d\r\n", pulse_width); + app_printf("Pulse Width: %d\r\n", pulse_width); } // Set sample rate per second. Remember that not every sample rate is // available with every pulse width. Check hookup guide for more information. ret_code = bio_hub_set_sample_rate(400); if (SL_STATUS_OK == ret_code) { - app_log("Sample Rate Set.\r\n"); + app_printf("Sample Rate Set.\r\n"); } else { - app_log("Could not set Sample Rate!\r\n"); + app_printf("Could not set Sample Rate!\r\n"); } // Check sample rate. ret_code = bio_hub_read_sample_rate(&sample_val); if (SL_STATUS_OK == ret_code) { - app_log("Sample rate is set to: %d\r\n", sample_val); + app_printf("Sample rate is set to: %d\r\n", sample_val); } // Data lags a bit behind the sensor, if you're finger is on the sensor when // it's being configured this delay will give some time for the data to catch // up. - app_log("Loading up the buffer with data....\r\n"); + app_printf("Loading up the buffer with data....\r\n"); sl_sleeptimer_delay_millisecond(4000); // starts a periodic timer to get data from sensor @@ -140,15 +157,15 @@ static void app_bio_hub_process(void) // Information from the bio_hub_read_bpm function will be saved to our "body" // variable. if (SL_STATUS_OK == bio_hub_read_bpm(&libBpm)) { - app_log("\r\nCount: %lu\r\n", count++); - app_log("Heartrate: %d\r\n", libBpm.heart_rate); - app_log("Confidence: %d\r\n", libBpm.confidence); - app_log("Oxygen: %d\r\n", libBpm.oxygen); - app_log("Status: %d\r\n", libBpm.status); + app_printf("\r\nCount: %lu\r\n", count++); + app_printf("Heartrate: %d\r\n", libBpm.heart_rate); + app_printf("Confidence: %d\r\n", libBpm.confidence); + app_printf("Oxygen: %d\r\n", libBpm.oxygen); + app_printf("Status: %d\r\n", libBpm.status); // Slow it down or your heart rate will go up trying to keep up // with the flow of numbers } else { - app_log("Read failed\r\n"); + app_printf("Read failed\r\n"); } } diff --git a/app/example/sparkfun_hr_po_max30101_max32664/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_hr_po_max30101_max32664/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_hr_po_max30101_max32664/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp b/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp index 38b3357f..6079b146 100644 --- a/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp +++ b/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664.slcp @@ -35,23 +35,14 @@ component: instance: [vcom] - id: i2cspm instance: [qwiic] -- id: sleeptimer - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_hr_po_max30101_max32664/image/create_example.png diff --git a/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664_si91x.slcp b/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664_si91x.slcp new file mode 100644 index 00000000..9abd042b --- /dev/null +++ b/app/example/sparkfun_hr_po_max30101_max32664/sparkfun_hr_po_max30101_max32664_si91x.slcp @@ -0,0 +1,64 @@ +project_name: sparkfun_hr_po_max30101_max32664_si91x +label: Third Party Hardware Drivers - MAX30101 & MAX32664 - Pulse Oximeter and Heart Rate Sensor (Sparkfun) - Si91x +package: platform +description: | + This example project shows an example for SparkFun Pulse Oximeter and Heart Rate Sensor board based on MAX30101 & MAX32664 driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_hr_po_max30101_max32664/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_hr_po_max30101_max32664 + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_hr_po_max30101_max32664/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_hr_po_max30101_max32664/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_hr_po_max30101_max32664/image/logs.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_human_presence_ak9753/app.c b/app/example/sparkfun_human_presence_ak9753/app.c index 9dbc46a6..39d8b3c6 100644 --- a/app/example/sparkfun_human_presence_ak9753/app.c +++ b/app/example/sparkfun_human_presence_ak9753/app.c @@ -33,19 +33,43 @@ * maintained and there may be no bug maintenance planned for these resources. * Silicon Labs may update projects from time to time. ******************************************************************************/ +#include "sparkfun_ak9753.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" #include "app_log.h" -#include "sparkfun_ak9753.h" +#endif + +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +static mikroe_i2c_handle_t app_i2c_instance = NULL; /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + sparkfun_ak9753_config_t sparkfun_ak9753_cfg = { .I2C_address = SPARKFUN_AK9753_ADDR, - .sparkfun_ak9753_i2cspm_instance = sl_i2cspm_qwiic, + .i2cspm_instance = app_i2c_instance, .cut_off_freq = SPARKFUN_AK975X_FREQ_8_8HZ, .mode = SPARKFUN_AK975X_MODE_0, .upper_threshold13 = 0x00, @@ -76,25 +100,25 @@ void app_process_action(void) int16_t ret = 0; float tempC = 0; float tempF = 0; - app_log("1:DWN["); + app_printf("1:DWN["); sparkfun_ak9753_get_ir1_data(&ret); - app_log("%d", ret); + app_printf("%d", ret); sparkfun_ak9753_get_ir2_data(&ret); - app_log("]\t2:LFT["); - app_log("%d", ret); + app_printf("]\t2:LFT["); + app_printf("%d", ret); sparkfun_ak9753_get_ir3_data(&ret); - app_log("]\t3:UP["); - app_log("%d", ret); + app_printf("]\t3:UP["); + app_printf("%d", ret); sparkfun_ak9753_get_ir4_data(&ret); - app_log("]\t4:RGH["); - app_log("%d", ret); + app_printf("]\t4:RGH["); + app_printf("%d", ret); sparkfun_ak9753_get_tempC(&tempC); - app_log("]\ttempC["); - app_log("%f", tempC); + app_printf("]\ttempC["); + app_printf("%f", tempC); sparkfun_ak9753_get_tempF(&tempF); - app_log("]\ttempF["); - app_log("%f", tempF); - app_log("]\r\n"); + app_printf("]\ttempF["); + app_printf("%f", tempF); + app_printf("]\r\n"); sparkfun_ak9753_get_dummy(); } } diff --git a/app/example/sparkfun_human_presence_ak9753/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_human_presence_ak9753/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_human_presence_ak9753/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp b/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp index fa07f2d6..90c75cc9 100644 --- a/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp +++ b/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753.slcp @@ -37,14 +37,6 @@ component: instance: [qwiic] - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" @@ -54,7 +46,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/create_example.png diff --git a/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753_si91x.slcp b/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753_si91x.slcp new file mode 100644 index 00000000..7d43f3b0 --- /dev/null +++ b/app/example/sparkfun_human_presence_ak9753/sparkfun_human_presence_ak9753_si91x.slcp @@ -0,0 +1,77 @@ +project_name: sparkfun_human_presence_ak9753_si91x +label: Third Party Hardware Drivers - AK9753 - Human Presence Sensor (Sparkfun) +package: platform +description: | + This example project shows an example for Sparkfun Human Presence Sensor driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_human_presence_ak9753/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_human_presence_ak9753 + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/hardware_jumper.png + directory: "image" + - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/normal_mode.png + directory: "image" + - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/simple_test_result.png + directory: "image" + - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/switch_mode.png + directory: "image" + - path: ../../documentation/example/sparkfun_human_presence_ak9753/image/float.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_ir_array_amg88xx/app.c b/app/example/sparkfun_ir_array_amg88xx/app.c index 492601f3..0e7de998 100644 --- a/app/example/sparkfun_ir_array_amg88xx/app.c +++ b/app/example/sparkfun_ir_array_amg88xx/app.c @@ -1,24 +1,57 @@ -/***************************************************************************//** - * @file - * @brief Top level application functions +/******************************************************************************* + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "sl_cli_command.h" #include "sl_cli_handles.h" #include "ir_array_amg88xx.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#else #include "sl_i2cspm_instances.h" +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +static mikroe_i2c_handle_t app_i2c_instance = NULL; extern const sl_cli_command_entry_t app_cli_command_table[]; @@ -37,7 +70,13 @@ sl_cli_command_group_t sl_cli_app_command_group = ******************************************************************************/ void app_init(void) { - amg88xx_init(sl_i2cspm_qwiic, AMG88XX_ADDRESS_OPEN, CELSIUS); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + amg88xx_init(app_i2c_instance, AMG88XX_ADDRESS_OPEN, CELSIUS); // Remove unused autogen CLI command group sl_cli_command_remove_command_group(sl_cli_vcom_handle, &sl_cli_vcom_command_group); diff --git a/app/example/sparkfun_ir_array_amg88xx/app_ir_array_cli_cmds.c b/app/example/sparkfun_ir_array_amg88xx/app_ir_array_cli_cmds.c index 4e791b79..16e76357 100644 --- a/app/example/sparkfun_ir_array_amg88xx/app_ir_array_cli_cmds.c +++ b/app/example/sparkfun_ir_array_amg88xx/app_ir_array_cli_cmds.c @@ -63,8 +63,9 @@ void app_get_sensor_array_temperatures(sl_cli_command_arg_t *arguments) float temperature_grid[8][8]; int8_t i = 0; int8_t j = 0; - I2C_TransferReturn_TypeDef read_result; - read_result = amg88xx_get_sensor_array_temperatures(temperature_grid); + + sl_status_t read_result = amg88xx_get_sensor_array_temperatures( + temperature_grid); if (read_result != SL_STATUS_OK) { printf("Error: i2c read failed"); } else { @@ -88,8 +89,9 @@ void app_get_sensor_array_temperatures_raw(sl_cli_command_arg_t *arguments) uint16_t temperature_grid[8][8]; int8_t i = 0; int8_t j = 0; - I2C_TransferReturn_TypeDef read_result; - read_result = amg88xx_get_sensor_array_temperatures_raw(temperature_grid); + + sl_status_t read_result = amg88xx_get_sensor_array_temperatures_raw( + temperature_grid); if (read_result != SL_STATUS_OK) { printf("Error: i2c read failed"); } else { diff --git a/app/example/sparkfun_ir_array_amg88xx/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_ir_array_amg88xx/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_ir_array_amg88xx/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp b/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp index 43809311..a1c6a546 100644 --- a/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp +++ b/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx.slcp @@ -5,6 +5,7 @@ description: | This example project shows an example for Sparkfun Grid-EYE Infrared Array Breakout board driver integration. category: Example|Platform quality: evaluation + filter: - name: Device Type value: [SoC] @@ -12,20 +13,25 @@ filter: value: [32-bit MCU] - name: Project Difficulty value: [Beginner] + readme: - path: ../../documentation/example/sparkfun_ir_array_amg88xx/README.md + source: - path: app_cli_command_table.c - path: app_ir_array_cli_cmds.c - path: app.c - path: main.c + include: - path: '' file_list: - path: app.h + component: - id: sl_system - id: device_init +- id: iostream_retarget_stdio - id: iostream_usart instance: [vcom] - id: i2cspm @@ -34,26 +40,25 @@ component: instance: [vcom] - id: sparkfun_ir_array_amg88xx from: third_party_hw_drivers +- id: printf + config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - override: component: cli file_id: sl_cli_config instance: vcom path: sl_cli_config_vcom.h + configuration: - name: SL_STACK_SIZE value: "10240" - name: SL_HEAP_SIZE value: "6144" + sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 + other_file: - path: ../../documentation/example/sparkfun_ir_array_amg88xx/image/create_example.png directory: image @@ -64,6 +69,7 @@ other_file: - path: ../../documentation/example/sparkfun_ir_array_amg88xx/image/thermal_image.png directory: image - path: ../../documentation/example/sparkfun_ir_array_amg88xx/temperatue_array_visualiser.py + ui_hints: highlight: - path: README.md diff --git a/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx_si91x.slcp b/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx_si91x.slcp new file mode 100644 index 00000000..99339367 --- /dev/null +++ b/app/example/sparkfun_ir_array_amg88xx/sparkfun_ir_array_amg88xx_si91x.slcp @@ -0,0 +1,88 @@ +project_name: sparkfun_ir_array_amg88xx_si91x +package: platform +label: Third Party Hardware Drivers - AMG88XX - Grid-EYE Infrared Array Breakout (Sparkfun) +description: | + This example project shows an example for Sparkfun Grid-EYE Infrared Array Breakout board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_ir_array_amg88xx/README.md +source: +- path: app_cli_command_table.c +- path: app_ir_array_cli_cmds.c +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: atomic +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: iostream_si91x + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_ir_array_amg88xx + from: third_party_hw_drivers +- id: iostream_uart_core_si91x +- id: iostream_retarget_stdio +- instance: [vcom] + id: iostream_uart_si91x +- instance: [vcom] + id: cli +- id: printf + +config_file: + - override: + component: cli + file_id: sl_cli_config + instance: vcom + path: sl_cli_config_vcom.h + +configuration: + - name: SL_STACK_SIZE + value: "10240" + - name: SL_HEAP_SIZE + value: "6144" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_ir_array_amg88xx/image/create_example.png + directory: image + - path: ../../documentation/example/sparkfun_ir_array_amg88xx/image/IR_array_struct.png + directory: image + - path: ../../documentation/example/sparkfun_ir_array_amg88xx/image/dev_kit.jpg + directory: image + - path: ../../documentation/example/sparkfun_ir_array_amg88xx/image/thermal_image.png + directory: image + - path: ../../documentation/example/sparkfun_ir_array_amg88xx/temperatue_array_visualiser.py + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/sparkfun_ir_array_mlx90640/app.c b/app/example/sparkfun_ir_array_mlx90640/app.c index 93015332..29e7e6a5 100644 --- a/app/example/sparkfun_ir_array_mlx90640/app.c +++ b/app/example/sparkfun_ir_array_mlx90640/app.c @@ -1,28 +1,60 @@ /***************************************************************************//** - * @file + * @file app.c * @brief Top level application functions ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" #include "app_assert.h" -#include "app_log.h" #include "sparkfun_mlx90640.h" #include "sparkfun_mlx90640_config.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" + +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#define I2C_INSTANCE_USED SL_I2C2 + +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#else +#include "sl_i2cspm_instances.h" +#include "app_log.h" + +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +static mikroe_i2c_handle_t app_i2c_instance = NULL; static float mlx90640_image[SPARKFUN_MLX90640_NUM_OF_PIXELS]; static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; @@ -36,18 +68,25 @@ void app_init(void) { sl_status_t sc; uint16_t refrate = 0; - sc = sparkfun_mlx90640_init(sl_i2cspm_qwiic, - MLX90640_I2C_ADDRESS); + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + sc = sparkfun_mlx90640_init(app_i2c_instance, + SPARKFUN_MLX90640_I2C_ADDRESS); if (sc == SL_STATUS_OK) { - app_log("\nMLX90640 initialized successfully\n"); + app_printf("\nMLX90640 initialized successfully\n"); sc = sparkfun_mlx90640_set_refresh_rate(0x03); app_assert_status(sc); sc = sparkfun_mlx90640_get_refresh_rate(&refrate); app_assert_status(sc); - app_log("RefreshRate: %x\n", refrate); + app_printf("RefreshRate: %x\n", refrate); sc = sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, 250, @@ -57,7 +96,7 @@ void app_init(void) 0); app_assert_status(sc); } else { - app_log("\nMLX90640 initialization failed!\n"); + app_printf("\nMLX90640 initialization failed!\n"); } } @@ -72,9 +111,9 @@ void app_process_action(void) for (int i = 0; i < SPARKFUN_MLX90640_NUM_OF_PIXELS; i++) { - app_log("%3.2f,", mlx90640_image[i]); + app_printf("%3.2f,", mlx90640_image[i]); } - app_log("\n"); + app_printf("\n"); } } diff --git a/app/example/sparkfun_ir_array_mlx90640/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_ir_array_mlx90640/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_ir_array_mlx90640/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp b/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp index b124c2a7..1d379644 100644 --- a/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp +++ b/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640.slcp @@ -39,14 +39,6 @@ component: - id: app_assert - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - configuration: - name: SL_STACK_SIZE value: "10240" @@ -62,7 +54,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/connection.png diff --git a/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640_si91x.slcp b/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640_si91x.slcp new file mode 100644 index 00000000..678f54d5 --- /dev/null +++ b/app/example/sparkfun_ir_array_mlx90640/sparkfun_ir_array_mlx90640_si91x.slcp @@ -0,0 +1,78 @@ +project_name: sparkfun_ir_array_mlx90640_si91x +label: Third Party Hardware Drivers - MLX90640 - IR Array Breakout (Sparkfun) +package: platform +description: | + This example project shows an example for Sparkfun IR Array MLX90640 board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_ir_array_mlx90640/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sparkfun_ir_array + from: third_party_hw_drivers +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/init_workflow.png + directory: "image" + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/memory_config.png + directory: "image" + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/workflow.png + directory: "image" + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/float.png + directory: "image" + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/demo.gif + directory: "image" + - path: ../../documentation/example/sparkfun_ir_array_mlx90640/image/image_generator.py + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp index fd78f34d..77707de9 100644 --- a/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp +++ b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306.slcp @@ -52,14 +52,12 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/bgm220_kit_sparkfun_oled.png directory: "image" - - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png + - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png directory: "image" - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/sparkfun_oled_board.png directory: "image" diff --git a/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306_si91x.slcp b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306_si91x.slcp index 050dd4ef..921682a0 100644 --- a/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306_si91x.slcp +++ b/app/example/sparkfun_micro_oled_ssd1306/sparkfun_micro_oled_ssd1306_si91x.slcp @@ -1,8 +1,8 @@ project_name: sparkfun_micro_oled_ssd1306_si91x package: platform -label: Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun) - Si91x +label: Third Party Hardware Drivers - SSD1306 - Micro OLED Breakout Qwiic (Sparkfun) description: | - This example project shows an example for Sparkfun SSD1306 - Micro OLED Breakout board driver integration on Si91x. + This example project shows an example for Sparkfun SSD1306 - Micro OLED Breakout board driver integration. category: Example|Platform quality: evaluation @@ -48,16 +48,14 @@ component: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 - id: wiseconnect3_sdk - version: 3.2.0 + version: 3.3.4 other_file: - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/bgm220_kit_sparkfun_oled.png directory: "image" - - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_1.png - directory: "image" - - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example_2.png + - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/create_example.png directory: "image" - path: ../../documentation/example/sparkfun_micro_oled_ssd1306/image/sparkfun_oled_board.png directory: "image" diff --git a/app/example/sparkfun_particulate_matter_sensor_sps30/app.c b/app/example/sparkfun_particulate_matter_sensor_sps30/app.c index 7a61dd05..60cca2b0 100644 --- a/app/example/sparkfun_particulate_matter_sensor_sps30/app.c +++ b/app/example/sparkfun_particulate_matter_sensor_sps30/app.c @@ -34,16 +34,40 @@ ******************************************************************************/ #include "sl_component_catalog.h" #include "sl_sleeptimer.h" -#include "app_log.h" #ifdef SL_CATALOG_PM_SPS30_I2C_PRESENT -#include "sl_i2cspm_instances.h" #include "sparkfun_sps30_i2c.h" #endif +#ifdef SL_CATALOG_PM_SPS30_UART_PRESENT +#include "sparkfun_sps30_uart.h" +#endif + +#if (defined(SLI_SI917)) +#include "rsi_debug.h" +#define app_printf(...) DEBUGOUT(__VA_ARGS__) + +#ifdef SL_CATALOG_PM_SPS30_I2C_PRESENT +#include "sl_i2c_instances.h" +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif +#ifdef SL_CATALOG_PM_SPS30_UART_PRESENT +#include "sl_si91x_usart.h" +#define USART_INSTANCE_USED UART_1 +static usart_peripheral_t uart_instance = USART_INSTANCE_USED; +#endif +#else /* None Si91x device */ +#include "app_log.h" +#define app_printf(...) app_log(__VA_ARGS__) + +#ifdef SL_CATALOG_PM_SPS30_I2C_PRESENT +#include "sl_i2cspm_instances.h" +#endif #ifdef SL_CATALOG_PM_SPS30_UART_PRESENT #include "sl_iostream_init_usart_instances.h" -#include "sparkfun_sps30_uart.h" +#include "sl_iostream_init_eusart_instances.h" +#endif #endif #define READING_INTERVAL_MSEC (3000) @@ -53,41 +77,60 @@ static volatile bool enable_reading_data = false; static void app_periodic_timer_cb(sl_sleeptimer_timer_handle_t *timer, void *data); +#ifdef SL_CATALOG_PM_SPS30_I2C_PRESENT +static mikroe_i2c_handle_t app_i2c_instance = NULL; +#endif +#ifdef SL_CATALOG_PM_SPS30_UART_PRESENT +mikroe_uart_handle_t app_uart_instance = NULL; +#endif + /***************************************************************************//** * Initialize application. ******************************************************************************/ void app_init(void) { static sl_status_t ret; - app_log_iostream_set(sl_iostream_vcom_handle); /* Initialize SPS 30 */ #ifdef SL_CATALOG_PM_SPS30_I2C_PRESENT - app_log("Hello world - SPS30 - Particulate Matter Sensor - I2C !!!\r\n"); - sps30_init(sl_i2cspm_mikroe); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_mikroe; +#endif + app_printf("Hello world - SPS30 - Particulate Matter Sensor - I2C !!!\r\n"); + sps30_init(app_i2c_instance); #endif #ifdef SL_CATALOG_PM_SPS30_UART_PRESENT - app_log("Hello world - SPS30 - Particulate Matter Sensor - UART !!!\r\n"); - sps30_init(sl_iostream_sps30_handle); +#if (defined(SLI_SI917)) + app_uart_instance = &uart_instance; +#else + app_uart_instance = sl_iostream_uart_mikroe_handle; + + sl_iostream_set_default(sl_iostream_vcom_handle); + app_log_iostream_set(sl_iostream_vcom_handle); +#endif + app_printf("Hello world - SPS30 - Particulate Matter Sensor - UART !!!\r\n"); + sps30_init(app_uart_instance); #endif /* Busy loop for initialization */ while (sps30_probe() != 0) { - app_log("SPS30 sensor probing failed\r\n"); + app_printf("SPS30 sensor probing failed\r\n"); sl_sleeptimer_delay_millisecond(1000); } - app_log("SPS30 sensor probing successful\r\n"); + app_printf("SPS30 sensor probing successful\r\n"); #ifdef SL_CATALOG_PM_SPS30_I2C_PRESENT uint8_t fw_major; uint8_t fw_minor; ret = sps30_read_firmware_version(&fw_major, &fw_minor); if (ret) { - app_log("Error reading version\r\n"); + app_printf("Error reading version\r\n"); } else { - app_log("FW Ver: %u.%u\r\n", fw_major, fw_minor); + app_printf("FW Ver: %u.%u\r\n", fw_major, fw_minor); } #endif #ifdef SL_CATALOG_PM_SPS30_UART_PRESENT @@ -95,27 +138,28 @@ void app_init(void) ret = sps30_read_version(&version); if (ret) { - app_log("Error reading version\r\n"); + app_printf("Error reading version\r\n"); } else { - app_log("FW Ver: %u.%u\r\n", version.firmware_major, - version.firmware_minor); - app_log("SHDLC Ver: %u.%u\r\n", version.shdlc_major, version.shdlc_minor); + app_printf("FW Ver: %u.%u\r\n", version.firmware_major, + version.firmware_minor); + app_printf("SHDLC Ver: %u.%u\r\n", version.shdlc_major, + version.shdlc_minor); } #endif uint8_t serial_number[SPS30_MAX_SERIAL_LEN]; ret = sps30_get_serial((char *)serial_number); if (ret) { - app_log("Error reading serial number\r\n"); + app_printf("Error reading serial number\r\n"); } else { - app_log("Serial Number: %s\r\n", serial_number); + app_printf("Serial Number: %s\r\n", serial_number); } ret = sps30_start_measurement(); if (ret) { - app_log("Error starting measurement\r\n"); + app_printf("Error starting measurement\r\n"); } else { - app_log("Measurements started\r\n"); + app_printf("Measurements started\r\n"); } // Start timer used for periodic indications. @@ -140,29 +184,29 @@ void app_process_action(void) ret = sps30_read_measurement(&measure); if (ret) { - app_log("Error reading measurement\r\n"); + app_printf("Error reading measurement\r\n"); } else { - app_log("<---------- Measured values ---------->\r\n" - "%0.2f pm1.0\r\n" - "%0.2f pm2.5\r\n" - "%0.2f pm4.0\r\n" - "%0.2f pm10.0\r\n" - "%0.2f nc0.5\r\n" - "%0.2f nc1.0\r\n" - "%0.2f nc2.5\r\n" - "%0.2f nc4.5\r\n" - "%0.2f nc10.0\r\n" - "%0.2f typical particle size\r\n", - measure.mc_1p0, - measure.mc_2p5, - measure.mc_4p0, - measure.mc_10p0, - measure.nc_0p5, - measure.nc_1p0, - measure.nc_2p5, - measure.nc_4p0, - measure.nc_10p0, - measure.typical_particle_size); + app_printf("<---------- Measured values ---------->\r\n" + "%0.2f pm1.0\r\n" + "%0.2f pm2.5\r\n" + "%0.2f pm4.0\r\n" + "%0.2f pm10.0\r\n" + "%0.2f nc0.5\r\n" + "%0.2f nc1.0\r\n" + "%0.2f nc2.5\r\n" + "%0.2f nc4.5\r\n" + "%0.2f nc10.0\r\n" + "%0.2f typical particle size\r\n", + measure.mc_1p0, + measure.mc_2p5, + measure.mc_4p0, + measure.mc_10p0, + measure.nc_0p5, + measure.nc_1p0, + measure.nc_2p5, + measure.nc_4p0, + measure.nc_10p0, + measure.typical_particle_size); } } } diff --git a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp index 71e3c180..fd4bb96e 100644 --- a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp +++ b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c.slcp @@ -29,7 +29,6 @@ include: component: - id: sl_system - id: device_init -- id: sleeptimer - id: app_log - id: i2cspm instance: [mikroe] @@ -46,7 +45,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection_1.png diff --git a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c_si91x.slcp b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c_si91x.slcp new file mode 100644 index 00000000..aa43c5f0 --- /dev/null +++ b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_i2c_si91x.slcp @@ -0,0 +1,75 @@ +project_name: sparkfun_particulate_matter_sensor_sps30_i2c_si91x +label: Third Party Hardware Drivers - SPS30 - Particulate Matter Sensor (Sparkfun) - I2C +package: platform +description: | + This project shows an example for Particulate Matter Sensor SPS30 driver using I2C interface. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: pm_sps30_i2c + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection_1.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/log_i2c.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/log_uart.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/driver_layer.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/install_float.png + directory: "image" +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp index 62ed8035..01e223aa 100644 --- a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp +++ b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart.slcp @@ -29,15 +29,18 @@ include: component: - id: sl_system - id: device_init -- id: sleeptimer - id: app_log - id: iostream_usart - instance: [sps30] + instance: [mikroe] - id: iostream_eusart instance: [vcom] - id: pm_sps30_uart from: third_party_hw_drivers +configuration: + - name: SL_IOSTREAM_USART_MIKROE_RX_BUFFER_SIZE + value: "256" + toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" @@ -46,7 +49,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection_1.png diff --git a/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart_si91x.slcp b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart_si91x.slcp new file mode 100644 index 00000000..b00e8a28 --- /dev/null +++ b/app/example/sparkfun_particulate_matter_sensor_sps30/sparkfun_particulate_matter_sensor_sps30_uart_si91x.slcp @@ -0,0 +1,77 @@ +project_name: sparkfun_particulate_matter_sensor_sps30_uart_si91x +label: Third Party Hardware Drivers - SPS30 - Particulate Matter Sensor (Sparkfun) - UART +package: platform +description: | + This project shows an example for Particulate Matter Sensor SPS30 driver using UART interface. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: pm_sps30_uart + from: third_party_hw_drivers + +configuration: + - name: SL_UART1_DMA_CONFIG_ENABLE + value: "0" + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection_1.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/hw_connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/log_i2c.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/log_uart.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/driver_layer.png + directory: "image" + - path: ../../documentation/example/sparkfun_particulate_matter_sensor_sps30/image/install_float.png + directory: "image" +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_proximity_vcnl4040/app.c b/app/example/sparkfun_proximity_vcnl4040/app.c index c13dcfdb..c720351c 100644 --- a/app/example/sparkfun_proximity_vcnl4040/app.c +++ b/app/example/sparkfun_proximity_vcnl4040/app.c @@ -1,33 +1,66 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - -/***************************************************************************//** - * Initialize application. - ******************************************************************************/ -#include "sl_i2cspm_instances.h" #include "sl_sleeptimer.h" - +#include "sparkfun_vcnl4040.h" #include "app_assert.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" #include "app_log.h" +#endif -#include "sparkfun_vcnl4040.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif -#define READING_INTERVAL_MSEC 1000 +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif +#define READING_INTERVAL_MSEC 1000 + +static mikroe_i2c_handle_t app_i2c_instance = NULL; static sl_sleeptimer_timer_handle_t app_timer_handle; static volatile bool app_timer_expire = false; @@ -41,14 +74,20 @@ void app_init(void) sl_status_t sc; uint16_t id; - app_log("\r======== VCNL4040 Proximity Sensor Driver ========\n"); - sc = sparkfun_vcnl4040_init(sl_i2cspm_qwiic); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + app_printf("\r======== VCNL4040 Proximity Sensor Driver ========\n"); + sc = sparkfun_vcnl4040_init(app_i2c_instance); app_assert(sc == SL_STATUS_OK, "\rVCNL4040 Init fail...\n"); - app_log("\rVCNL4040 Init done...\n"); + app_printf("\rVCNL4040 Init done...\n"); sparkfun_vcnl4040_get_id(&id); - app_log("\rDevice ID: 0x%X\n", id); - app_log("\r\t==================================\n"); + app_printf("\rDevice ID: 0x%X\n", id); + app_printf("\r\t==================================\n"); sc = sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, READING_INTERVAL_MSEC, @@ -58,9 +97,9 @@ void app_init(void) 0); if (sc != SL_STATUS_OK) { - app_log("\r > Start Periodic Measurement Fail\n"); + app_printf("\r > Start Periodic Measurement Fail\n"); } else { - app_log("\r > Start Periodic Measurement\n"); + app_printf("\r > Start Periodic Measurement\n"); } } @@ -84,9 +123,9 @@ void app_process_action(void) sc |= sparkfun_vcnl4040_get_white(&white); if (sc != SL_STATUS_OK) { - app_log("\r > Reading data failed\n"); + app_printf("\r > Reading data failed\n"); } else { - app_log( + app_printf( "\r > Proximity value: % 4d\tAmbient light value: % 4d\tWhite light value: % 4d\n", prox, ambient, diff --git a/app/example/sparkfun_proximity_vcnl4040/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_proximity_vcnl4040/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_proximity_vcnl4040/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp b/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp index 08d39918..efe6494d 100644 --- a/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp +++ b/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040.slcp @@ -39,20 +39,12 @@ component: - id: app_assert - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/connection.png @@ -61,8 +53,6 @@ other_file: directory: "image" - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/flowchart.png directory: "image" - - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/config.png - directory: "image" - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/test.png directory: "image" @@ -70,4 +60,3 @@ ui_hints: highlight: - path: README.md focus: true - diff --git a/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040_si91x.slcp b/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040_si91x.slcp new file mode 100644 index 00000000..939fa208 --- /dev/null +++ b/app/example/sparkfun_proximity_vcnl4040/sparkfun_proximity_vcnl4040_si91x.slcp @@ -0,0 +1,69 @@ +project_name: sparkfun_proximity_vcnl4040_si91x +label: Third Party Hardware Drivers - VCNL4040 - Proximity Sensor (Sparkfun) +package: platform +description: | + This example project shows an example for Sparkfun Proximity VCNL4040 board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_proximity_vcnl4040/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- id: sparkfun_proximity + from: third_party_hw_drivers +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: app_assert + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + +other_file: + - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/flowchart.png + directory: "image" + - path: ../../documentation/example/sparkfun_proximity_vcnl4040/image/test.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/sparkfun_qwiic_joystick/app.c b/app/example/sparkfun_qwiic_joystick/app.c index b006d5e5..d0b09a53 100644 --- a/app/example/sparkfun_qwiic_joystick/app.c +++ b/app/example/sparkfun_qwiic_joystick/app.c @@ -34,16 +34,34 @@ * This code will not be maintained. * ******************************************************************************/ +#include "sparkfun_qwiic_joystick.h" #include "sl_sleeptimer.h" -#include "app_log.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" -#include "sparkfun_qwiic_joystick.h" +#include "app_log.h" +#endif -#define READING_INTERVAL_MSEC 200 +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + +#define READING_INTERVAL_MSEC 200 static volatile bool read_position = false; // Periodic timer handle. static sl_sleeptimer_timer_handle_t app_periodic_timer; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_periodic_timer_cb(sl_sleeptimer_timer_handle_t *timer, void *data); @@ -54,23 +72,41 @@ static void app_periodic_timer_cb(sl_sleeptimer_timer_handle_t *timer, void app_init(void) { sl_status_t sc; - uint8_t addr[255]; - uint8_t num_dev; + uint8_t address[255]; + uint8_t num_dev = 0; - // initialize joystick. - sc = sparkfun_joystick_init(sl_i2cspm_qwiic, SPARKFUN_JOYSTICK_DEFAULT_ADDR); - if (sc != SL_STATUS_OK) { - app_log("Warning! Failed to initialize Joystick\r\n"); - } else { - app_log("Joystick initialized successfully!\r\n"); - } +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + // Initialize joystick. + sc = sparkfun_joystick_init(app_i2c_instance, SPARKFUN_JOYSTICK_DEFAULT_ADDR); + + if (sc == SL_STATUS_NOT_AVAILABLE) { + app_printf("Joystick not found on the specified address.\r\r\n"); + app_printf("\r\nScanning address of all Joysticks...\n"); + sparkfun_joystick_scan_address(address, &num_dev); + + if (num_dev == 0) { + app_printf("No device is found on I2C bus.\r\r\n"); + return; + } - app_log("\r\nScan I2C address of all Joystick connected on the I2C bus.\r\n"); - sc = sparkfun_joystick_scan_address(addr, &num_dev); - for (int i = 0; i < num_dev; i++) { - app_log("Device %d: address: 0x%x\r\n", i + 1, *addr + i); + for (int i = 0; i < num_dev; i++) { + app_printf("\rDevice %d: address: 0x%x\n", i + 1, address[i]); + } + + app_printf("Select the desired device, build and rerun the example.\r\n"); + return; + } else if (sc != SL_STATUS_OK) { + app_printf("Failed to initialize Joystick!\r\n"); + return; } + app_printf("Joystick initialized successfully!\r\n"); + // Start timer used for periodic indications. sl_sleeptimer_start_periodic_timer_ms(&app_periodic_timer, READING_INTERVAL_MSEC, @@ -78,7 +114,7 @@ void app_init(void) NULL, 0, 1); - app_log("\r\nStart reading Position\r\n"); + app_printf("\r\nStart reading Position\r\n"); } /***************************************************************************//** @@ -99,25 +135,25 @@ void app_process_action(void) // Reading current horizontal position sc = sparkfun_joystick_read_horizontal_position(&data_pos); if (sc != SL_STATUS_OK) { - app_log("Warning! Invalid Joystick reading\r\n"); + app_printf("Warning! Invalid Joystick reading\r\n"); } else { - app_log("X = %d, ", data_pos); + app_printf("X = %d, ", data_pos); } // Reading current vertical position sc = sparkfun_joystick_read_vertical_position(&data_pos); if (sc != SL_STATUS_OK) { - app_log("Warning! Invalid Joystick reading\r\n"); + app_printf("Warning! Invalid Joystick reading\r\n"); } else { - app_log("Y = %d, ", data_pos); + app_printf("Y = %d, ", data_pos); } // Read button postion sc = sparkfun_joystick_read_button_position(&bt_pos); if (sc != SL_STATUS_OK) { - app_log("Warning! Invalid Joystick reading\r\n"); + app_printf("Warning! Invalid Joystick reading\r\n"); } else { - app_log("Button = %d\r\n", bt_pos); + app_printf("Button = %d\r\n", bt_pos); } } diff --git a/app/example/sparkfun_qwiic_joystick/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_qwiic_joystick/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_qwiic_joystick/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp b/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp index 6a52bd69..fdee36b2 100644 --- a/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp +++ b/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick.slcp @@ -35,23 +35,14 @@ component: instance: [vcom] - id: i2cspm instance: [qwiic] -- id: sleeptimer - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - define: - name: DEBUG_EFM sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_qwiic_joystick/image/logs.png diff --git a/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick_si91x.slcp b/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick_si91x.slcp new file mode 100644 index 00000000..70ed8d36 --- /dev/null +++ b/app/example/sparkfun_qwiic_joystick/sparkfun_qwiic_joystick_si91x.slcp @@ -0,0 +1,65 @@ +project_name: sparkfun_qwiic_joystick +label: Third Party Hardware Drivers - Qwiic Joystick (Sparkfun) +package: platform +description: | + This project shows the implementation of a Joystick module that is integrated on the SparkFun Qwiic Joystick board. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_qwiic_joystick/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_qwiic_joystick + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/sparkfun_qwiic_joystick/image/logs.png + directory: "image" + - path: ../../documentation/example/sparkfun_qwiic_joystick/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_qwiic_joystick/image/hardware_connection.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_qwiic_keypad/app.c b/app/example/sparkfun_qwiic_keypad/app.c index 29f4bfd9..068d82ae 100644 --- a/app/example/sparkfun_qwiic_keypad/app.c +++ b/app/example/sparkfun_qwiic_keypad/app.c @@ -1,23 +1,49 @@ /***************************************************************************//** - * @file - * @brief Top level application functions + * @file app.c + * @brief Example application ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ #include "app.h" +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif + static volatile bool new_keypad_event = false; -static sl_sleeptimer_timer_handle_t button_read_timer; +static mikroe_i2c_handle_t app_i2c_instance = NULL; #ifdef SAPRKFUN_KEYPAD_INT_PIN_EN @@ -26,13 +52,14 @@ static sl_sleeptimer_timer_handle_t button_read_timer; ******************************************************************************/ void app_sparkfun_buttonEvent_callback(const uint8_t pin) { - if (pin == SPARKFUN_KEYPAD_GPIO_INT_PIN) { - new_keypad_event = true; - } + (void)pin; + new_keypad_event = true; } #else //SAPRKFUN_KEYPAD_INT_PIN_EN +static sl_sleeptimer_timer_handle_t button_read_timer; + /***************************************************************************//** * Callback for the timer. ******************************************************************************/ @@ -57,13 +84,13 @@ void app_init_sleeptimer(void) 0, 0); if (error_code == SL_STATUS_OK) { - printf("Sleep timer initialized successfully.\n"); + app_printf("Sleep timer initialized successfully.\r\n"); } else if (error_code == SL_STATUS_NULL_POINTER) { - printf("Error, invslid sleeptimer handle.\n"); + app_printf("Error, invslid sleeptimer handle.\r\n"); } else if (error_code == SL_STATUS_INVALID_STATE) { - printf("Error, sleeptimer already running.\n"); + app_printf("Error, sleeptimer already running.\r\n"); } else if (error_code == SL_STATUS_INVALID_PARAMETER) { - printf("Error, invalid sleeptimer time_out parameter.\n"); + app_printf("Error, invalid sleeptimer time_out parameter.\r\n"); } } @@ -74,11 +101,11 @@ void app_init_sleeptimer(void) ******************************************************************************/ void app_init(void) { -#ifdef SAPRKFUN_KEYPAD_INT_PIN_EN + app_init_keypad(); + +#ifndef SAPRKFUN_KEYPAD_INT_PIN_EN app_init_sleeptimer(); #endif //SAPRKFUN_KEYPAD_INT_PIN_EN - - app_init_keypad(); } /***************************************************************************//** @@ -98,29 +125,50 @@ void app_process_action(void) void app_init_keypad(void) { sl_status_t status; - status = sparkfun_keypad_init(sl_i2cspm_qwiic, sparkfun_keypad_get_address()); - if (status == SL_STATUS_INITIALIZATION) { - uint8_t address = 0; - uint8_t num_dev = 0; - printf("Keypad not found on the specified address.\n"); - status = sparkfun_keypad_scan_address(&address, &num_dev); - if (status == SL_STATUS_NULL_POINTER) { - printf("Keypad address scanner invallid input parameter.\n"); - } else { - printf("Keypad address found!\n"); + uint8_t address[255]; + uint8_t num_dev = 0; + frw_rev_t fw; + +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + +#ifdef SAPRKFUN_KEYPAD_INT_PIN_EN + status = sparkfun_keypad_init(app_i2c_instance, SPARKFUN_KEYPAD_DEFAULT_ADDR, + &app_sparkfun_buttonEvent_callback); +#else + status = sparkfun_keypad_init(app_i2c_instance, + SPARKFUN_KEYPAD_DEFAULT_ADDR, + NULL); +#endif + + if (status == SL_STATUS_NOT_AVAILABLE) { + app_printf("Keypad not found on the specified address.\r\r\n"); + app_printf("\r\nScanning address of all keypads...\n"); + status = sparkfun_keypad_scan_address(address, &num_dev); + + if (num_dev == 0) { + app_printf("No device is found on I2C bus.\r\r\n"); + return; } - status = sparkfun_keypad_init(sl_i2cspm_qwiic, address); - if (status == SL_STATUS_OK) { - printf("I2C initialized successfully\n"); - } else { - printf("I2C initialization failed\n"); + + for (int i = 0; i < num_dev; i++) { + app_printf("\rDevice %d: address: 0x%x\n", i + 1, address[i]); } - } else if (status == SL_STATUS_NULL_POINTER) { - printf("I2C initialization failed, null pointer error\n"); - } else if (status == SL_STATUS_INVALID_PARAMETER) { - printf("I2C initialization error, invalid address\n"); - } else { - printf("I2C initialized successfully\n"); + + app_printf("Select the desired device, build and rerun the example.\r\n"); + return; + } else if (status != SL_STATUS_OK) { + app_printf("Failed to initialize Keypad!\r\n"); + return; + } + + app_printf("Keypad initialized successfully!\r\n"); + + if (SL_STATUS_OK == sparkfun_keypad_get_firmware_version(&fw)) { + app_printf("Keypad FW: %02d.%02d\r\n", fw.major, fw.minor); } } @@ -133,6 +181,6 @@ void app_handle_new_button(void) sparkfun_keypad_update_fifo(); sparkfun_keypad_read_last_button(&new_btn); if (new_btn > 0) { - printf("The last pressed button: %c\n", new_btn); + app_printf("The last pressed button: %c\r\n", new_btn); } } diff --git a/app/example/sparkfun_qwiic_keypad/app.h b/app/example/sparkfun_qwiic_keypad/app.h index 03684609..43a5b661 100644 --- a/app/example/sparkfun_qwiic_keypad/app.h +++ b/app/example/sparkfun_qwiic_keypad/app.h @@ -14,17 +14,29 @@ * sections of the MSLA applicable to Source Code. * ******************************************************************************/ - #ifndef APP_H #define APP_H +#include "sparkfun_qwiic_keypad.h" +#include "sl_sleeptimer.h" +#include "sparkfun_keypad_config.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" -#include "printf.h" -#include "sparkfun_qwiic_keypad.h" +#include "app_log.h" +#endif -#ifdef SAPRKFUN_KEYPAD_INT_PIN_EN +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif -#include "gpiointerrupt.h" +#define SAPRKFUN_KEYPAD_INT_PIN_EN + +#ifdef SAPRKFUN_KEYPAD_INT_PIN_EN /***************************************************************************//** * Callback for the intertrupt. diff --git a/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp b/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp index 6776c894..57346301 100644 --- a/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp +++ b/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad.slcp @@ -35,9 +35,7 @@ component: instance: [vcom] - id: i2cspm instance: [qwiic] -- id: sleeptimer -- id: printf -- id: gpiointerrupt +- id: app_log config_file: - override: @@ -52,7 +50,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_qwiic_keypad/image/logs.png diff --git a/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad_si91x.slcp b/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad_si91x.slcp new file mode 100644 index 00000000..ff765f07 --- /dev/null +++ b/app/example/sparkfun_qwiic_keypad/sparkfun_qwiic_keypad_si91x.slcp @@ -0,0 +1,65 @@ +project_name: sparkfun_qwiic_keypad_si91x +label: Third Party Hardware Drivers - Qwiic Keypad (Sparkfun) +package: platform +description: | + This project shows the implementation of a Keypad module that is integrated on the SparkFun Qwiic Keypad board. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_qwiic_keypad/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_qwiic_keypad + from: third_party_hw_drivers + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/sparkfun_qwiic_keypad/image/logs.png + directory: "image" + - path: ../../documentation/example/sparkfun_qwiic_keypad/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_qwiic_keypad/image/hardware_connection.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_rfid_id12la/app.c b/app/example/sparkfun_rfid_id12la/app.c index 4ef03e1b..95bced20 100644 --- a/app/example/sparkfun_rfid_id12la/app.c +++ b/app/example/sparkfun_rfid_id12la/app.c @@ -33,14 +33,32 @@ * maintained and there may be no bug maintenance planned for these resources. * Silicon Labs may update projects from time to time. ******************************************************************************/ + +#include "app_assert.h" +#include "sparkfun_rfid_id12la.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else #include "sl_i2cspm_instances.h" #include "app_log.h" -#include "app_assert.h" +#endif -#include "sparkfun_rfid_id12la.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif static id12la_tag_list_t id12la_all_tag_data; static uint8_t count_tag = 0; +static mikroe_i2c_handle_t app_i2c_instance = NULL; /***************************************************************************//** * Initialize application. @@ -49,17 +67,26 @@ void app_init(void) { sl_status_t ret; - ret = sparkfun_id12la_init(sl_i2cspm_rfid); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif - if (ret != SL_STATUS_OK) { - app_log("I2C address has been changed before\n"); + ret = sparkfun_id12la_init(app_i2c_instance); + + if (ret == SL_STATUS_NOT_AVAILABLE) { + app_printf( + "Device is not present on the I2C bus or I2C address has been changed before\n"); ret = sparkfun_id12la_scan_address(); app_assert_status(ret); - app_log("I2C address is: 0x%02X\n", sparkfun_id12la_get_i2c_address()); - app_log("RFID begins successfully, ready to scan some tags\n"); - } else { - app_log("RFID inits successfully, ready scans some tags\n"); + app_printf("I2C address is: 0x%02X\n", sparkfun_id12la_get_i2c_address()); + } else if (ret != SL_STATUS_OK) { + app_printf("Failed to initialize RFID\r\n"); + return; } + + app_printf("RFID inits successfully, ready scans some tags\n"); } /***************************************************************************//** @@ -69,25 +96,27 @@ void app_process_action(void) { if (sparkfun_id12la_get_all_tag(&id12la_all_tag_data, &count_tag) != SL_STATUS_OK) { - app_log("error while scanning tags, check connection!!!\n"); + app_printf("error while scanning tags, check connection!!!\n"); } if (count_tag > 0) { - app_log("count tag: %d\n", count_tag); + app_printf("count tag: %d\n", count_tag); for (uint8_t i = 0; i < count_tag; i++) { if (id12la_all_tag_data.id12la_data[i].checksum_valid == true) { - app_log("ID (last byte is checksum): 0x%02X 0x%02X 0x%02X 0x%02X \ - 0x%02X 0x%02X\n", - id12la_all_tag_data.id12la_data[i].id_tag[0], \ - id12la_all_tag_data.id12la_data[i].id_tag[1], \ - id12la_all_tag_data.id12la_data[i].id_tag[2], \ - id12la_all_tag_data.id12la_data[i].id_tag[3], \ - id12la_all_tag_data.id12la_data[i].id_tag[4], \ - id12la_all_tag_data.id12la_data[i].id_tag[5]); - app_log("Scan time: %ld\n\n", id12la_all_tag_data.id12la_data[i].time); + app_printf( + "ID (last byte is checksum): 0x%02X 0x%02X 0x%02X 0x%02X \ + 0x%02X 0x%02X\n", + id12la_all_tag_data.id12la_data[i].id_tag[0], \ + id12la_all_tag_data.id12la_data[i].id_tag[1], \ + id12la_all_tag_data.id12la_data[i].id_tag[2], \ + id12la_all_tag_data.id12la_data[i].id_tag[3], \ + id12la_all_tag_data.id12la_data[i].id_tag[4], \ + id12la_all_tag_data.id12la_data[i].id_tag[5]); + app_printf("Scan time: %ld\n\n", + id12la_all_tag_data.id12la_data[i].time); } else { - app_log("Tag %d : checksum error, please scan the tag again\n", i); + app_printf("Tag %d : checksum error, please scan the tag again\n", i); } } } diff --git a/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp b/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp index dfb95fbe..9aa74a4b 100644 --- a/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp +++ b/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la.slcp @@ -34,7 +34,7 @@ component: - id: iostream_usart instance: [vcom] - id: i2cspm - instance: [rfid] + instance: [qwiic] - id: app_log - id: app_assert @@ -43,7 +43,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_rfid_id12la/image/api_overview.png diff --git a/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la_si91x.slcp b/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la_si91x.slcp new file mode 100644 index 00000000..2e989fb6 --- /dev/null +++ b/app/example/sparkfun_rfid_id12la/sparkfun_rfid_id12la_si91x.slcp @@ -0,0 +1,67 @@ +project_name: rfid_id12la_si91x +package: platform +label: Third Party Hardware Drivers - ID-12LA - RFID Qwiic Reader (Sparkfun) +description: | + This example project shows an example for Sparkfun Sparkfun RFID Reader ID-12LA board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_rfid_id12la/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sparkfun_rfid_id12la + from: third_party_hw_drivers +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/sparkfun_rfid_id12la/image/api_overview.png + directory: "image" + - path: ../../documentation/example/sparkfun_rfid_id12la/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_rfid_id12la/image/flowchart.png + directory: "image" + - path: ../../documentation/example/sparkfun_rfid_id12la/image/hardware_connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_rfid_id12la/image/testing_result.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/sparkfun_soil_moisture/app.c b/app/example/sparkfun_soil_moisture/app.c index b0be7847..17c6c788 100644 --- a/app/example/sparkfun_soil_moisture/app.c +++ b/app/example/sparkfun_soil_moisture/app.c @@ -37,44 +37,79 @@ * Initialize application. ******************************************************************************/ #include "sl_sleeptimer.h" -#include "sl_i2cspm_instances.h" +#include "sparkfun_soil_moisture.h" +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" #include "app_log.h" -#include "app_assert.h" +#endif -#include "sparkfun_soil_moisture.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif -#define MOISTURE_THRESHOLD 70 -#define READING_INTERVAL_MSEC 1000 +#define MOISTURE_THRESHOLD 70 +#define READING_INTERVAL_MSEC 1000 static volatile bool app_timer_expire = false; static sl_sleeptimer_timer_handle_t app_timer_handle; +static mikroe_i2c_handle_t app_i2c_instance = NULL; static void app_timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); void app_init(void) { sl_status_t sc; - uint16_t addr[255]; - uint8_t num_dev; + uint16_t address[255]; + uint8_t num_dev = 0; + + app_printf("\r\t\tSEN-17731 Soil moisture sensor test program\n"); - app_log("\r\t\tSEN-17731 Soil moisture sensor test program\n"); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif - sc = sparkfun_soil_moisture_init(sl_i2cspm_qwiic, + sc = sparkfun_soil_moisture_init(app_i2c_instance, SPARKFUN_SOIL_MOISTURE_DEFAULT_ADDR); - app_assert(sc == SL_STATUS_OK, "\rSparkfun soil moisture init fail\n"); + if (sc == SL_STATUS_NOT_AVAILABLE) { + app_printf("Soil moisture not found on the specified address.\r\r\n"); + app_printf("\r\nScanning address of all soil moisture sensors...\n"); + sparkfun_soil_moisture_scan_address(address, &num_dev); + + if (num_dev == 0) { + app_printf("No device is found on I2C bus.\r\r\n"); + return; + } + + for (int i = 0; i < num_dev; i++) { + app_printf("\rDevice %d: address: 0x%x\n", i + 1, *(address + i)); + } - app_log("\r\nScanning address of all soil moisture sensors...\n"); - sc = sparkfun_soil_moisture_scan_address(addr, &num_dev); - app_assert((sc == SL_STATUS_OK) || (num_dev != 0), "\rNo device connected\n"); - for (int i = 0; i < num_dev; i++) { - app_log("\rDevice %d: address: 0x%x\n", i + 1, *(addr + i)); + app_printf("Select the desired device, build and rerun the example.\r\n"); + return; + } else if (sc != SL_STATUS_OK) { + app_printf("Warning! Failed to initialize soil moisture sensors\r\n"); + return; } - app_log("\r\nStart calibrating the sensor...\n"); + app_printf("Soil moisture sensors initialized successfully!\r\n"); + + app_printf("\r\nStart calibrating the sensor...\n"); sparkfun_soil_moisture_set_dry_value(90); sparkfun_soil_moisture_set_wet_value(1023); - app_log("\rCalibrating done...\n"); + app_printf("\rCalibrating done...\n"); sc = sl_sleeptimer_start_periodic_timer_ms(&app_timer_handle, READING_INTERVAL_MSEC, @@ -83,9 +118,9 @@ void app_init(void) 0, 1); if (sc != SL_STATUS_OK) { - app_log("\r\n > Start periodic measuring soil moisture Fail\n"); + app_printf("\r\n > Start periodic measuring soil moisture Fail\n"); } else { - app_log("\r\n > Start periodic measuring soil moisture...\n"); + app_printf("\r\n > Start periodic measuring soil moisture...\n"); } } @@ -105,9 +140,9 @@ void app_process_action(void) sc = sparkfun_soil_moisture_get_moisture(&moisture); if (sc != SL_STATUS_OK) { - app_log("\r > Reading data failed\n"); + app_printf("\r > Reading data failed\n"); } else { - app_log("\r > Soil moisture: %d%%\n", moisture); + app_printf("\r > Soil moisture: %d%%\n", moisture); if (moisture > MOISTURE_THRESHOLD) { sparkfun_soil_moisture_led_on(); } else { diff --git a/app/example/sparkfun_soil_moisture/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_soil_moisture/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_soil_moisture/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp b/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp index 29543a6e..bd207e30 100644 --- a/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp +++ b/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture.slcp @@ -39,17 +39,9 @@ component: - id: app_assert - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 define: - name: DEBUG_EFM diff --git a/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture_si91x.slcp b/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture_si91x.slcp new file mode 100644 index 00000000..b9f0cad0 --- /dev/null +++ b/app/example/sparkfun_soil_moisture/sparkfun_soil_moisture_si91x.slcp @@ -0,0 +1,67 @@ +project_name: sparkfun_soil_moisture_si91x +label: Third Party Hardware Drivers - Qwiic Soil Moisture Sensor (Sparkfun) - I2C +package: platform +description: | + This example project shows an example for Sparkfun Soil Moisture Sensor board driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_soil_moisture/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- id: sleeptimer_si91x + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_soil_moisture + from: third_party_hw_drivers + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/sparkfun_soil_moisture/image/connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_soil_moisture/image/flowchart.png + directory: "image" + - path: ../../documentation/example/sparkfun_soil_moisture/image/result.png + directory: "image" + - path: ../../documentation/example/sparkfun_soil_moisture/image/create_example.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb diff --git a/app/example/sparkfun_spectroscopy_as7265x/app.c b/app/example/sparkfun_spectroscopy_as7265x/app.c index c55053a3..7f44ed90 100644 --- a/app/example/sparkfun_spectroscopy_as7265x/app.c +++ b/app/example/sparkfun_spectroscopy_as7265x/app.c @@ -37,12 +37,27 @@ ******************************************************************************/ #include "sl_sleeptimer.h" -#include "sl_i2cspm_instances.h" - +#include "sparkfun_as7265x.h" #include "app_assert.h" + +#if (defined(SLI_SI917)) +#include "sl_i2c_instances.h" +#include "rsi_debug.h" +#else +#include "sl_i2cspm_instances.h" #include "app_log.h" +#endif -#include "sparkfun_as7265x.h" +#if (defined(SLI_SI917)) +#define app_printf(...) DEBUGOUT(__VA_ARGS__) +#else +#define app_printf(...) app_log(__VA_ARGS__) +#endif + +#if (defined(SLI_SI917)) +#define I2C_INSTANCE_USED SL_I2C2 +static sl_i2c_instance_t i2c_instance = I2C_INSTANCE_USED; +#endif // Choose which type of test you want by uncommenting the #define @@ -51,6 +66,8 @@ // #define TEST_READ_RAW_VALUE // #define TEST_MAX_READ_RATE +static mikroe_i2c_handle_t app_i2c_instance = NULL; + /***************************************************************************//** * Initialize application. ******************************************************************************/ @@ -61,43 +78,49 @@ void app_init(void) uint8_t hardware_version_data = 0; sparkfun_as7265x_firmware_version_t firmware_version_data; - status = sparkfun_as7265x_init(sl_i2cspm_qwiic); +#if (defined(SLI_SI917)) + app_i2c_instance = &i2c_instance; +#else + app_i2c_instance = sl_i2cspm_qwiic; +#endif + + status = sparkfun_as7265x_init(app_i2c_instance); app_assert_status(status); - app_log("\nInit as7265x sensor successfully\r\n"); + app_printf("\nInit as7265x sensor successfully\r\n"); // Get sensor temperature. - app_log("\n-------------Sensor temperature-------------\r\n"); + app_printf("\n-------------Sensor temperature-------------\r\n"); status = sparkfun_as7265x_get_temperature(SPARKFUN_AS72651_NIR, &temperature); app_assert_status(status); - app_log("AS72651 Temperature = %d\r\n", temperature); + app_printf("AS72651 Temperature = %d\r\n", temperature); status = sparkfun_as7265x_get_temperature(SPARKFUN_AS72652_VISIBLE, &temperature); app_assert_status(status); - app_log("AS72652 Temperature = %d\r\n", temperature); + app_printf("AS72652 Temperature = %d\r\n", temperature); status = sparkfun_as7265x_get_temperature(SPARKFUN_AS72653_UV, &temperature); app_assert_status(status); - app_log("AS72653 Temperature = %d\r\n", temperature); + app_printf("AS72653 Temperature = %d\r\n", temperature); // Get hardware and firmware version. - app_log("\n---------Hardware and firmware version--------\r\n"); + app_printf("\n---------Hardware and firmware version--------\r\n"); status = sparkfun_as7265x_get_device_type(&hardware_version_data); app_assert_status(status); - app_log("AMS Device Type: 0x%x\r\n", hardware_version_data); + app_printf("AMS Device Type: 0x%x\r\n", hardware_version_data); status = sparkfun_as7265x_get_hardware_version(&hardware_version_data); app_assert_status(status); - app_log("AMS Hardware Version: 0x%x\r\n", hardware_version_data); + app_printf("AMS Hardware Version: 0x%x\r\n", hardware_version_data); status = sparkfun_as7265x_get_firmware_version(&firmware_version_data); app_assert_status(status); - app_log("Major Firmware Version: 0x%x\r\n", - firmware_version_data.major_firmware_version); - app_log("Patch Firmware Version: 0x%x\r\n", - firmware_version_data.patch_firmware_version); - app_log("Build Firmware Version: 0x%x\r\n", - firmware_version_data.build_firmware_version); + app_printf("Major Firmware Version: 0x%x\r\n", + firmware_version_data.major_firmware_version); + app_printf("Patch Firmware Version: 0x%x\r\n", + firmware_version_data.patch_firmware_version); + app_printf("Build Firmware Version: 0x%x\r\n", + firmware_version_data.build_firmware_version); #if defined(TEST_BASIC_READING_WITH_LED) \ || defined(TEST_READ_RAW_VALUE) \ @@ -126,8 +149,8 @@ void app_init(void) || defined(TEST_READ_RAW_VALUE) \ || defined(TEST_MAX_READ_RATE) - app_log("\n----Spectral data in counts/microwatt/cm2----\r\n"); - app_log( + app_printf("\n----Spectral data in counts/microwatt/cm2----\r\n"); + app_printf( "| A | B | C | D | E | F |\ G | H | R | I | S | J | T |\ U | V | W | K | L\r\n"); @@ -154,24 +177,25 @@ void app_process_action(void) status = sparkfun_as7265x_get_all_calibrated_value(&cal_value); app_assert_status(status); - app_log("|%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_A]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_B]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_C]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_D]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_E]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_F]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_G]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_H]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_R]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_I]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_S]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_J]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_T]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_U]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_V]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_W]); - app_log("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_K]); - app_log("%9.3f\r\n", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_L]); + app_printf("|%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_A]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_B]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_C]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_D]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_E]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_F]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_G]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_H]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_R]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_I]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_S]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_J]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_T]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_U]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_V]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_W]); + app_printf("%9.3f|", cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_K]); + app_printf("%9.3f\r\n", + cal_value.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_L]); } #endif @@ -189,31 +213,31 @@ void app_process_action(void) #ifdef TEST_MAX_READ_RATE end_time = sl_sleeptimer_tick_to_ms(sl_sleeptimer_get_tick_count()); - app_log("Data rate = %.2f\r\n", (float)1000 / (end_time - start_time)); + app_printf("Data rate = %.2f\r\n", (float)1000 / (end_time - start_time)); #endif if (status == SL_STATUS_OK) { status = sparkfun_as7265x_get_all_color_channel(&color_data); app_assert_status(status); - app_log("|%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_A]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_B]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_C]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_D]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_E]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_F]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_G]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_H]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_R]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_I]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_S]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_J]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_T]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_U]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_V]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_W]); - app_log("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_K]); - app_log("%9d\r\n", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_L]); + app_printf("|%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_A]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_B]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_C]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_D]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_E]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_F]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_G]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_H]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_R]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_I]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_S]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_J]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_T]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_U]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_V]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_W]); + app_printf("%9d|", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_K]); + app_printf("%9d\r\n", color_data.channel[SPARKFUN_AS7265x_COLOR_CHANNEL_L]); } #endif } diff --git a/app/example/sparkfun_spectroscopy_as7265x/brd2601b/sl_i2cspm_qwiic_config.h b/app/example/sparkfun_spectroscopy_as7265x/brd2601b/sl_i2cspm_qwiic_config.h deleted file mode 100644 index aea9b367..00000000 --- a/app/example/sparkfun_spectroscopy_as7265x/brd2601b/sl_i2cspm_qwiic_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_QWIIC_CONFIG_H diff --git a/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp b/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp index 58305090..62522fb6 100644 --- a/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp +++ b/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x.slcp @@ -28,6 +28,7 @@ include: component: - id: sl_system +- id: app_assert - id: device_init - id: sparkfun_spectroscopy_as7265x from: third_party_hw_drivers @@ -35,18 +36,9 @@ component: instance: [vcom] - id: i2cspm instance: [qwiic] -- id: sleeptimer - id: app_assert - id: app_log -config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: qwiic - path: brd2601b/sl_i2cspm_qwiic_config.h - condition: [brd2601b] - toolchain_settings: - option: gcc_linker_option value: "-u _printf_float" @@ -56,7 +48,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/basic_reading.png diff --git a/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x_si91x.slcp b/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x_si91x.slcp new file mode 100644 index 00000000..396c6dfa --- /dev/null +++ b/app/example/sparkfun_spectroscopy_as7265x/sparkfun_spectroscopy_as7265x_si91x.slcp @@ -0,0 +1,76 @@ +project_name: sparkfun_spectroscopy_as7265x_si91x +label: Third Party Hardware Drivers - AS7265X - Triad Spectroscopy Sensor (SparkFun) +package: platform +description: | + This example project shows an example for Triad Spectroscopy Sensor driver integration. +category: Example|Platform +quality: evaluation + +filter: +- name: Device Type + value: [SoC] +- name: MCU + value: [32-bit MCU] +- name: Project Difficulty + value: [Beginner] + +readme: +- path: ../../documentation/example/sparkfun_spectroscopy_as7265x/README.md + +source: +- path: app.c +- path: main.c + +include: +- path: '' + file_list: + - path: app.h + +component: +- id: sl_system +- id: app_assert +- id: syscalls + from: wiseconnect3_sdk +- id: si917_memory_default_config + from: wiseconnect3_sdk +- instance: [i2c2] + from: wiseconnect3_sdk + id: i2c_instance +- id: sparkfun_spectroscopy_as7265x + from: third_party_hw_drivers + +toolchain_settings: + - option: gcc_linker_option + value: "-u _printf_float" + +define: +- name: DEBUG_EFM + +sdk_extension: +- id: third_party_hw_drivers + version: 4.0.0 +- id: wiseconnect3_sdk + version: 3.3.4 + + +other_file: + - path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/basic_reading.png + directory: "image" + - path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/basic_reading_with_led.png + directory: "image" + - path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/connection.png + directory: "image" + - path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/create_example.png + directory: "image" + - path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/max_data_rate_reading.png + directory: "image" + - path: ../../documentation/example/sparkfun_spectroscopy_as7265x/image/raw_data_reading.png + directory: "image" + +ui_hints: + highlight: + - path: README.md + focus: true + +post_build: + path: ../../../utilities/postbuild_profile/wiseconnect_soc.slpb \ No newline at end of file diff --git a/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp b/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp index d4c45876..9d0d1974 100644 --- a/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp +++ b/app/example/sparkfun_weatherstation/sparkfun_weatherstation.slcp @@ -45,7 +45,7 @@ define: sdk_extension: - id: third_party_hw_drivers - version: 3.0.0 + version: 4.0.0 other_file: - path: ../../documentation/example/sparkfun_weatherstation/image/create_example.png diff --git a/driver/component/drivers/mikroe/accurrent.slcc b/driver/component/drivers/mikroe/accurrent.slcc new file mode 100644 index 00000000..b7aebb56 --- /dev/null +++ b/driver/component/drivers/mikroe/accurrent.slcc @@ -0,0 +1,39 @@ +id: accurrent +package: third_party_hw_drivers +label: AC Current Click (Mikroe) +description: > + Driver for the AC Current Click board. +category: Sensors +quality: evaluation +ui_hints: + visibility: basic +root_path: driver +requires: + - name: status + - name: mikroe_peripheral_driver_spi +config_file: + - path: public/mikroe/accurrent/config/brd2703a/mikroe_accurrent_config.h + file_id: driver_config_accurrent + condition: [brd2703a] + - path: public/mikroe/accurrent/config/brd4314a/mikroe_accurrent_config.h + file_id: driver_config_accurrent + condition: [brd4314a] + - path: public/mikroe/accurrent/config/brd4338a/mikroe_accurrent_config.h + file_id: driver_config_accurrent + condition: [brd4338a] + - path: public/mikroe/accurrent/config/other/mikroe_accurrent_config.h + file_id: driver_config_accurrent + unless: [brd4314a, brd2703a, brd4338a] +template_contribution: + - name: component_catalog + value: accurrent +include: + - path: thirdparty/mikrosdk_click_v2/clicks/accurrent/lib/include + file_list: + - path: accurrent.h + - path: public/mikroe/accurrent/inc + file_list: + - path: mikroe_accurrent.h +source: + - path: thirdparty/mikrosdk_click_v2/clicks/accurrent/lib/src/accurrent.c + - path: public/mikroe/accurrent/src/mikroe_accurrent.c diff --git a/driver/component/drivers/mikroe/barcode2_em3080w.slcc b/driver/component/drivers/mikroe/barcode2_em3080w.slcc index c1447102..0429bfb0 100644 --- a/driver/component/drivers/mikroe/barcode2_em3080w.slcc +++ b/driver/component/drivers/mikroe/barcode2_em3080w.slcc @@ -21,9 +21,12 @@ config_file: - path: public/mikroe/barcode2_em3080w/config/brd4314a/mikroe_em3080w_config.h file_id: driver_config_barcode2 condition: [brd4314a] + - path: public/mikroe/barcode2_em3080w/config/brd4338a/mikroe_em3080w_config.h + file_id: driver_config_barcode2 + condition: [brd4338a] - path: public/mikroe/barcode2_em3080w/config/other/mikroe_em3080w_config.h file_id: driver_config_barcode2 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: mikroe_barcode2 allow_multiple: false @@ -31,9 +34,6 @@ template_contribution: - name: component_catalog value: mikroe_barcode2 include: - - path: inc - file_list: - - path: third_party_hw_drivers_helpers.h - path: thirdparty/mikrosdk_click_v2/clicks/barcode2/lib/include file_list: - path: barcode2.h diff --git a/driver/component/drivers/mikroe/brushless16_lb11685av.slcc b/driver/component/drivers/mikroe/brushless16_lb11685av.slcc index 2919bd98..9cf53ac5 100644 --- a/driver/component/drivers/mikroe/brushless16_lb11685av.slcc +++ b/driver/component/drivers/mikroe/brushless16_lb11685av.slcc @@ -21,9 +21,12 @@ config_file: - path: public/mikroe/brushless16_lb11685av/config/brd4314a/mikroe_lb11685av_config.h file_id: driver_config_brushless16 condition: [brd4314a] + - path: public/mikroe/brushless16_lb11685av/config/brd4338a/mikroe_lb11685av_config.h + file_id: driver_config_brushless16 + condition: [brd4338a] - path: public/mikroe/brushless16_lb11685av/config/other/mikroe_lb11685av_config.h file_id: driver_config_brushless16 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: mikroe_brushless16 diff --git a/driver/component/drivers/mikroe/captouch2_cap1166.slcc b/driver/component/drivers/mikroe/captouch2_cap1166.slcc index 312815c5..dc94e5c7 100644 --- a/driver/component/drivers/mikroe/captouch2_cap1166.slcc +++ b/driver/component/drivers/mikroe/captouch2_cap1166.slcc @@ -21,9 +21,12 @@ config_file: - path: public/mikroe/captouch2_cap1166/config/brd4314a/mikroe_cap1166_config.h file_id: driver_config_captouch2 condition: [brd4314a] + - path: public/mikroe/captouch2_cap1166/config/brd4338a/mikroe_cap1166_config.h + file_id: driver_config_captouch2 + condition: [brd4338a] - path: public/mikroe/captouch2_cap1166/config/other/mikroe_cap1166_config.h file_id: driver_config_captouch2 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: mikroe_captouch2 diff --git a/driver/component/drivers/mikroe/co_mq7.slcc b/driver/component/drivers/mikroe/co_mq7.slcc index 977a8a9d..1c4c443a 100644 --- a/driver/component/drivers/mikroe/co_mq7.slcc +++ b/driver/component/drivers/mikroe/co_mq7.slcc @@ -22,9 +22,12 @@ config_file: - path: public/mikroe/co_mq7/config/brd4314a/mikroe_mq7_config.h file_id: driver_config_co condition: [brd4314a] + - path: public/mikroe/co_mq7/config/brd4338a/mikroe_mq7_config.h + file_id: driver_config_co + condition: [device_si91x] - path: public/mikroe/co_mq7/config/other/mikroe_mq7_config.h file_id: driver_config_co - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, device_si91x] template_contribution: - name: component_catalog value: mikroe_co diff --git a/driver/component/drivers/mikroe/dcmotor24_l9958.slcc b/driver/component/drivers/mikroe/dcmotor24_l9958.slcc index 5d0300a3..0d164b88 100644 --- a/driver/component/drivers/mikroe/dcmotor24_l9958.slcc +++ b/driver/component/drivers/mikroe/dcmotor24_l9958.slcc @@ -22,9 +22,12 @@ config_file: - path: public/mikroe/dcmotor24_l9958/config/brd4314a/mikroe_l9958_config.h file_id: driver_config_dcmotor24 condition: [brd4314a] + - path: public/mikroe/dcmotor24_l9958/config/brd4338a/mikroe_l9958_config.h + file_id: driver_config_dcmotor24 + condition: [brd4338a] - path: public/mikroe/dcmotor24_l9958/config/other/mikroe_l9958_config.h file_id: driver_config_dcmotor24 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: dcmotor24_l9958 diff --git a/driver/component/drivers/mikroe/dcmotor26_tb9053ftg.slcc b/driver/component/drivers/mikroe/dcmotor26_tb9053ftg.slcc index 04730413..083048cf 100644 --- a/driver/component/drivers/mikroe/dcmotor26_tb9053ftg.slcc +++ b/driver/component/drivers/mikroe/dcmotor26_tb9053ftg.slcc @@ -10,8 +10,16 @@ ui_hints: root_path: driver requires: - name: status + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: mikroe_peripheral_driver_i2c - name: mikroe_peripheral_driver_spi + condition: [device_series_1] + - name: mikroe_peripheral_driver_spi + condition: [device_series_2] + - name: mikroe_peripheral_driver_ssi + condition: [device_si91x] - name: mikroe_peripheral_driver_adc config_file: - path: public/mikroe/dcmotor26_tb9053ftg/config/brd2703a/mikroe_dcmotor26_config.h @@ -23,9 +31,12 @@ config_file: - path: public/mikroe/dcmotor26_tb9053ftg/config/brd4314a/mikroe_dcmotor26_config.h file_id: driver_config_dcmotor26 condition: [brd4314a] + - path: public/mikroe/dcmotor26_tb9053ftg/config/brd4338a/mikroe_dcmotor26_config.h + file_id: driver_config_dcmotor26 + condition: [brd4338a] - path: public/mikroe/dcmotor26_tb9053ftg/config/other/mikroe_dcmotor26_config.h file_id: driver_config_dcmotor26 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: dcmotor26_tb9053ftg diff --git a/driver/component/drivers/mikroe/dcmotor3_tb6549fg.slcc b/driver/component/drivers/mikroe/dcmotor3_tb6549fg.slcc index 9da34951..05a8ce40 100644 --- a/driver/component/drivers/mikroe/dcmotor3_tb6549fg.slcc +++ b/driver/component/drivers/mikroe/dcmotor3_tb6549fg.slcc @@ -22,9 +22,12 @@ config_file: - path: public/mikroe/dcmotor3_tb6549fg/config/brd4314a/mikroe_tb6549fg_config.h file_id: driver_config_dcmotor3 condition: [brd4314a] + - path: public/mikroe/dcmotor3_tb6549fg/config/brd4338a/mikroe_tb6549fg_config.h + file_id: driver_config_dcmotor3 + condition: [brd4338a] - path: public/mikroe/dcmotor3_tb6549fg/config/other/mikroe_tb6549fg_config.h file_id: driver_config_dcmotor3 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: mikroe_dcmotor3 diff --git a/driver/component/drivers/mikroe/e_paper_154_inch.slcc b/driver/component/drivers/mikroe/e_paper_154_inch.slcc deleted file mode 100644 index 9adfae6d..00000000 --- a/driver/component/drivers/mikroe/e_paper_154_inch.slcc +++ /dev/null @@ -1,50 +0,0 @@ -id: mikroe_epaper_display_154_inch -package: third_party_hw_drivers -label: E-Paper display 1.54" 200x200 dots (Mikroe) -description: > - Driver for the Mikroe eINK Click adaper board with the E-Paper display 1.54" 200x200 dots. -category: Display & LED -quality: evaluation -ui_hints: - visibility: basic -root_path: driver -requires: - - name: status - - name: mikroe_peripheral_driver_spi -provides: - - name: oled_display -config_file: - - path: public/mikroe/e_paper_154_inch/config/brd2703a/mikroe_e_paper_154_inch_config.h - file_id: mikroe_e_paper_154_inch_config - condition: [brd2703a] - - path: public/mikroe/e_paper_154_inch/config/brd4108a/mikroe_e_paper_154_inch_config.h - file_id: mikroe_e_paper_154_inch_config - condition: [brd4108a] - - path: public/mikroe/e_paper_154_inch/config/brd4182a/mikroe_e_paper_154_inch_config.h - file_id: mikroe_e_paper_154_inch_config - condition: [brd4182a] - - path: public/mikroe/e_paper_154_inch/config/brd4314a/mikroe_e_paper_154_inch_config.h - file_id: mikroe_e_paper_154_inch_config - condition: [brd4314a] - - path: public/mikroe/e_paper_154_inch/config/other/mikroe_e_paper_154_inch_config.h - file_id: mikroe_e_paper_154_inch_config - unless: [brd4314a, brd4108a, brd2703a, brd4182a] - -template_contribution: - - name: component_catalog - value: mikroe_epaper_display_154_inch -include: - - path: inc - file_list: - - path: third_party_hw_drivers_helpers.h - - path: thirdparty/mikrosdk_click_v2/clicks/eink154inch/lib/include - file_list: - - path: eink_154inch.h - - path: public/mikroe/e_paper_154_inch/inc - file_list: - - path: mikroe_e_paper_154_inch.h - - path: oled_display.h -source: - - path: thirdparty/mikrosdk_click_v2/clicks/eink154inch/lib/src/eink_154inch.c - - path: public/mikroe/e_paper_154_inch/src/mikroe_e_paper_154_inch.c - - path: public/mikroe/e_paper_154_inch/src/oled_display.c diff --git a/driver/component/drivers/mikroe/eink_display.slcc b/driver/component/drivers/mikroe/eink_display.slcc new file mode 100644 index 00000000..f6d08317 --- /dev/null +++ b/driver/component/drivers/mikroe/eink_display.slcc @@ -0,0 +1,66 @@ +id: mikroe_eink_display +package: third_party_hw_drivers +label: E-Paper Display - eINK Click (Mikroe) +description: > + Driver for the Mikroe eINK Click with the E-Paper display. +category: Display & LED +quality: evaluation +ui_hints: + visibility: basic +root_path: driver +requires: + - name: status + - name: udelay + condition: [device_series_1] + - name: udelay + condition: [device_series_2] + - name: mikroe_peripheral_driver_spi + - name: mikroe_peripheral_driver_digital_io +provides: + - name: oled_display +config_file: + - path: public/mikroe/eink_display/config/brd2703a/mikroe_eink_display_config.h + file_id: mikroe_eink_display_config + condition: [brd2703a] + - path: public/mikroe/eink_display/config/brd4108a/mikroe_eink_display_config.h + file_id: mikroe_eink_display_config + condition: [brd4108a] + - path: public/mikroe/eink_display/config/brd4182a/mikroe_eink_display_config.h + file_id: mikroe_eink_display_config + condition: [brd4182a] + - path: public/mikroe/eink_display/config/brd4314a/mikroe_eink_display_config.h + file_id: mikroe_eink_display_config + condition: [brd4314a] + - path: public/mikroe/eink_display/config/brd4338a/mikroe_eink_display_config.h + file_id: mikroe_eink_display_config + condition: [brd4338a] + - path: public/mikroe/eink_display/config/other/mikroe_eink_display_config.h + file_id: mikroe_eink_display_config + unless: [brd4314a, brd4108a, brd2703a, brd4182a, brd4338a] + +template_contribution: + - name: component_catalog + value: mikroe_epaper_display_154_inch +include: + - path: inc + file_list: + - path: third_party_hw_drivers_helpers.h + - path: thirdparty/mikrosdk_click_v2/clicks/eink154inch/lib_eink154inch/include + file_list: + - path: eink154inch.h + - path: thirdparty/mikrosdk_click_v2/clicks/eink213inch/lib_eink213inch/include + file_list: + - path: eink213inch.h + - path: thirdparty/mikrosdk_click_v2/clicks/eink290inch/lib_eink290inch/include + file_list: + - path: eink290inch.h + - path: public/mikroe/eink_display/inc + file_list: + - path: mikroe_eink_display.h + - path: oled_display.h +source: + - path: thirdparty/mikrosdk_click_v2/clicks/eink154inch/lib_eink154inch/src/eink154inch.c + - path: thirdparty/mikrosdk_click_v2/clicks/eink213inch/lib_eink213inch/src/eink213inch.c + - path: thirdparty/mikrosdk_click_v2/clicks/eink290inch/lib_eink290inch/src/eink290inch.c + - path: public/mikroe/eink_display/src/mikroe_eink_display.c + - path: public/mikroe/eink_display/src/oled_display.c diff --git a/driver/component/drivers/mikroe/emg.slcc b/driver/component/drivers/mikroe/emg.slcc index 6b5dcf1f..697b4cf2 100644 --- a/driver/component/drivers/mikroe/emg.slcc +++ b/driver/component/drivers/mikroe/emg.slcc @@ -25,17 +25,20 @@ config_file: - path: public/mikroe/emg/config/brd4314a/mikroe_emg_config.h file_id: driver_config_emg condition: [brd4314a] + - path: public/mikroe/emg/config/brd4338a/mikroe_emg_config.h + file_id: driver_config_alcohol + condition: [device_si91x] - path: public/mikroe/emg/config/other/mikroe_emg_config.h file_id: driver_config_emg - unless: [brd2703a, brd4108a, brd4314a] + unless: [brd2703a, brd4108a, brd4314a, device_si91x] provides: - name: emg - - allow_multiple: false + allow_multiple: false template_contribution: - name: component_catalog - - value: emg + value: emg include: - path: inc diff --git a/driver/component/drivers/mikroe/environment2_sht40_sgp40.slcc b/driver/component/drivers/mikroe/environment2_sht40_sgp40.slcc index 4e0436b9..d8db11b5 100644 --- a/driver/component/drivers/mikroe/environment2_sht40_sgp40.slcc +++ b/driver/component/drivers/mikroe/environment2_sht40_sgp40.slcc @@ -9,6 +9,9 @@ ui_hints: visibility: basic root_path: driver requires: + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_i2c provides: @@ -17,6 +20,9 @@ provides: template_contribution: - name: component_catalog value: environment2_sgp40_sht40 +config_file: + - path: public/mikroe/environment2_sht40_sgp40/config/mikroe_sht40_sgp40_config.h + file_id: driver_config_sht40_sgp40 include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/eth_wiz_w5500.slcc b/driver/component/drivers/mikroe/eth_wiz_w5500.slcc index 2d424bf2..77df187b 100644 --- a/driver/component/drivers/mikroe/eth_wiz_w5500.slcc +++ b/driver/component/drivers/mikroe/eth_wiz_w5500.slcc @@ -10,31 +10,11 @@ ui_hints: root_path: driver requires: - name: status - - name: udelay - name: sleeptimer - - name: spidrv -recommends: - - id: spidrv - instance: [w5500] + - name: mikroe_peripheral_driver_spi + - name: mikroe_peripheral_driver_digital_io + config_file: - - override: - component: spidrv - file_id: spidrv_config - instance: w5500 - path: public/mikroe/eth_wiz_w5500/config/brd2703a/sl_spidrv_w5500_config.h - condition: [brd2703a] - - override: - component: spidrv - file_id: spidrv_config - instance: w5500 - path: public/mikroe/eth_wiz_w5500/config/brd4108a/sl_spidrv_w5500_config.h - condition: [brd4108a] - - override: - component: spidrv - file_id: spidrv_config - instance: w5500 - path: public/mikroe/eth_wiz_w5500/config/brd4314a/sl_spidrv_w5500_config.h - condition: [brd4314a] - path: public/mikroe/eth_wiz_w5500/config/brd2703a/mikroe_w5500_config.h file_id: driver_config_eth_wiz condition: [brd2703a] @@ -44,12 +24,17 @@ config_file: - path: public/mikroe/eth_wiz_w5500/config/brd4314a/mikroe_w5500_config.h file_id: driver_config_eth_wiz condition: [brd4314a] + - path: public/mikroe/eth_wiz_w5500/config/brd4338a/mikroe_w5500_config.h + file_id: driver_config_eth_wiz + condition: [brd4338a] - path: public/mikroe/eth_wiz_w5500/config/other/mikroe_w5500_config.h file_id: driver_config_eth_wiz - unless: [brd2703a, brd4108a, brd4314a] + unless: [brd2703a, brd4108a, brd4314a, brd4338a] + template_contribution: - name: component_catalog value: mikroe_eth_wiz + include: - path: public/mikroe/eth_wiz_w5500/inc file_list: diff --git a/driver/component/drivers/mikroe/fingerprint2_a172mrq.slcc b/driver/component/drivers/mikroe/fingerprint2_a172mrq.slcc index 39e4d7e7..ed3e6940 100644 --- a/driver/component/drivers/mikroe/fingerprint2_a172mrq.slcc +++ b/driver/component/drivers/mikroe/fingerprint2_a172mrq.slcc @@ -9,6 +9,9 @@ ui_hints: visibility: basic root_path: driver requires: + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_uart config_file: @@ -21,9 +24,12 @@ config_file: - path: public/mikroe/fingerprint2_a172mrq/config/brd4314a/mikroe_a172mrq_config.h file_id: driver_config_fingerprint2 condition: [brd4314a] + - path: public/mikroe/fingerprint2_a172mrq/config/brd4338a/mikroe_a172mrq_config.h + file_id: driver_config_fingerprint2 + condition: [brd4338a] - path: public/mikroe/fingerprint2_a172mrq/config/other/mikroe_a172mrq_config.h file_id: driver_config_fingerprint2 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: mikroe_fingerprint2 allow_multiple: false diff --git a/driver/component/drivers/mikroe/force3_fsr400.slcc b/driver/component/drivers/mikroe/force3_fsr400.slcc index 6953b1a0..d1d4c891 100644 --- a/driver/component/drivers/mikroe/force3_fsr400.slcc +++ b/driver/component/drivers/mikroe/force3_fsr400.slcc @@ -12,13 +12,15 @@ requires: - name: status - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_i2c -config_file: provides: - name: mikroe_force3 allow_multiple: false template_contribution: - name: component_catalog value: mikroe_force3 +config_file: + - path: public/mikroe/force3_fsr400/config/mikroe_fsr400_config.h + file_id: driver_config_fsr400 include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/gps_lea6s.slcc b/driver/component/drivers/mikroe/gps_lea6s.slcc index 2f57f372..b3871db3 100644 --- a/driver/component/drivers/mikroe/gps_lea6s.slcc +++ b/driver/component/drivers/mikroe/gps_lea6s.slcc @@ -9,6 +9,9 @@ ui_hints: visibility: basic root_path: driver requires: + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_uart config_file: @@ -21,9 +24,12 @@ config_file: - path: public/mikroe/gps_lea6s/config/brd4314a/mikroe_gps_lea6s_config.h file_id: driver_config_gps_lea6s condition: [brd4314a] + - path: public/mikroe/gps_lea6s/config/brd4338a/mikroe_gps_lea6s_config.h + file_id: driver_config_gps_lea6s + condition: [brd4338a] - path: public/mikroe/gps_lea6s/config/other/mikroe_gps_lea6s_config.h file_id: driver_config_gps_lea6s - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: mikroe_gps allow_multiple: false diff --git a/driver/component/drivers/mikroe/heartrate2_maxm86161.slcc b/driver/component/drivers/mikroe/heartrate2_maxm86161.slcc index caaf9cf2..0db51741 100644 --- a/driver/component/drivers/mikroe/heartrate2_maxm86161.slcc +++ b/driver/component/drivers/mikroe/heartrate2_maxm86161.slcc @@ -9,9 +9,16 @@ ui_hints: visibility: basic root_path: driver requires: + - name: status + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_i2c config_file: + - path: public/mikroe/heartrate2_maxm86161/config/brd4338a/mikroe_maxm86161_config.h + file_id: driver_config_heartrate2 + condition: [device_si91x] - path: public/mikroe/heartrate2_maxm86161/config/brd2703a/mikroe_maxm86161_config.h file_id: driver_config_heartrate2 condition: [brd2703a] @@ -23,7 +30,7 @@ config_file: condition: [brd4314a] - path: public/mikroe/heartrate2_maxm86161/config/other/mikroe_maxm86161_config.h file_id: driver_config_heartrate2 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, device_si91x] provides: - name: mikroe_heartrate2 allow_multiple: false diff --git a/driver/component/drivers/mikroe/heartrate4_max30101.slcc b/driver/component/drivers/mikroe/heartrate4_max30101.slcc index 914c02d9..be92f283 100644 --- a/driver/component/drivers/mikroe/heartrate4_max30101.slcc +++ b/driver/component/drivers/mikroe/heartrate4_max30101.slcc @@ -22,9 +22,12 @@ config_file: - path: public/mikroe/heartrate4_max30101/config/brd4314a/mikroe_max30101_config.h file_id: driver_config_heartrate4 condition: [brd4314a] + - path: public/mikroe/heartrate4_max30101/config/brd4338a/mikroe_max30101_config.h + file_id: driver_config_heartrate4 + condition: [brd4338a] - path: public/mikroe/heartrate4_max30101/config/other/mikroe_max30101_config.h file_id: driver_config_heartrate4 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: mikroe_heartrate4 diff --git a/driver/component/drivers/mikroe/hvac_bundle_scd41_sps30.slcc b/driver/component/drivers/mikroe/hvac_bundle_scd41_sps30.slcc index 2e108a68..37688a85 100644 --- a/driver/component/drivers/mikroe/hvac_bundle_scd41_sps30.slcc +++ b/driver/component/drivers/mikroe/hvac_bundle_scd41_sps30.slcc @@ -12,7 +12,6 @@ requires: - name: status - name: hvac_scd41 - name: pm_sps30_i2c -config_file: provides: - name: hvac_bundle_scd41_sps30 allow_multiple: false diff --git a/driver/component/drivers/mikroe/hvac_scd41.slcc b/driver/component/drivers/mikroe/hvac_scd41.slcc index f4f74443..7c390dfa 100644 --- a/driver/component/drivers/mikroe/hvac_scd41.slcc +++ b/driver/component/drivers/mikroe/hvac_scd41.slcc @@ -12,8 +12,9 @@ requires: - name: status - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_i2c - - name: mikroe_peripheral_driver_uart config_file: + - path: public/mikroe/hvac_scd41/config/mikroe_scd41_config.h + file_id: mikroe_scd41_config_id provides: - name: hvac_scd41 allow_multiple: false diff --git a/driver/component/drivers/mikroe/lr9_ra_08.slcc b/driver/component/drivers/mikroe/lr9_ra_08.slcc new file mode 100644 index 00000000..2b140f88 --- /dev/null +++ b/driver/component/drivers/mikroe/lr9_ra_08.slcc @@ -0,0 +1,55 @@ +id: mikroe_lr9 +package: third_party_hw_drivers +label: RA-08 - LR 9 Click (Mikroe) +description: > + Driver for the Mikroe LR 9 Click board. + +category: Wireless Connectivity +quality: evaluation + +ui_hints: + visibility: basic +root_path: driver + +requires: + - name: status + - name: sleeptimer + - name: mikroe_peripheral_driver_uart + - name: mikroe_peripheral_driver_digital_io + +config_file: + - path: public/mikroe/lr9_ra_08/config/brd2703a/mikroe_ra_08_config.h + file_id: driver_config_ra_08 + condition: [brd2703a] + - path: public/mikroe/lr9_ra_08/config/brd4108a/mikroe_ra_08_config.h + file_id: driver_config_ra_08 + condition: [brd4108a] + - path: public/mikroe/lr9_ra_08/config/brd4314a/mikroe_ra_08_config.h + file_id: driver_config_ra_08 + condition: [brd4314a] + - path: public/mikroe/lr9_ra_08/config/other/mikroe_ra_08_config.h + file_id: driver_config_ra_08 + unless: [brd2703a, brd4108a, brd4314a] + +provides: + - name: mikroe_lr9 + allow_multiple: false + +template_contribution: + - name: component_catalog + value: mikroe_lr9 + +include: + - path: inc + file_list: + - path: third_party_hw_drivers_helpers.h + - path: thirdparty/mikrosdk_click_v2/clicks/lr9/lib_lr9/include + file_list: + - path: lr9.h + - path: public/mikroe/lr9_ra_08/inc + file_list: + - path: mikroe_ra_08.h + +source: + - path: thirdparty/mikrosdk_click_v2/clicks/lr9/lib_lr9/src/lr9.c + - path: public/mikroe/lr9_ra_08/src/mikroe_ra_08.c \ No newline at end of file diff --git a/driver/component/drivers/mikroe/lte_iot2_bg96.slcc b/driver/component/drivers/mikroe/lte_iot2_bg96.slcc index 6f1b3f25..0d873d0a 100644 --- a/driver/component/drivers/mikroe/lte_iot2_bg96.slcc +++ b/driver/component/drivers/mikroe/lte_iot2_bg96.slcc @@ -8,28 +8,37 @@ quality: evaluation ui_hints: visibility: basic root_path: driver + requires: - name: status - - name: emlib_gpio - - name: app_queue + - name: mikroe_peripheral_driver_digital_io + - name: silabs_core_circular_queue - name: sleeptimer - - name: iostream_usart + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_uart + - name: sl_string + recommends: - id: iostream_usart instance: [bg96] + config_file: - - path: public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_lte_iot2_bg96_config.h + - path: public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_bg96_config.h file_id: driver_config_lte_iot2 condition: [brd2703a] - - path: public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_lte_iot2_bg96_config.h + - path: public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_bg96_config.h file_id: driver_config_lte_iot2 condition: [brd4108a] - - path: public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_lte_iot2_bg96_config.h + - path: public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_bg96_config.h file_id: driver_config_lte_iot2 condition: [brd4314a] - - path: public/mikroe/lte_iot2_bg96/config/other/mikroe_lte_iot2_bg96_config.h + - path: public/mikroe/lte_iot2_bg96/config/brd4338a/mikroe_bg96_config.h file_id: driver_config_lte_iot2 - unless: [brd4314a, brd4108a, brd2703a] + condition: [brd4338a] + - path: public/mikroe/lte_iot2_bg96/config/other/mikroe_bg96_config.h + file_id: driver_config_lte_iot2 + unless: [brd4314a, brd4108a, brd2703a, brd4338a] - override: component: iostream_usart file_id: iostream_usart_config @@ -54,6 +63,7 @@ config_file: instance: bg96 path: public/mikroe/lte_iot2_bg96/config/other/sl_iostream_usart_bg96_config.h unless: [brd4314a, brd4108a, brd2703a] + provides: - name: mikroe_lte_iot2 allow_multiple: false diff --git a/driver/component/drivers/mikroe/mic2.slcc b/driver/component/drivers/mikroe/mic2.slcc index ceae365f..a11bcde9 100644 --- a/driver/component/drivers/mikroe/mic2.slcc +++ b/driver/component/drivers/mikroe/mic2.slcc @@ -26,17 +26,20 @@ config_file: - path: public/mikroe/mic2/config/brd4314a/mikroe_mic2_config.h file_id: driver_config_mic2 condition: [brd4314a] + - path: public/mikroe/mic2/config/brd4338a/mikroe_mic2_config.h + file_id: driver_config_mic2 + condition: [device_si91x] - path: public/mikroe/mic2/config/other/mikroe_mic2_config.h file_id: driver_config_mic2 - unless: [brd2703a, brd4108a, brd4314a] + unless: [brd2703a, brd4108a, brd4314a, device_si91x] provides: - name: mic2 - - allow_multiple: false + allow_multiple: false template_contribution: - name: component_catalog - - value: mic2 + value: mic2 include: - path: inc diff --git a/driver/component/drivers/mikroe/microsd.slcc b/driver/component/drivers/mikroe/microsd.slcc index 09085eca..c20e9512 100644 --- a/driver/component/drivers/mikroe/microsd.slcc +++ b/driver/component/drivers/mikroe/microsd.slcc @@ -13,8 +13,21 @@ provides: - name: fatfs_storage_device - name: fatfs_storage_device_sdcard config_file: - - path: public/mikroe/microsd/config/mikroe_microsd_config.h + - path: public/mikroe/microsd/config/brd2703a/mikroe_microsd_config.h file_id: driver_config_microsd + condition: [brd2703a] + - path: public/mikroe/microsd/config/brd4108a/mikroe_microsd_config.h + file_id: driver_config_microsd + condition: [brd4108a] + - path: public/mikroe/microsd/config/brd4314a/mikroe_microsd_config.h + file_id: driver_config_microsd + condition: [brd4314a] + - path: public/mikroe/microsd/config/brd4338a/mikroe_microsd_config.h + file_id: driver_config_microsd + condition: [brd4338a] + - path: public/mikroe/microsd/config/other/mikroe_microsd_config.h + file_id: driver_config_microsd + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: fatfs_storage_device_sdcard diff --git a/driver/component/drivers/mikroe/nfc2_pn7120.slcc b/driver/component/drivers/mikroe/nfc2_pn7120.slcc index e7a9bc4e..320ac1a0 100644 --- a/driver/component/drivers/mikroe/nfc2_pn7120.slcc +++ b/driver/component/drivers/mikroe/nfc2_pn7120.slcc @@ -9,6 +9,9 @@ root_path: driver requires: - name: status + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_i2c @@ -26,6 +29,12 @@ config_file: - path: public/mikroe/nfc2_pn7150/config/brd2703a/mikroe_pn7150_config.h file_id: driver_config_pn7150 condition: [brd2703a] + - path: public/mikroe/nfc2_pn7150/config/brd4338a/mikroe_pn7150_config.h + file_id: driver_config_pn7150 + condition: [brd4338a] + - path: public/mikroe/nfc2_pn7150/config/other/mikroe_pn7150_config.h + file_id: driver_config_pn7150 + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog diff --git a/driver/component/drivers/mikroe/obdii_stn1110.slcc b/driver/component/drivers/mikroe/obdii_stn1110.slcc index 4e56d8fa..387471c4 100644 --- a/driver/component/drivers/mikroe/obdii_stn1110.slcc +++ b/driver/component/drivers/mikroe/obdii_stn1110.slcc @@ -21,9 +21,12 @@ config_file: - path: public/mikroe/obdii_stn1110/config/brd4314a/mikroe_stn1110_config.h file_id: driver_config_obdii condition: [brd4314a] + - path: public/mikroe/obdii_stn1110/config/brd4338a/mikroe_stn1110_config.h + file_id: driver_config_obdii + condition: [brd4338a] - path: public/mikroe/obdii_stn1110/config/other/mikroe_stn1110_config.h file_id: driver_config_obdii - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: obdii_stn1110 allow_multiple: false diff --git a/driver/component/drivers/mikroe/oledc_ssd1351.slcc b/driver/component/drivers/mikroe/oledc_ssd1351.slcc index ecc4256f..33735ec2 100644 --- a/driver/component/drivers/mikroe/oledc_ssd1351.slcc +++ b/driver/component/drivers/mikroe/oledc_ssd1351.slcc @@ -21,12 +21,17 @@ config_file: - path: public/mikroe/oledc_ssd1351/config/brd4314a/mikroe_ssd1351_config.h file_id: driver_config_oledc condition: [brd4314a] + - path: public/mikroe/oledc_ssd1351/config/brd4338a/mikroe_ssd1351_config.h + file_id: driver_config_oledc + condition: [brd4338a] - path: public/mikroe/oledc_ssd1351/config/other/mikroe_ssd1351_config.h file_id: driver_config_oledc - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] + template_contribution: - name: component_catalog value: oledc_ssd1351 + include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/ozone2_mq131.slcc b/driver/component/drivers/mikroe/ozone2_mq131.slcc index 21228052..e6f3dabd 100644 --- a/driver/component/drivers/mikroe/ozone2_mq131.slcc +++ b/driver/component/drivers/mikroe/ozone2_mq131.slcc @@ -9,8 +9,10 @@ root_path: driver requires: - name: status - name: udelay + condition: [device_series_1] + - name: udelay + condition: [device_series_2] - name: mikroe_peripheral_driver_spi - - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_adc provides: - name: mikroe_ozone2 @@ -24,9 +26,12 @@ config_file: - path: public/mikroe/ozone2_mq131/config/brd4314a/mikroe_mq131_config.h file_id: driver_config_mq131 condition: [brd4314a] + - path: public/mikroe/ozone2_mq131/config/brd4338a/mikroe_mq131_config.h + file_id: driver_config_mq131 + condition: [brd4338a] - path: public/mikroe/ozone2_mq131/config/other/mikroe_mq131_config.h file_id: driver_config_mq131 - unless: [brd2703a, brd4108a, brd4314a] + unless: [brd2703a, brd4108a, brd4314a, brd4338a] template_contribution: - name: component_catalog value: mikroe_ozone2 diff --git a/driver/component/drivers/mikroe/pcr_xm125.slcc b/driver/component/drivers/mikroe/pcr_xm125.slcc new file mode 100644 index 00000000..b9a1fba0 --- /dev/null +++ b/driver/component/drivers/mikroe/pcr_xm125.slcc @@ -0,0 +1,54 @@ +id: mikroe_pcr_xm125 +package: third_party_hw_drivers +label: XM125 - PCR Click (Mikroe) - I2C +description: Driver for the Mikroe XM125 PCR Click using I2C interface. +category: Sensors +quality: evaluation +ui_hints: + visibility: basic +root_path: driver + +requires: + - name: status + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_digital_io + - name: mikroe_peripheral_driver_i2c + +provides: + - name: mikroe_pcr_xm125 + +template_contribution: + - name: component_catalog + value: mikroe_pcr_xm125 + +config_file: + - path: public/mikroe/pcr_xm125/config/brd2703a/mikroe_xm125_config.h + file_id: mikroe_xm125_config + condition: [brd2703a] + - path: public/mikroe/pcr_xm125/config/brd4108a/mikroe_xm125_config.h + file_id: mikroe_xm125_config + condition: [brd4108a] + - path: public/mikroe/pcr_xm125/config/brd4314a/mikroe_xm125_config.h + file_id: mikroe_xm125_config + condition: [brd4314a] + - path: public/mikroe/pcr_xm125/config/brd4338a/mikroe_xm125_config.h + file_id: mikroe_xm125_config + condition: [brd4338a] + - path: public/mikroe/pcr_xm125/config/other/mikroe_xm125_config.h + file_id: mikroe_xm125_config + unless: [brd4314a, brd4108a, brd2703a, brd4338a] +include: + - path: inc + file_list: + - path: third_party_hw_drivers_helpers.h + - path: thirdparty/mikrosdk_click_v2/clicks/pcr/lib_pcr/include + file_list: + - path: pcr.h + - path: public/mikroe/pcr_xm125/inc + file_list: + - path: mikroe_xm125.h +source: + - path: thirdparty/mikrosdk_click_v2/clicks/pcr/lib_pcr/src/pcr.c + - path: public/mikroe/pcr_xm125/src/mikroe_xm125.c diff --git a/driver/component/drivers/mikroe/ph2.slcc b/driver/component/drivers/mikroe/ph2.slcc new file mode 100644 index 00000000..ff25c6ee --- /dev/null +++ b/driver/component/drivers/mikroe/ph2.slcc @@ -0,0 +1,48 @@ +id: ph2 +package: third_party_hw_drivers +label: PH2 Click (Mikroe) +description: > + Driver for the PH2 Click board. +category: Sensors +quality: evaluation +ui_hints: + visibility: basic +root_path: driver +requires: + - name: status + - name: mikroe_peripheral_drivers_onewire + - name: mikroe_peripheral_driver_digital_io + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_adc +config_file: + - path: public/mikroe/ph2/config/brd2703a/mikroe_ph2_config.h + file_id: mikroe_ph2_config_id + condition: [brd2703a] + - path: public/mikroe/ph2/config/brd4108a/mikroe_ph2_config.h + file_id: mikroe_ph2_config_id + condition: [brd4108a] + - path: public/mikroe/ph2/config/brd4314a/mikroe_ph2_config.h + file_id: mikroe_ph2_config_id + condition: [brd4314a] + - path: public/mikroe/ph2/config/brd4338a/mikroe_ph2_config.h + file_id: mikroe_ph2_config_id + condition: [brd4338a] + - path: public/mikroe/ph2/config/other/mikroe_ph2_config.h + file_id: mikroe_ph2_config_id + unless: [brd2703a, brd4108a, brd4314a, brd4338a] +provides: + - name: ph2 + allow_multiple: false +template_contribution: + - name: component_catalog + value: ph2 +include: + - path: thirdparty/mikrosdk_click_v2/clicks/ph2/lib_ph2/include + file_list: + - path: ph2.h + - path: public/mikroe/ph2/inc + file_list: + - path: mikroe_ph2.h +source: + - path: thirdparty/mikrosdk_click_v2/clicks/ph2/lib_ph2/src/ph2.c + - path: public/mikroe/ph2/src/mikroe_ph2.c diff --git a/driver/component/drivers/mikroe/pir_pl_n823_01.slcc b/driver/component/drivers/mikroe/pir_pl_n823_01.slcc index 8d218764..bbadaace 100644 --- a/driver/component/drivers/mikroe/pir_pl_n823_01.slcc +++ b/driver/component/drivers/mikroe/pir_pl_n823_01.slcc @@ -13,6 +13,9 @@ requires: - name: mikroe_peripheral_driver_i2c - name: mikroe_peripheral_driver_digital_io config_file: + - path: public/mikroe/pir_pl_n823_01/config/brd4338a/mikroe_pir_pl_n823_01_config.h + file_id: driver_config_pir + condition: [device_si91x] - path: public/mikroe/pir_pl_n823_01/config/brd2703a/mikroe_pir_pl_n823_01_config.h file_id: driver_config_pir condition: [brd2703a] @@ -24,7 +27,7 @@ config_file: condition: [brd4314a] - path: public/mikroe/pir_pl_n823_01/config/other/mikroe_pir_pl_n823_01_config.h file_id: driver_config_pir - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, device_si91x] provides: - name: mikroe_pir_pl_n823_01 allow_multiple: false diff --git a/driver/component/drivers/mikroe/pressure_dps310_i2c.slcc b/driver/component/drivers/mikroe/pressure_dps310_i2c.slcc index 02612e6f..6a770e9a 100644 --- a/driver/component/drivers/mikroe/pressure_dps310_i2c.slcc +++ b/driver/component/drivers/mikroe/pressure_dps310_i2c.slcc @@ -11,6 +11,9 @@ root_path: driver requires: - name: mikroe_peripheral_driver_i2c - name: mikroe_peripheral_driver_spi + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] provides: - name: mikroe_pressure3_i2c @@ -18,6 +21,9 @@ provides: template_contribution: - name: component_catalog value: mikroe_pressure3_i2c +config_file: + - path: public/mikroe/pressure3_dps310/config/mikroe_dps310_i2c_config.h + file_id: mikroe_dps310_i2c_config include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/pressure_dps310_spi.slcc b/driver/component/drivers/mikroe/pressure_dps310_spi.slcc index 5e20bfd9..f14e7684 100644 --- a/driver/component/drivers/mikroe/pressure_dps310_spi.slcc +++ b/driver/component/drivers/mikroe/pressure_dps310_spi.slcc @@ -11,6 +11,9 @@ root_path: driver requires: - name: mikroe_peripheral_driver_i2c - name: mikroe_peripheral_driver_spi + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] provides: - name: mikroe_pressure3_spi @@ -18,6 +21,22 @@ provides: template_contribution: - name: component_catalog value: mikroe_pressure3_spi +config_file: + - path: public/mikroe/pressure3_dps310/config/brd2703a/mikroe_dps310_spi_config.h + file_id: mikroe_dps310_spi_config + condition: [brd2703a] + - path: public/mikroe/pressure3_dps310/config/brd4108a/mikroe_dps310_spi_config.h + file_id: mikroe_dps310_spi_config + condition: [brd4108a] + - path: public/mikroe/pressure3_dps310/config/brd4314a/mikroe_dps310_spi_config.h + file_id: mikroe_dps310_spi_config + condition: [brd4314a] + - path: public/mikroe/pressure3_dps310/config/brd4338a/mikroe_dps310_spi_config.h + file_id: mikroe_dps310_spi_config + condition: [brd4338a] + - path: public/mikroe/pressure3_dps310/config/other/mikroe_dps310_spi_config.h + file_id: mikroe_dps310_spi_config + unless: [brd4314a, brd4108a, brd2703a, brd4338a] include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/radar_mm5d91_00.slcc b/driver/component/drivers/mikroe/radar_mm5d91_00.slcc index 27006786..70474e6e 100644 --- a/driver/component/drivers/mikroe/radar_mm5d91_00.slcc +++ b/driver/component/drivers/mikroe/radar_mm5d91_00.slcc @@ -10,12 +10,11 @@ ui_hints: root_path: driver requires: - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_uart config_file: - - path: public/mikroe/radar_mm5d91_00/config/other/mikroe_mm5d91_00_config.h - file_id: driver_config_radar - unless: [brd2703a, brd4108a, brd4314a] - path: "public/mikroe/radar_mm5d91_00/config/brd4108a/mikroe_mm5d91_00_config.h" file_id: driver_config_radar condition: [brd4108a] @@ -25,6 +24,12 @@ config_file: - path: "public/mikroe/radar_mm5d91_00/config/brd2703a/mikroe_mm5d91_00_config.h" file_id: driver_config_radar condition: [brd2703a] + - path: public/mikroe/radar_mm5d91_00/config/brd4338a/mikroe_mm5d91_00_config.h + file_id: driver_config_radar + condition: [brd4338a] + - path: public/mikroe/radar_mm5d91_00/config/other/mikroe_mm5d91_00_config.h + file_id: driver_config_radar + unless: [brd2703a, brd4108a, brd4314a, brd4338a] provides: - name: mikroe_radar allow_multiple: false diff --git a/driver/component/drivers/mikroe/relay2_lca717.slcc b/driver/component/drivers/mikroe/relay2_lca717.slcc index 1a6d6c84..cdd6ca78 100644 --- a/driver/component/drivers/mikroe/relay2_lca717.slcc +++ b/driver/component/drivers/mikroe/relay2_lca717.slcc @@ -20,9 +20,12 @@ config_file: - path: public/mikroe/relay2_lca717/config/brd4314a/mikroe_relay2_config.h file_id: driver_config_relay2 condition: [brd4314a] + - path: public/mikroe/relay2_lca717/config/brd4338a/mikroe_relay2_config.h + file_id: driver_config_relay2 + condition: [brd4338a] - path: public/mikroe/relay2_lca717/config/other/mikroe_relay2_config.h file_id: driver_config_relay2 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: mikroe_relay2 allow_multiple: false diff --git a/driver/component/drivers/mikroe/rf_meter_ad8318.slcc b/driver/component/drivers/mikroe/rf_meter_ad8318.slcc index 9e8b60ef..a4cb8daf 100644 --- a/driver/component/drivers/mikroe/rf_meter_ad8318.slcc +++ b/driver/component/drivers/mikroe/rf_meter_ad8318.slcc @@ -16,16 +16,16 @@ requires: provides: - name: mirkoe_rf_meter - - allow_multiple: false + allow_multiple: false template_contribution: - name: component_catalog - - value: rf_meter_ad8318 + value: rf_meter_ad8318 +config_file: + - path: public/mikroe/rf_meter_ad8318/config/mikroe_ad8318_config.h + file_id: mikroe_ad8318_config_id include: - - path: inc - file_list: - - path: third_party_hw_drivers_helpers.h - path: thirdparty/mikrosdk_click_v2/clicks/rfmeter/lib_rfmeter/include file_list: - path: rfmeter.h diff --git a/driver/component/drivers/mikroe/rng.slcc b/driver/component/drivers/mikroe/rng.slcc index 272ade32..a6124738 100644 --- a/driver/component/drivers/mikroe/rng.slcc +++ b/driver/component/drivers/mikroe/rng.slcc @@ -12,6 +12,8 @@ requires: - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_i2c config_file: + - path: public/mikroe/rng/config/mikroe_rng_config.h + file_id: driver_config_rng provides: - name: rng allow_multiple: false diff --git a/driver/component/drivers/mikroe/rtc10_ds3231m.slcc b/driver/component/drivers/mikroe/rtc10_ds3231m.slcc index 9c176cb6..f3750b29 100644 --- a/driver/component/drivers/mikroe/rtc10_ds3231m.slcc +++ b/driver/component/drivers/mikroe/rtc10_ds3231m.slcc @@ -14,17 +14,20 @@ requires: - name: mikroe_peripheral_driver_digital_io config_file: - path: public/mikroe/rtc10_ds3231m/config/brd2703a/mikroe_ds3231m_config.h - file_id: mikroe_thunder_config + file_id: mikroe_rtc_config condition: [brd2703a] - path: public/mikroe/rtc10_ds3231m/config/brd4108a/mikroe_ds3231m_config.h - file_id: mikroe_thunder_config + file_id: mikroe_rtc_config condition: [brd4108a] - path: public/mikroe/rtc10_ds3231m/config/brd4314a/mikroe_ds3231m_config.h - file_id: mikroe_thunder_config + file_id: mikroe_rtc_config condition: [brd4314a] + - path: public/mikroe/rtc10_ds3231m/config/brd4338a/mikroe_ds3231m_config.h + file_id: mikroe_rtc_config + condition: [brd4338a] - path: public/mikroe/rtc10_ds3231m/config/other/mikroe_ds3231m_config.h - file_id: mikroe_thunder_config - unless: [brd4314a, brd4108a, brd2703a] + file_id: mikroe_rtc_config + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: rtc10_ds3231m allow_multiple: false diff --git a/driver/component/drivers/mikroe/servo_pca9685.slcc b/driver/component/drivers/mikroe/servo_pca9685.slcc index b74be7b8..89833ba9 100644 --- a/driver/component/drivers/mikroe/servo_pca9685.slcc +++ b/driver/component/drivers/mikroe/servo_pca9685.slcc @@ -14,6 +14,9 @@ requires: - name: mikroe_peripheral_driver_i2c - name: mikroe_peripheral_driver_digital_io - name: status + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] config_file: - path: public/mikroe/servo_pca9685/config/brd2703a/mikroe_servo_config.h @@ -25,17 +28,20 @@ config_file: - path: public/mikroe/servo_pca9685/config/brd4314a/mikroe_servo_config.h file_id: driver_config_servo condition: [brd4314a] + - path: public/mikroe/servo_pca9685/config/brd4338a/mikroe_servo_config.h + file_id: driver_config_servo + condition: [brd4338a] - path: public/mikroe/servo_pca9685/config/other/mikroe_servo_config.h file_id: driver_config_servo - unless: [brd2703a, brd4108a, brd4314a] + unless: [brd2703a, brd4108a, brd4314a, brd4338a] provides: - name: servo_pca9685 - - allow_multiple: false + allow_multiple: false template_contribution: - name: component_catalog - - value: servo_pca9685 + value: servo_pca9685 include: - path: inc diff --git a/driver/component/drivers/mikroe/smoke2_adpd188bi_i2c.slcc b/driver/component/drivers/mikroe/smoke2_adpd188bi_i2c.slcc index 13c700db..591db790 100644 --- a/driver/component/drivers/mikroe/smoke2_adpd188bi_i2c.slcc +++ b/driver/component/drivers/mikroe/smoke2_adpd188bi_i2c.slcc @@ -13,18 +13,21 @@ requires: - name: mikroe_peripheral_driver_i2c - name: mikroe_peripheral_driver_spi config_file: - - path: public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_config.h + - path: public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_i2c_config.h file_id: driver_config_mikroe_smoke2_adpd188bi condition: [brd2703a] - - path: public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_config.h + - path: public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_i2c_config.h file_id: driver_config_mikroe_smoke2_adpd188bi condition: [brd4314a] - - path: public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_config.h + - path: public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_i2c_config.h file_id: driver_config_mikroe_smoke2_adpd188bi condition: [brd4108a] - - path: public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_config.h + - path: public/mikroe/smoke2_adpd188bi/config/brd4338a/mikroe_smoke2_adpd188bi_i2c_config.h file_id: driver_config_mikroe_smoke2_adpd188bi - unless: [brd4314a, brd2703a, brd4108a] + condition: [brd4338a] + - path: public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_i2c_config.h + file_id: driver_config_mikroe_smoke2_adpd188bi + unless: [brd4314a, brd2703a, brd4108a, brd4338a] provides: - name: smoke2_adpd188bi_i2c allow_multiple: false diff --git a/driver/component/drivers/mikroe/smoke2_adpd188bi_spi.slcc b/driver/component/drivers/mikroe/smoke2_adpd188bi_spi.slcc deleted file mode 100644 index 0403bd5b..00000000 --- a/driver/component/drivers/mikroe/smoke2_adpd188bi_spi.slcc +++ /dev/null @@ -1,46 +0,0 @@ -id: smoke2_adpd188bi_spi -package: third_party_hw_drivers -label: ADPD188BI - Smoke 2 Click (Mikroe) - SPI -description: Driver for the Smoke 2 Click board using SPI Interface. -category: Sensors -quality: evaluation -ui_hints: - visibility: basic -root_path: driver -requires: - - name: status - - name: mikroe_peripheral_driver_digital_io - - name: mikroe_peripheral_driver_i2c - - name: mikroe_peripheral_driver_spi -config_file: - - path: public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_config.h - file_id: driver_config_mikroe_smoke2_adpd188bi - condition: [brd2703a] - - path: public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_config.h - file_id: driver_config_mikroe_smoke2_adpd188bi - condition: [brd4314a] - - path: public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_config.h - file_id: driver_config_mikroe_smoke2_adpd188bi - condition: [brd4108a] - - path: public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_config.h - file_id: driver_config_mikroe_smoke2_adpd188bi - unless: [brd4314a, brd2703a, brd4108a] -provides: - - name: smoke2_adpd188bi_spi - allow_multiple: false -template_contribution: - - name: component_catalog - value: smoke2_adpd188bi_spi -include: - - path: inc - file_list: - - path: third_party_hw_drivers_helpers.h - - path: thirdparty/mikrosdk_click_v2/clicks/smoke2/lib_smoke2/include - file_list: - - path: smoke2.h - - path: public/mikroe/smoke2_adpd188bi/inc - file_list: - - path: mikroe_adpd188bi_spi.h -source: - - path: thirdparty/mikrosdk_click_v2/clicks/smoke2/lib_smoke2/src/smoke2.c - - path: public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_spi.c diff --git a/driver/component/drivers/mikroe/stretch.slcc b/driver/component/drivers/mikroe/stretch.slcc index dc5be1e8..0254381d 100644 --- a/driver/component/drivers/mikroe/stretch.slcc +++ b/driver/component/drivers/mikroe/stretch.slcc @@ -22,9 +22,12 @@ config_file: - path: public/mikroe/stretch/config/brd4314a/mikroe_stretch_config.h file_id: driver_config_stretch condition: [brd4314a] + - path: public/mikroe/stretch/config/brd4338a/mikroe_stretch_config.h + file_id: driver_config_stretch + condition: [device_si91x] - path: public/mikroe/stretch/config/other/mikroe_stretch_config.h file_id: driver_config_stretch - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, device_si91x] provides: - name: mikroe_stretch allow_multiple: false diff --git a/driver/component/drivers/mikroe/temphum15_sht40.slcc b/driver/component/drivers/mikroe/temphum15_sht40.slcc index cfbb1186..fad53e16 100644 --- a/driver/component/drivers/mikroe/temphum15_sht40.slcc +++ b/driver/component/drivers/mikroe/temphum15_sht40.slcc @@ -12,13 +12,15 @@ requires: - name: status - name: mikroe_peripheral_driver_digital_io - name: mikroe_peripheral_driver_i2c -config_file: provides: - name: mikroe_temphum15 allow_multiple: false template_contribution: - name: component_catalog value: mikroe_temphum15 +config_file: + - path: public/mikroe/temphum15_sht40/config/mikroe_sht40_config.h + file_id: driver_config_temphum15_sht40 include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/thunder_as3935.slcc b/driver/component/drivers/mikroe/thunder_as3935.slcc index 0cd353d9..aba7487e 100644 --- a/driver/component/drivers/mikroe/thunder_as3935.slcc +++ b/driver/component/drivers/mikroe/thunder_as3935.slcc @@ -11,6 +11,11 @@ root_path: driver requires: - name: status - name: mikroe_peripheral_driver_spi + condition: [device_series_1] + - name: mikroe_peripheral_driver_spi + condition: [device_series_2] + - name: mikroe_peripheral_driver_ssi + condition: [device_si91x] config_file: - path: public/mikroe/thunder_as3935/config/brd2703a/mikroe_thunder_as3935_config.h file_id: mikroe_thunder_config @@ -21,9 +26,12 @@ config_file: - path: public/mikroe/thunder_as3935/config/brd4314a/mikroe_thunder_as3935_config.h file_id: mikroe_thunder_config condition: [brd4314a] + - path: public/mikroe/thunder_as3935/config/brd4338a/mikroe_thunder_as3935_config.h + file_id: mikroe_thunder_config + condition: [brd4338a] - path: public/mikroe/thunder_as3935/config/other/mikroe_thunder_as3935_config.h file_id: mikroe_thunder_config - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: mikroe_thunder allow_multiple: false diff --git a/driver/component/drivers/mikroe/turbidity_tsd10.slcc b/driver/component/drivers/mikroe/turbidity_tsd10.slcc index 83cfe45e..ace9702b 100644 --- a/driver/component/drivers/mikroe/turbidity_tsd10.slcc +++ b/driver/component/drivers/mikroe/turbidity_tsd10.slcc @@ -18,6 +18,9 @@ provides: template_contribution: - name: component_catalog value: turbidity_tsd10 +config_file: + - path: public/mikroe/turbidity_tsd10/config/mikroe_tsd10_config.h + file_id: driver_config_tsd10 include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/utm7segr_max6969.slcc b/driver/component/drivers/mikroe/utm7segr_max6969.slcc index 7d98eeaa..6475833c 100644 --- a/driver/component/drivers/mikroe/utm7segr_max6969.slcc +++ b/driver/component/drivers/mikroe/utm7segr_max6969.slcc @@ -15,6 +15,9 @@ requires: template_contribution: - name: component_catalog value: mikroe_utm7segr +config_file: + - path: public/mikroe/utm7segr_max6969/config/utm7segr_max6969_config.h + file_id: utm7segr_max6969_config_id include: - path: inc file_list: diff --git a/driver/component/drivers/mikroe/uv_ml8511a.slcc b/driver/component/drivers/mikroe/uv_ml8511a.slcc index c74a66dc..92a52ab3 100644 --- a/driver/component/drivers/mikroe/uv_ml8511a.slcc +++ b/driver/component/drivers/mikroe/uv_ml8511a.slcc @@ -22,7 +22,13 @@ config_file: - path: public/mikroe/uv_ml8511a/config/brd4314a/mikroe_ml8511a_config.h file_id: mikroe_ml8511a_config condition: [brd4314a] - + - path: public/mikroe/uv_ml8511a/config/brd4338a/mikroe_ml8511a_config.h + file_id: mikroe_ml8511a_config + condition: [brd4338a] + - path: public/mikroe/uv_ml8511a/config/other/mikroe_ml8511a_config.h + file_id: mikroe_ml8511a_config + unless: [brd4338a, brd4314a, brd4108a, brd2703a] + template_contribution: - name: component_catalog value: mikroe_uv diff --git a/driver/component/drivers/mikroe/uwb_dwm1000.slcc b/driver/component/drivers/mikroe/uwb_dwm1000.slcc index 156cc975..1c0b961e 100644 --- a/driver/component/drivers/mikroe/uwb_dwm1000.slcc +++ b/driver/component/drivers/mikroe/uwb_dwm1000.slcc @@ -12,6 +12,9 @@ root_path: driver requires: - name: status - name: udelay + condition: [device_series_1] + - name: udelay + condition: [device_series_2] - name: mikroe_peripheral_driver_spi provides: @@ -31,9 +34,12 @@ config_file: - path: public/mikroe/uwb_dwm1000/config/brd4314a/mikroe_uwb_dwm1000_config.h file_id: driver_config_dwm1000 condition: [brd4314a] + - path: public/mikroe/uwb_dwm1000/config/brd4338a/mikroe_uwb_dwm1000_config.h + file_id: driver_config_dwm1000 + condition: [brd4338a] - path: public/mikroe/uwb_dwm1000/config/other/mikroe_uwb_dwm1000_config.h file_id: driver_config_dwm1000 - unless: [brd2703a, brd4108a, brd4314a] + unless: [brd2703a, brd4108a, brd4314a, brd4338a] include: - path: inc diff --git a/driver/component/drivers/silabs/adafruit_neotrellis_keypad_atsamd09.slcc b/driver/component/drivers/silabs/adafruit_neotrellis_keypad_atsamd09.slcc index bfbefa59..3dbc1d08 100644 --- a/driver/component/drivers/silabs/adafruit_neotrellis_keypad_atsamd09.slcc +++ b/driver/component/drivers/silabs/adafruit_neotrellis_keypad_atsamd09.slcc @@ -8,11 +8,11 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm - name: sleeptimer -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + provides: - name: adafruit_neotrellis_keypad_atsamd09 allow_multiple: false diff --git a/driver/component/drivers/silabs/adafruit_rgb_led_is31fl3741.slcc b/driver/component/drivers/silabs/adafruit_rgb_led_is31fl3741.slcc index a10b51ae..6ce53a84 100644 --- a/driver/component/drivers/silabs/adafruit_rgb_led_is31fl3741.slcc +++ b/driver/component/drivers/silabs/adafruit_rgb_led_is31fl3741.slcc @@ -8,10 +8,7 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: mikroe_peripheral_driver_i2c provides: - name: oled_display config_file: @@ -22,8 +19,8 @@ template_contribution: include: - path: public/silabs/rgb_led_is31fl3741/inc file_list: - - path: adafruit_is31fl3741_i2c.h - - path: adafruit_is31fl3741_params.h + - path: adafruit_is31fl3741_i2c.h + - path: adafruit_is31fl3741_params.h - path: adafruit_is31fl3741.h - path: oled_display.h source: diff --git a/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d.slcc b/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d.slcc index 446f745b..1eb106f8 100644 --- a/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d.slcc +++ b/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d.slcc @@ -9,35 +9,44 @@ quality: evaluation root_path: driver requires: - name: status - - name: emlib_usart + - name: sleeptimer_si91x + condition: + - device_si91x - name: sleeptimer + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi provides: - name: oled_display - name: lvgl_display config_file: - - path: public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_usart_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd2601b] - - path: public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_usart_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd2703a] - - path: public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_usart_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd2704a] - - path: public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_usart_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd4314a] - - path: public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_usart_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd4108a] - - path: public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_usart_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd4338a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] + condition: [brd4338a] + + - path: public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_config.h + file_id: adafruit_hxd8357d_config + unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a, brd4338a] template_contribution: - name: component_catalog diff --git a/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d_dma.slcc b/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d_dma.slcc index 679e66e1..0200794c 100644 --- a/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d_dma.slcc +++ b/driver/component/drivers/silabs/adafruit_tft_lcd_hx8357d_dma.slcc @@ -9,73 +9,47 @@ quality: evaluation root_path: driver requires: - name: status - - name: spidrv -recommends: - - id: spidrv - instance: [hxd8357d] + - name: sleeptimer_si91x + condition: + - device_si91x + - name: sleeptimer + condition: + - device # Enable for gecko device + - name: spidrv_core + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi_dma provides: - name: oled_display - name: lvgl_display config_file: - - override: - component: spidrv - file_id: spidrv_config - instance: hxd8357d - path: public/silabs/tft_lcd_hxd8357d/config/brd2601b/sl_spidrv_hxd8357d_config.h - condition: [brd2601b] - - path: public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_dma_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd2601b] - - override: - component: spidrv - file_id: spidrv_config - instance: hxd8357d - path: public/silabs/tft_lcd_hxd8357d/config/brd2703a/sl_spidrv_hxd8357d_config.h - condition: [brd2703a] - - path: public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_dma_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd2703a] - - override: - component: spidrv - file_id: spidrv_config - instance: hxd8357d - path: public/silabs/tft_lcd_hxd8357d/config/brd2704a/sl_spidrv_hxd8357d_config.h - condition: [brd2704a] - - path: public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_dma_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd2704a] - - override: - component: spidrv - file_id: spidrv_config - instance: hxd8357d - path: public/silabs/tft_lcd_hxd8357d/config/brd4314a/sl_spidrv_hxd8357d_config.h - condition: [brd4314a] - - path: public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_dma_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd4314a] - - override: - component: spidrv - file_id: spidrv_config - instance: hxd8357d - path: public/silabs/tft_lcd_hxd8357d/config/brd4108a/sl_spidrv_hxd8357d_config.h - condition: [brd4108a] - - path: public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_dma_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config condition: [brd4108a] - - override: - component: spidrv - file_id: spidrv_config - instance: hxd8357d - path: public/silabs/tft_lcd_hxd8357d/config/other/sl_spidrv_hxd8357d_config.h - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] - - path: public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_dma_config.h + - path: public/silabs/tft_lcd_hxd8357d/config/brd4338a/adafruit_hxd8357d_spi_config.h + file_id: adafruit_hxd8357d_config + condition: [brd4338a] + + - path: public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_config.h file_id: adafruit_hxd8357d_config - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] + unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a, brd4338a] template_contribution: - name: component_catalog @@ -87,6 +61,6 @@ include: - path: oled_display.h - path: lvgl_display.h source: - - path: public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d_dma.c + - path: public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d.c - path: public/silabs/tft_lcd_hxd8357d/src/oled_display.c - path: public/silabs/tft_lcd_hxd8357d/src/lvgl_display.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341.slcc b/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341.slcc index 691e97dd..3fd6dda0 100644 --- a/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341.slcc +++ b/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341.slcc @@ -9,35 +9,44 @@ quality: evaluation root_path: driver requires: - name: status - - name: emlib_usart + - name: sleeptimer_si91x + condition: + - device_si91x - name: sleeptimer + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi provides: - name: oled_display - name: lvgl_display config_file: - - path: public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_usart_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd2601b] - - path: public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_usart_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd2703a] - - path: public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_usart_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd2704a] - - path: public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_usart_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd4314a] - - path: public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_usart_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd4108a] - - path: public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_usart_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd4338a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] + condition: [brd4338a] + + - path: public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_config.h + file_id: adafruit_ili9341_config + unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a, brd4338a] template_contribution: - name: component_catalog diff --git a/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341_dma.slcc b/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341_dma.slcc index 067e8123..2b0b37cf 100644 --- a/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341_dma.slcc +++ b/driver/component/drivers/silabs/adafruit_tft_lcd_ili9341_dma.slcc @@ -9,73 +9,44 @@ quality: evaluation root_path: driver requires: - name: status - - name: spidrv -recommends: - - id: spidrv - instance: [ili9341] + - name: sleeptimer_si91x + condition: + - device_si91x + - name: sleeptimer + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi_dma provides: - name: oled_display - name: lvgl_display config_file: - - override: - component: spidrv - file_id: spidrv_config - instance: ili9341 - path: public/silabs/tft_lcd_ili9341/config/brd2601b/sl_spidrv_ili9341_config.h - condition: [brd2601b] - - path: public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_dma_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd2601b] - - override: - component: spidrv - file_id: spidrv_config - instance: ili9341 - path: public/silabs/tft_lcd_ili9341/config/brd2703a/sl_spidrv_ili9341_config.h - condition: [brd2703a] - - path: public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_dma_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd2703a] - - override: - component: spidrv - file_id: spidrv_config - instance: ili9341 - path: public/silabs/tft_lcd_ili9341/config/brd2704a/sl_spidrv_ili9341_config.h - condition: [brd2704a] - - path: public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_dma_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd2704a] - - override: - component: spidrv - file_id: spidrv_config - instance: ili9341 - path: public/silabs/tft_lcd_ili9341/config/brd4314a/sl_spidrv_ili9341_config.h - condition: [brd4314a] - - path: public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_dma_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd4314a] - - override: - component: spidrv - file_id: spidrv_config - instance: ili9341 - path: public/silabs/tft_lcd_ili9341/config/brd4108a/sl_spidrv_ili9341_config.h - condition: [brd4108a] - - path: public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_dma_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config condition: [brd4108a] - - override: - component: spidrv - file_id: spidrv_config - instance: ili9341 - path: public/silabs/tft_lcd_ili9341/config/other/sl_spidrv_ili9341_config.h - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] - - path: public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_dma_config.h + - path: public/silabs/tft_lcd_ili9341/config/brd4338a/adafruit_ili9341_spi_config.h + file_id: adafruit_ili9341_config + condition: [brd4338a] + + - path: public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_config.h file_id: adafruit_ili9341_config - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] + unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a, brd4338a] template_contribution: - name: component_catalog @@ -87,6 +58,6 @@ include: - path: oled_display.h - path: lvgl_display.h source: - - path: public/silabs/tft_lcd_ili9341/src/adafruit_ili9341_dma.c + - path: public/silabs/tft_lcd_ili9341/src/adafruit_ili9341.c - path: public/silabs/tft_lcd_ili9341/src/oled_display.c - path: public/silabs/tft_lcd_ili9341/src/lvgl_display.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/adafruit_tft_lcd_st7789.slcc b/driver/component/drivers/silabs/adafruit_tft_lcd_st7789.slcc index cfebb4fe..ecadc321 100644 --- a/driver/component/drivers/silabs/adafruit_tft_lcd_st7789.slcc +++ b/driver/component/drivers/silabs/adafruit_tft_lcd_st7789.slcc @@ -8,35 +8,44 @@ quality: evaluation root_path: driver requires: - name: status - - name: emlib_usart + - name: sleeptimer_si91x + condition: + - device_si91x - name: sleeptimer + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi provides: - name: oled_display - name: lvgl_display config_file: - - path: public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_usart_config.h + - path: public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd2601b] - - path: public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_usart_config.h + - path: public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd2703a] - - path: public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_usart_config.h + - path: public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd2704a] - - path: public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_usart_config.h + - path: public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd4314a] - - path: public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_usart_config.h + - path: public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd4108a] - - path: public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_usart_config.h + - path: public/silabs/tft_lcd_st7789/config/brd4338a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] + condition: [brd4338a] + + - path: public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_config.h + file_id: adafruit_st7789_config + unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a, brd4338a] template_contribution: - name: component_catalog diff --git a/driver/component/drivers/silabs/adafruit_tft_lcd_st7789_dma.slcc b/driver/component/drivers/silabs/adafruit_tft_lcd_st7789_dma.slcc index 679c4aa9..7c56feff 100644 --- a/driver/component/drivers/silabs/adafruit_tft_lcd_st7789_dma.slcc +++ b/driver/component/drivers/silabs/adafruit_tft_lcd_st7789_dma.slcc @@ -8,73 +8,44 @@ quality: evaluation root_path: driver requires: - name: status - - name: spidrv -recommends: - - id: spidrv - instance: [st7789] + - name: sleeptimer_si91x + condition: + - device_si91x + - name: sleeptimer + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi_dma provides: - name: oled_display - name: lvgl_display config_file: - - override: - component: spidrv - file_id: spidrv_config - instance: st7789 - path: public/silabs/tft_lcd_st7789/config/brd2601b/sl_spidrv_st7789_config.h - condition: [brd2601b] - - path: public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_dma_config.h + - path: public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd2601b] - - override: - component: spidrv - file_id: spidrv_config - instance: st7789 - path: public/silabs/tft_lcd_st7789/config/brd2703a/sl_spidrv_st7789_config.h - condition: [brd2703a] - - path: public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_dma_config.h + - path: public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd2703a] - - override: - component: spidrv - file_id: spidrv_config - instance: st7789 - path: public/silabs/tft_lcd_st7789/config/brd2704a/sl_spidrv_st7789_config.h - condition: [brd2704a] - - path: public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_dma_config.h + - path: public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd2704a] - - override: - component: spidrv - file_id: spidrv_config - instance: st7789 - path: public/silabs/tft_lcd_st7789/config/brd4314a/sl_spidrv_st7789_config.h - condition: [brd4314a] - - path: public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_dma_config.h + - path: public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd4314a] - - override: - component: spidrv - file_id: spidrv_config - instance: st7789 - path: public/silabs/tft_lcd_st7789/config/brd4108a/sl_spidrv_st7789_config.h - condition: [brd4108a] - - path: public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_dma_config.h + - path: public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config condition: [brd4108a] - - override: - component: spidrv - file_id: spidrv_config - instance: st7789 - path: public/silabs/tft_lcd_st7789/config/other/sl_spidrv_st7789_config.h - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] - - path: public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_dma_config.h + - path: public/silabs/tft_lcd_st7789/config/brd4338a/adafruit_st7789_spi_config.h + file_id: adafruit_st7789_config + condition: [brd4338a] + + - path: public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_config.h file_id: adafruit_st7789_config - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] + unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a, brd4338a] template_contribution: - name: component_catalog @@ -85,7 +56,8 @@ include: - path: adafruit_st7789.h - path: oled_display.h - path: lvgl_display.h + source: - - path: public/silabs/tft_lcd_st7789/src/adafruit_st7789_dma.c + - path: public/silabs/tft_lcd_st7789/src/adafruit_st7789.c - path: public/silabs/tft_lcd_st7789/src/oled_display.c - path: public/silabs/tft_lcd_st7789/src/lvgl_display.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/adafruit_touchscreen_tsc2007.slcc b/driver/component/drivers/silabs/adafruit_touchscreen_tsc2007.slcc index f0f1085e..c6f03546 100644 --- a/driver/component/drivers/silabs/adafruit_touchscreen_tsc2007.slcc +++ b/driver/component/drivers/silabs/adafruit_touchscreen_tsc2007.slcc @@ -8,11 +8,7 @@ quality: evaluation root_path: driver requires: - name: status -- name: i2cspm -- name: gpiointerrupt -recommends: -- id: i2cspm - instance: [qwiic] +- name: mikroe_peripheral_driver_i2c config_file: - path: public/silabs/touchscreen_tsc2007/config/adafruit_tsc2007_config.h file_id: adafruit_tsc2007_config diff --git a/driver/component/drivers/silabs/environment3_bme688_i2c.slcc b/driver/component/drivers/silabs/environment3_bme688_i2c.slcc index 18cd69b2..d1f4b101 100644 --- a/driver/component/drivers/silabs/environment3_bme688_i2c.slcc +++ b/driver/component/drivers/silabs/environment3_bme688_i2c.slcc @@ -9,12 +9,11 @@ ui_hints: category: Sensors root_path: driver requires: - - name: i2cspm - - name: udelay -recommends: - - id: i2cspm - instance: [mikroe] - + - name: status + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c provides: - name: environment3_bme688_i2c allow_multiple: false @@ -23,6 +22,10 @@ template_contribution: - name: component_catalog value: environment3_bme688_i2c +config_file: + - path: public/silabs/environment3_bme688/config/mikroe_bme688_i2c_config.h + file_id: mikroe_bme688_i2c_config_id + include: - path: public/silabs/environment3_bme688/inc file_list: diff --git a/driver/component/drivers/silabs/environment3_bme688_spi.slcc b/driver/component/drivers/silabs/environment3_bme688_spi.slcc index 74c585e7..f2f2a239 100644 --- a/driver/component/drivers/silabs/environment3_bme688_spi.slcc +++ b/driver/component/drivers/silabs/environment3_bme688_spi.slcc @@ -10,12 +10,10 @@ category: Sensors root_path: driver requires: - - name: spidrv - - name: udelay -recommends: - - id: spidrv - instance: [mikroe] - + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_spi provides: - name: environment3_bme688_spi allow_multiple: false @@ -24,6 +22,10 @@ template_contribution: - name: component_catalog value: environment3_bme688_spi +config_file: + - path: public/silabs/environment3_bme688/config/mikroe_bme688_spi_config.h + file_id: mikroe_bme688_spi_config_id + include: - path: public/silabs/environment3_bme688/inc file_list: diff --git a/driver/component/drivers/silabs/epaper_ext3_1.slcc b/driver/component/drivers/silabs/epaper_ext3_1.slcc new file mode 100644 index 00000000..24b5937a --- /dev/null +++ b/driver/component/drivers/silabs/epaper_ext3_1.slcc @@ -0,0 +1,63 @@ +id: epaper_ext3_1 +package: third_party_hw_drivers +label: E-Paper EXT3-1 (Pervasive Displays) +description: > + Driver for the 5.81 inch Monochrome EPD Panel with EPD Extension Kit Gen 3 (EXT3-1) +category: Display & LED +quality: evaluation +ui_hints: + visibility: basic +root_path: driver +requires: + - name: spidrv_core + condition: + - device # Enable for gecko device + - name: udelay + condition: + - device # Enable for gecko device + - name: sl_gspi + from: wiseconnect3_sdk + condition: + - device_si91x + - name: sl_gpio + condition: + - device_si91x + - name: sl_clock_manager + condition: + - device_si91x + - name: sleeptimer +provides: + - name: oled_display +config_file: + - path: public/silabs/epaper_ext3_1/config/brd2703a/epaper_display_config.h + file_id: epaper_display_config + condition: [brd2703a] + - path: public/silabs/epaper_ext3_1/config/brd4314a/epaper_display_config.h + file_id: epaper_display_config + condition: [brd4314a] + - path: public/silabs/epaper_ext3_1/config/brd4314a/epaper_display_config.h + file_id: epaper_display_config + condition: [brd4314a] + - path: public/silabs/epaper_ext3_1/config/brd4338a/epaper_display_config.h + file_id: epaper_display_config + condition: [brd4338a] + - path: public/silabs/epaper_ext3_1/config/other/epaper_display_config.h + file_id: epaper_display_config + unless: [brd4314a, brd2703a, brd4338a] +template_contribution: + - name: component_catalog + value: epaper_ext3_1 +include: + - path: public/silabs/epaper_ext3_1/inc + file_list: + - path: epaper_display.h + - path: oled_display.h +source: + - path: public/silabs/epaper_ext3_1/src/epaper_display_gecko.c + condition: + - device # Enable for gecko device + - path: public/silabs/epaper_ext3_1/src/epaper_display_si91x.c + condition: + - device_si91x + - path: public/silabs/epaper_ext3_1/src/epaper_display.c + - path: public/silabs/epaper_ext3_1/src/oled_display.c diff --git a/driver/component/drivers/silabs/fatfs_sdc_spi_platform.slcc b/driver/component/drivers/silabs/fatfs_sdc_spi_platform.slcc index 05cae643..9026aac8 100644 --- a/driver/component/drivers/silabs/fatfs_sdc_spi_platform.slcc +++ b/driver/component/drivers/silabs/fatfs_sdc_spi_platform.slcc @@ -3,7 +3,7 @@ package: third_party_hw_drivers label: Storage Device Controls Platform - SPI description: > Storage device controls platform interfaces for SPI interfaced FatFS storage devices. -category: Services/FatFS - Generic FAT Filesystem +category: Services|FatFS - Generic FAT Filesystem quality: evaluation ui_hints: visibility: never @@ -19,6 +19,6 @@ template_contribution: include: - path: public/silabs/fatfs_sdc_spi_platform/inc file_list: - - path: sl_sdc_platform_spi.h + - path: sl_sdc_platform_spi.h source: - path: public/silabs/fatfs_sdc_spi_platform/src/sl_sdc_platform_spi.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/maxim_fuel_gauge_max17048.slcc b/driver/component/drivers/silabs/maxim_fuel_gauge_max17048.slcc index d853a31a..dc03a8ac 100644 --- a/driver/component/drivers/silabs/maxim_fuel_gauge_max17048.slcc +++ b/driver/component/drivers/silabs/maxim_fuel_gauge_max17048.slcc @@ -6,36 +6,76 @@ description: > category: Power Management quality: evaluation root_path: driver + requires: - name: status - name: sleeptimer - - name: i2cspm - name: tempdrv + condition: [device_series_1] + - name: tempdrv + condition: [device_series_2] + - name: sl_bjt_temperature_sensor + condition: [device_si91x] + - name: gpiointerrupt + condition: [device_series_1] - name: gpiointerrupt + condition: [device_series_2] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: sl_power_manager + condition: [device_si91x] + - name: power_manager + condition: [device_series_1] + - name: power_manager + condition: [device_series_2] + - name: power_manager_no_deepsleep + condition: [device_series_1] + - name: power_manager_no_deepsleep + condition: [device_series_2] + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_digital_io + recommends: - id: i2cspm instance: [fuel_gauge] + config_file: - path: public/silabs/fuel_gauge_max17048/config/brd4181b/maxim_max17048_config.h file_id: maxim_max17048_config condition: [brd4181b] + - path: public/silabs/fuel_gauge_max17048/config/brd4180a/maxim_max17048_config.h + file_id: maxim_max17048_config + condition: [brd4180a] + - path: public/silabs/fuel_gauge_max17048/config/brd4338a/maxim_max17048_config.h + file_id: maxim_max17048_config + condition: [brd4338a] - path: public/silabs/fuel_gauge_max17048/config/other/maxim_max17048_config.h file_id: maxim_max17048_config - unless: [brd4181b] + unless: [brd4181b, brd4180a, brd4338a] + - override: + component: i2cspm + file_id: i2cspm_config + instance: fuel_gauge + path: public/silabs/fuel_gauge_max17048/config/brd4180a/sl_i2cspm_fuel_gauge_config.h + condition: [brd4180a] - override: component: i2cspm file_id: i2cspm_config instance: fuel_gauge path: public/silabs/fuel_gauge_max17048/config/brd4181b/sl_i2cspm_fuel_gauge_config.h condition: [brd4181b] + provides: - name: maxim_fuel_gauge_max17048 + template_contribution: - name: component_catalog value: maxim_fuel_gauge_max17048 + include: - path: public/silabs/fuel_gauge_max17048/inc file_list: - - path: maxim_fuel_gauge_max17048.h + - path: maxim_fuel_gauge_max17048.h + source: - path: public/silabs/fuel_gauge_max17048/src/maxim_fuel_gauge_max17048.c diff --git a/driver/component/drivers/silabs/mikroe_accel5_bma400_i2c.slcc b/driver/component/drivers/silabs/mikroe_accel5_bma400_i2c.slcc index 2eb945cb..269e4a40 100644 --- a/driver/component/drivers/silabs/mikroe_accel5_bma400_i2c.slcc +++ b/driver/component/drivers/silabs/mikroe_accel5_bma400_i2c.slcc @@ -10,11 +10,11 @@ ui_hints: root_path: driver requires: - - name: i2cspm - - name: udelay -recommends: - - id: i2cspm - instance: [mikroe] + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_digital_io provides: - name: mikroe_accel5_bma400_i2c @@ -34,9 +34,12 @@ config_file: - path: public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_i2c_config.h file_id: driver_config_bma400_i2c condition: [brd4314a] + - path: public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_i2c_config.h + file_id: driver_config_bma400_i2c + condition: [brd4338a] - path: public/silabs/accel5_bma400/config/other/mikroe_bma400_i2c_config.h file_id: driver_config_bma400_i2c - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] include: - path: public/silabs/accel5_bma400/inc diff --git a/driver/component/drivers/silabs/mikroe_accel5_bma400_spi.slcc b/driver/component/drivers/silabs/mikroe_accel5_bma400_spi.slcc index 8c87af69..930c2f7b 100644 --- a/driver/component/drivers/silabs/mikroe_accel5_bma400_spi.slcc +++ b/driver/component/drivers/silabs/mikroe_accel5_bma400_spi.slcc @@ -10,12 +10,12 @@ ui_hints: root_path: driver requires: - - name: spidrv - - name: udelay -recommends: - - id: spidrv - instance: [mikroe] - + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_spi + - name: mikroe_peripheral_driver_digital_io + provides: - name: mikroe_accel5_bma400_spi allow_multiple: false @@ -34,9 +34,12 @@ config_file: - path: public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_spi_config.h file_id: driver_config_bma400_spi condition: [brd4314a] + - path: public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_spi_config.h + file_id: driver_config_bma400_spi + condition: [brd4338a] - path: public/silabs/accel5_bma400/config/other/mikroe_bma400_spi_config.h file_id: driver_config_bma400_spi - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] include: - path: public/silabs/accel5_bma400/inc diff --git a/driver/component/drivers/silabs/mikroe_nfctag2_nt3h2111.slcc b/driver/component/drivers/silabs/mikroe_nfctag2_nt3h2111.slcc index 85971fa0..f88107ef 100644 --- a/driver/component/drivers/silabs/mikroe_nfctag2_nt3h2111.slcc +++ b/driver/component/drivers/silabs/mikroe_nfctag2_nt3h2111.slcc @@ -11,8 +11,11 @@ root_path: driver requires: - name: status - - name: i2cspm - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_digital_io recommends: - id: i2cspm instance: [mikroe] @@ -27,9 +30,12 @@ config_file: - path: public/silabs/nfctag2_nt3h2111/config/brd2703a/mikroe_nt3h2111_config.h file_id: driver_config_nt3h2111 condition: [brd2703a] + - path: public/silabs/nfctag2_nt3h2111/config/brd4338a/mikroe_nt3h2111_config.h + file_id: driver_config_nt3h2111 + condition: [brd4338a] - path: public/silabs/nfctag2_nt3h2111/config/other/mikroe_nt3h2111_config.h file_id: driver_config_bma400_i2c - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] provides: - name: mikroe_nfctag2 @@ -41,9 +47,7 @@ template_contribution: include: - path: public/silabs/nfctag2_nt3h2111/inc file_list: - - path: mikroe_nt3h2111_i2c.h - path: mikroe_nt3h2111.h source: - - path: public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111_i2c.c - path: public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/mikroe_stepper_a3967.slcc b/driver/component/drivers/silabs/mikroe_stepper_a3967.slcc index 96ec3da1..b5442c19 100644 --- a/driver/component/drivers/silabs/mikroe_stepper_a3967.slcc +++ b/driver/component/drivers/silabs/mikroe_stepper_a3967.slcc @@ -11,6 +11,9 @@ root_path: driver requires: - name: status - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_digital_io provides: - name: mikroe_stepper_a3967 allow_multiple: false @@ -24,9 +27,12 @@ config_file: - path: public/silabs/stepper_a3967/config/brd4108a/mikroe_a3967_config.h file_id: mikroe_a3967_config condition: [brd4108a] + - path: public/silabs/stepper_a3967/config/brd4338a/mikroe_a3967_config.h + file_id: mikroe_a3967_config + condition: [brd4338a] - path: public/silabs/stepper_a3967/config/other/mikroe_a3967_config.h file_id: mikroe_a3967_config - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] template_contribution: - name: component_catalog value: mikroe_stepper_a3967 diff --git a/driver/component/drivers/silabs/pir_ira_s210st01.slcc b/driver/component/drivers/silabs/pir_ira_s210st01.slcc deleted file mode 100644 index 71524420..00000000 --- a/driver/component/drivers/silabs/pir_ira_s210st01.slcc +++ /dev/null @@ -1,41 +0,0 @@ -id: silabs_pir_ira_s210st01 -package: third_party_hw_drivers -label: IRA-S210ST01 - PIR Sensor (Silabs) -description: > - Driver for the PIR sensor driver using the PIR sensor on the occupancy sensor EXP board. -category: Sensors -quality: evaluation -ui_hints: - visibility: basic -root_path: driver -requires: - - name: emlib_cryotimer - condition: [device_series_1] - - name: emlib_opamp - condition: [device_series_1] - - name: emlib_vdac - condition: [device_series_1] - - name: emlib_letimer - - name: emlib_prs - - name: emlib_adc - condition: [device_series_1] - - name: emlib_iadc - condition: [device_series_2] -config_file: - - path: public/silabs/pir_ira_s210st01/config/pir_ira_s210st01_config.h - file_id: driver_config_pir_ira_s210st01 -template_contribution: - - name: component_catalog - value: silabs_pir_ira_s210st01 -include: - - path: inc - file_list: - - path: third_party_hw_drivers_helpers.h - - path: public/silabs/pir_ira_s210st01/inc - file_list: - - path: pir_ira_s210st01.h -source: - - path: public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s1.c - condition: [device_series_1] - - path: public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s2.c - condition: [device_series_2] diff --git a/driver/component/drivers/silabs/silabs_triac.slcc b/driver/component/drivers/silabs/silabs_triac.slcc deleted file mode 100644 index 301d2889..00000000 --- a/driver/component/drivers/silabs/silabs_triac.slcc +++ /dev/null @@ -1,27 +0,0 @@ -id: silabs_triac -package: third_party_hw_drivers -label: Triac Driver (Silabs) -description: > - Driver for for Series 1 EFM32 and EFR32 devices that uses an appropriate voltage level representation of the AC line voltage in order to fire a timed pulse to drive the gate on a triac. -category: Miscellaneous -quality: evaluation -root_path: driver -requires: - - name: status - - name: emlib_acmp - - name: emlib_timer - - name: emlib_prs -config_file: - - path: public/silabs/triac/config/triacdrv_config.h - file_id: triacdrv_config -provides: - - name: silabs_triac -template_contribution: - - name: component_catalog - value: silabs_triac -include: - - path: public/silabs/triac/inc - file_list: - - path: triacdrv.h -source: - - path: public/silabs/triac/src/triacdrv.c diff --git a/driver/component/drivers/silabs/silabs_uwb2_dwm3000.slcc b/driver/component/drivers/silabs/silabs_uwb2_dwm3000.slcc index d797c410..ec820330 100644 --- a/driver/component/drivers/silabs/silabs_uwb2_dwm3000.slcc +++ b/driver/component/drivers/silabs/silabs_uwb2_dwm3000.slcc @@ -9,11 +9,19 @@ ui_hints: root_path: driver requires: - - name: status - - name: udelay - - name: spidrv_core - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: udelay + condition: [device_series_1] + - name: udelay + condition: [device_series_2] + - name: gpiointerrupt + condition: [device_series_1] - name: gpiointerrupt + condition: [device_series_2] + - name: mikroe_peripheral_driver_spi + - name: mikroe_peripheral_driver_digital_io provides: - name: mikroe_uwb2_dwm3000 @@ -32,9 +40,12 @@ config_file: - path: public/silabs/uwb2_dwm3000/config/brd4314a/uwb2_dwm3000_config.h file_id: driver_config_dwm3000 condition: [brd4314a] + - path: public/silabs/uwb2_dwm3000/config/brd4338a/uwb2_dwm3000_config.h + file_id: driver_config_dwm3000 + condition: [brd4338a] - path: public/silabs/uwb2_dwm3000/config/other/uwb2_dwm3000_config.h file_id: driver_config_dwm3000 - unless: [brd4314a, brd4108a, brd2703a] + unless: [brd4314a, brd4108a, brd2703a, brd4338a] include: - path: inc @@ -55,17 +66,11 @@ include: - path: public/silabs/uwb2_dwm3000/platform/deca_probe file_list: - path: deca_probe_interface.h - - path: public/silabs/uwb2_dwm3000/platform/deca_spi - file_list: - - path: deca_spi.h - path: public/silabs/uwb2_dwm3000/platform/port file_list: - - path: port_hal.h - - path: port.h + - path: port_dw3000.h source: - path: public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.c - - path: public/silabs/uwb2_dwm3000/platform/deca_sleep/deca_sleep.c - - path: public/silabs/uwb2_dwm3000/platform/deca_spi/deca_spi.c - path: public/silabs/uwb2_dwm3000/platform/port/port_dw3000.c toolchain_settings: @@ -79,6 +84,21 @@ toolchain_settings: condition: - "toolchain_gcc" - "cortexm4" + - option: fpu + value: "fpv5-sp" + condition: + - "toolchain_gcc" + - "cortexm4" + - option: float_abi + value: "hard" + condition: + - "toolchain_gcc" + - "cortexm4" + - option: optimize + value: "speed" + condition: + - "toolchain_gcc" + - "cortexm4" other_file: - path: "thirdparty/decawave/uwb2_dwm3000/lib/libdwt_uwb_driver-m33-hfp-6.0.7.a" condition: diff --git a/driver/component/drivers/silabs/sparkfun_accelerometer_mma8452q.slcc b/driver/component/drivers/silabs/sparkfun_accelerometer_mma8452q.slcc index 3752f97a..ffbbb00d 100644 --- a/driver/component/drivers/silabs/sparkfun_accelerometer_mma8452q.slcc +++ b/driver/component/drivers/silabs/sparkfun_accelerometer_mma8452q.slcc @@ -8,15 +8,19 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c provides: - name: sparkfun_accelerometer_mma8452q template_contribution: - name: component_catalog value: sparkfun_accelerometer_mma8452q + +config_file: + - path: public/silabs/accelerometer_mma8452q/config/mma8452q_config.h + file_id: mma8452q_config_id include: - path: public/silabs/accelerometer_mma8452q/inc file_list: diff --git a/driver/component/drivers/silabs/sparkfun_air_quality_sgp40.slcc b/driver/component/drivers/silabs/sparkfun_air_quality_sgp40.slcc index 16d373a1..b38d9dfd 100644 --- a/driver/component/drivers/silabs/sparkfun_air_quality_sgp40.slcc +++ b/driver/component/drivers/silabs/sparkfun_air_quality_sgp40.slcc @@ -8,22 +8,22 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm - name: sleeptimer -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c provides: - name: sparkfun_air_quality_sgp40_qwiic allow_multiple: false template_contribution: - name: component_catalog value: sparkfun_air_quality_sgp40_qwiic +config_file: + - path: public/silabs/air_quality_sgp40/config/sparkfun_sgp40_config.h + file_id: sparkfun_sgp40_config include: - path: public/silabs/air_quality_sgp40/inc file_list: - path: sparkfun_sgp40.h - - path: sparkfun_sgp40_i2c.h source: - path: public/silabs/air_quality_sgp40/src/sparkfun_sgp40.c - - path: public/silabs/air_quality_sgp40/src/sparkfun_sgp40_i2c.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/sparkfun_distance_vl53l1x.slcc b/driver/component/drivers/silabs/sparkfun_distance_vl53l1x.slcc index e9c65cd5..353de698 100644 --- a/driver/component/drivers/silabs/sparkfun_distance_vl53l1x.slcc +++ b/driver/component/drivers/silabs/sparkfun_distance_vl53l1x.slcc @@ -10,10 +10,8 @@ ui_hints: root_path: driver requires: - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: status + - name: mikroe_peripheral_driver_i2c config_file: - path: public/silabs/distance_vl53l1x/config/sparkfun_vl53l1x_config.h diff --git a/driver/component/drivers/silabs/sparkfun_dosimeter_type5.slcc b/driver/component/drivers/silabs/sparkfun_dosimeter_type5.slcc index 895a50ec..7c51b99d 100644 --- a/driver/component/drivers/silabs/sparkfun_dosimeter_type5.slcc +++ b/driver/component/drivers/silabs/sparkfun_dosimeter_type5.slcc @@ -10,7 +10,13 @@ ui_hints: root_path: driver requires: - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] - name: gpiointerrupt + condition: [device_series_1] + - name: gpiointerrupt + condition: [device_series_2] + - name: mikroe_peripheral_driver_digital_io config_file: - path: public/silabs/dosimeter_type5/config/brd2601b/sparkfun_type5_config.h file_id: sparkfun_dosimeter_type5_config @@ -27,9 +33,12 @@ config_file: - path: public/silabs/dosimeter_type5/config/brd4108a/sparkfun_type5_config.h file_id: sparkfun_dosimeter_type5_config condition: [brd4108a] + - path: public/silabs/dosimeter_type5/config/brd4338a/sparkfun_type5_config.h + file_id: sparkfun_dosimeter_type5_config + condition: [brd4338a] - path: public/silabs/dosimeter_type5/config/other/sparkfun_type5_config.h file_id: sparkfun_dosimeter_type5_config - unless: [brd2601b, brd2703a, brd2704a, brd4108a, brd4314a] + unless: [brd2601b, brd2703a, brd2704a, brd4108a, brd4314a, brd4338a] provides: - name: sparkfun_dosimeter_type5 allow_multiple: false diff --git a/driver/component/drivers/silabs/sparkfun_environmental_bme280.slcc b/driver/component/drivers/silabs/sparkfun_environmental_bme280.slcc index 6ac2e95d..a940a586 100644 --- a/driver/component/drivers/silabs/sparkfun_environmental_bme280.slcc +++ b/driver/component/drivers/silabs/sparkfun_environmental_bme280.slcc @@ -8,17 +8,19 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm - name: sleeptimer -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c provides: - name: sparkfun_atmospheric_bme280 allow_multiple: false template_contribution: - name: component_catalog value: sparkfun_atmospheric_bme280 +config_file: + - path: public/silabs/environmental_bme280_ccs811/config/sparkfun_bme280_config.h + file_id: sparkfun_bme280_config include: - path: public/silabs/environmental_bme280_ccs811/inc file_list: diff --git a/driver/component/drivers/silabs/sparkfun_environmental_ccs811.slcc b/driver/component/drivers/silabs/sparkfun_environmental_ccs811.slcc index f3230073..538222a2 100644 --- a/driver/component/drivers/silabs/sparkfun_environmental_ccs811.slcc +++ b/driver/component/drivers/silabs/sparkfun_environmental_ccs811.slcc @@ -8,11 +8,11 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm - name: sleeptimer -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_digital_io provides: - name: sparkfun_air_quality_ccs811 allow_multiple: false @@ -35,9 +35,12 @@ config_file: - path: public/silabs/environmental_bme280_ccs811/config/brd4314a/sparkfun_ccs811_config.h file_id: sparkfun_ccs811_config condition: [brd4314a] + - path: public/silabs/environmental_bme280_ccs811/config/brd4338a/sparkfun_ccs811_config.h + file_id: sparkfun_ccs811_config + condition: [brd4338a] - path: public/silabs/environmental_bme280_ccs811/config/other/sparkfun_ccs811_config.h file_id: sparkfun_ccs811_config - unless: [brd2601b, brd2703a, brd2704a, brd4108a, brd4314a] + unless: [brd2601b, brd2703a, brd2704a, brd4108a, brd4314a, brd4338a] include: - path: public/silabs/environmental_bme280_ccs811/inc file_list: diff --git a/driver/component/drivers/silabs/sparkfun_hr_po_max30101_max32664.slcc b/driver/component/drivers/silabs/sparkfun_hr_po_max30101_max32664.slcc index a046cef7..806ea558 100644 --- a/driver/component/drivers/silabs/sparkfun_hr_po_max30101_max32664.slcc +++ b/driver/component/drivers/silabs/sparkfun_hr_po_max30101_max32664.slcc @@ -8,10 +8,11 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + config_file: - path: public/silabs/hr_po_max30101_max32664/config/sparkfun_max30101_max32664_config.h file_id: driver_config_sparkfun_hr_po_max30101_max32664 diff --git a/driver/component/drivers/silabs/sparkfun_human_presence_ak9753.slcc b/driver/component/drivers/silabs/sparkfun_human_presence_ak9753.slcc index 554e9168..509d5072 100644 --- a/driver/component/drivers/silabs/sparkfun_human_presence_ak9753.slcc +++ b/driver/component/drivers/silabs/sparkfun_human_presence_ak9753.slcc @@ -9,12 +9,12 @@ ui_hints: visibility: basic root_path: driver requires: - - name: status - - name: gpiointerrupt - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_digital_io + config_file: - path: public/silabs/human_presence_ak9753/config/sparkfun_ak9753_config.h file_id: driver_config_ak9753 @@ -28,7 +28,5 @@ include: - path: public/silabs/human_presence_ak9753/inc file_list: - path: sparkfun_ak9753.h - - path: sparkfun_ak9753_platform.h source: - - path: public/silabs/human_presence_ak9753/src/sparkfun_ak9753.c - - path: public/silabs/human_presence_ak9753/src/sparkfun_ak9753_platform.c \ No newline at end of file + - path: public/silabs/human_presence_ak9753/src/sparkfun_ak9753.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/sparkfun_ir_array_amg88xx.slcc b/driver/component/drivers/silabs/sparkfun_ir_array_amg88xx.slcc index 2f162176..00a8266e 100644 --- a/driver/component/drivers/silabs/sparkfun_ir_array_amg88xx.slcc +++ b/driver/component/drivers/silabs/sparkfun_ir_array_amg88xx.slcc @@ -8,11 +8,10 @@ quality: evaluation root_path: driver requires: - name: status - - name: sleeptimer - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: mikroe_peripheral_driver_i2c +config_file: + - path: public/silabs/ir_array_amg88xx/config/sparkfun_amg88xx_config.h + file_id: sparkfun_amg88xx_config provides: - name: sparkfun_ir_array_amg88xx template_contribution: diff --git a/driver/component/drivers/silabs/sparkfun_ir_array_mlx90640.slcc b/driver/component/drivers/silabs/sparkfun_ir_array_mlx90640.slcc index 44d8c818..6c1a21fb 100644 --- a/driver/component/drivers/silabs/sparkfun_ir_array_mlx90640.slcc +++ b/driver/component/drivers/silabs/sparkfun_ir_array_mlx90640.slcc @@ -9,12 +9,10 @@ root_path: driver requires: - name: status - name: sleeptimer - - name: i2cspm - - name: app_log + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c - name: app_assert -recommends: - - id: i2cspm - instance: [qwiic] config_file: - path: public/silabs/ir_array_mlx90640/config/sparkfun_mlx90640_config.h file_id: sparkfun_mlx90640_config @@ -25,9 +23,7 @@ template_contribution: value: sparkfun_ir_array_mlx90640 include: - path: public/silabs/ir_array_mlx90640/inc - file_list: - - path: sparkfun_mlx90640_i2c.h + file_list: - path: sparkfun_mlx90640.h source: - - path: public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640_i2c.c - path: public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640.c \ No newline at end of file diff --git a/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_i2c.slcc b/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_i2c.slcc index 648070d3..7c4112d1 100644 --- a/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_i2c.slcc +++ b/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_i2c.slcc @@ -8,16 +8,21 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm -recommends: - - id: i2cspm - instance: [mikroe] + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c provides: - name: pm_sps30_i2c allow_multiple: false template_contribution: - name: component_catalog value: pm_sps30_i2c + +config_file: + - path: public/silabs/particulate_matter_sensor_sps30/config/particulate_matter_sensor_sps30_i2c_config.h + file_id: particulate_matter_sensor_sps30_i2c_config_id + include: - path: inc file_list: diff --git a/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_uart.slcc b/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_uart.slcc index dbf2fa4d..5453d6d8 100644 --- a/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_uart.slcc +++ b/driver/component/drivers/silabs/sparkfun_particulate_matter_sps30_uart.slcc @@ -8,36 +8,11 @@ quality: evaluation root_path: driver requires: - name: status - - name: iostream_usart - - name: udelay -recommends: - - id: iostream_usart - instance: [sps30] -config_file: - - override: - component: iostream_usart - file_id: iostream_usart_config - instance: sps30 - path: public/silabs/particulate_matter_sensor_sps30/config/brd4314a/sl_iostream_usart_sps30_config.h - condition: [brd4314a] - - override: - component: iostream_usart - file_id: iostream_usart_config - instance: sps30 - path: public/silabs/particulate_matter_sensor_sps30/config/brd4108a/sl_iostream_usart_sps30_config.h - condition: [brd4108a] - - override: - component: iostream_usart - file_id: iostream_usart_config - instance: sps30 - path: public/silabs/particulate_matter_sensor_sps30/config/brd2703a/sl_iostream_usart_sps30_config.h - condition: [brd2703a] - - override: - component: iostream_usart - file_id: iostream_usart_config - instance: sps30 - path: public/silabs/particulate_matter_sensor_sps30/config/other/sl_iostream_usart_sps30_config.h - unless: [brd4314a, brd4108a, brd2703a] + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_uart + provides: - name: pm_sps30_uart allow_multiple: false diff --git a/driver/component/drivers/silabs/sparkfun_proximity_vcnl4040.slcc b/driver/component/drivers/silabs/sparkfun_proximity_vcnl4040.slcc index 670d93f9..c799de6e 100644 --- a/driver/component/drivers/silabs/sparkfun_proximity_vcnl4040.slcc +++ b/driver/component/drivers/silabs/sparkfun_proximity_vcnl4040.slcc @@ -8,10 +8,8 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_digital_io config_file: - path: public/silabs/proximity_vcnl4040/config/sparkfun_vcnl4040_config.h file_id: sparkfun_vcnl4040_config diff --git a/driver/component/drivers/silabs/sparkfun_qwiic_joystick.slcc b/driver/component/drivers/silabs/sparkfun_qwiic_joystick.slcc index 693f48c0..6a080ff7 100644 --- a/driver/component/drivers/silabs/sparkfun_qwiic_joystick.slcc +++ b/driver/component/drivers/silabs/sparkfun_qwiic_joystick.slcc @@ -8,16 +8,21 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm - name: sleeptimer -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + provides: - name: sparkfun_qwiic_joystick template_contribution: - name: component_catalog value: sparkfun_qwiic_joystick + +config_file: + - path: public/silabs/qwiic_joystick/config/sparkfun_qwiic_joystick_config.h + file_id: sparkfun_qwiic_joystick_config + include: - path: public/silabs/qwiic_joystick/inc file_list: diff --git a/driver/component/drivers/silabs/sparkfun_qwiic_keypad.slcc b/driver/component/drivers/silabs/sparkfun_qwiic_keypad.slcc index 26d903fb..0d8e71af 100644 --- a/driver/component/drivers/silabs/sparkfun_qwiic_keypad.slcc +++ b/driver/component/drivers/silabs/sparkfun_qwiic_keypad.slcc @@ -8,12 +8,16 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm - name: sleeptimer - name: gpiointerrupt -recommends: - - id: i2cspm - instance: [qwiic] + condition: [device_series_1] + - name: gpiointerrupt + condition: [device_series_2] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + - name: mikroe_peripheral_driver_digital_io + provides: - name: sparkfun_qwiic_keypad allow_multiple: false @@ -36,9 +40,12 @@ config_file: - path: public/silabs/qwiic_keypad/config/brd4314a/sparkfun_keypad_config.h file_id: sparkfun_keypad_config condition: [brd4314a] + - path: public/silabs/qwiic_keypad/config/brd4338a/sparkfun_keypad_config.h + file_id: sparkfun_keypad_config + condition: [brd4338a] - path: public/silabs/qwiic_keypad/config/other/sparkfun_keypad_config.h file_id: sparkfun_keypad_config - unless: [brd2601b, brd2703a, brd2704a, brd4108a, brd4314a] + unless: [brd2601b, brd2703a, brd2704a, brd4108a, brd4314a, brd4338a] include: - path: public/silabs/qwiic_keypad/inc file_list: diff --git a/driver/component/drivers/silabs/sparkfun_rfid_id12la.slcc b/driver/component/drivers/silabs/sparkfun_rfid_id12la.slcc index bdbcdbcb..bc8442a4 100644 --- a/driver/component/drivers/silabs/sparkfun_rfid_id12la.slcc +++ b/driver/component/drivers/silabs/sparkfun_rfid_id12la.slcc @@ -9,41 +9,14 @@ root_path: driver requires: - name: status - name: sleeptimer - - name: i2cspm -recommends: - - id: i2cspm - instance: [rfid] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c + config_file: - - override: - component: i2cspm - file_id: i2cspm_config - instance: rfid - path: public/silabs/rfid_id12la/config/brd2601b/sl_i2cspm_rfid_config.h - condition: [brd2601b] - - override: - component: i2cspm - file_id: i2cspm_config - instance: rfid - path: public/silabs/rfid_id12la/config/brd2703a/sl_i2cspm_rfid_config.h - condition: [brd2703a] - - override: - component: i2cspm - file_id: i2cspm_config - instance: rfid - path: public/silabs/rfid_id12la/config/brd2704a/sl_i2cspm_rfid_config.h - condition: [brd2704a] - - override: - component: i2cspm - file_id: i2cspm_config - instance: rfid - path: public/silabs/rfid_id12la/config/brd4108a/sl_i2cspm_rfid_config.h - condition: [brd4108a] - - override: - component: i2cspm - file_id: i2cspm_config - instance: rfid - path: public/silabs/rfid_id12la/config/brd4314a/sl_i2cspm_rfid_config.h - condition: [brd4314a] + - path: public/silabs/rfid_id12la/config/sparkfun_rfid_id12la_config.h + file_id: sparkfun_rfid_id12la_config + provides: - name: sparkfun_rfid_id12la template_contribution: diff --git a/driver/component/drivers/silabs/sparkfun_soil_moisture.slcc b/driver/component/drivers/silabs/sparkfun_soil_moisture.slcc index 0b97fecd..ba400af2 100644 --- a/driver/component/drivers/silabs/sparkfun_soil_moisture.slcc +++ b/driver/component/drivers/silabs/sparkfun_soil_moisture.slcc @@ -8,15 +8,18 @@ quality: evaluation root_path: driver requires: - name: status - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c provides: - name: sparkfun_soil_moisture template_contribution: - name: component_catalog value: sparkfun_soil_moisture +config_file: + - path: public/silabs/soil_moisture/config/sparkfun_soil_moisture_config.h + file_id: sparkfun_soil_moisture_config include: - path: public/silabs/soil_moisture/inc file_list: diff --git a/driver/component/drivers/silabs/sparkfun_spectroscopy_as7265x.slcc b/driver/component/drivers/silabs/sparkfun_spectroscopy_as7265x.slcc index 98ae082a..e0d97bf3 100644 --- a/driver/component/drivers/silabs/sparkfun_spectroscopy_as7265x.slcc +++ b/driver/component/drivers/silabs/sparkfun_spectroscopy_as7265x.slcc @@ -9,23 +9,22 @@ ui_hints: visibility: basic root_path: driver requires: - - name: status - name: sleeptimer - - name: i2cspm -recommends: - - id: i2cspm - instance: [qwiic] + - name: sleeptimer_si91x + condition: [device_si91x] + - name: mikroe_peripheral_driver_i2c provides: - name: sparkfun_spectroscopy_as7265x allow_multiple: false template_contribution: - name: component_catalog value: sparkfun_spectroscopy_as7265x +config_file: + - path: public/silabs/spectroscopy_as7265x/config/spectroscopy_as7265x_config.h + file_id: sparkfun_sgp40_config include: - path: public/silabs/spectroscopy_as7265x/inc file_list: - path: sparkfun_as7265x.h - - path: sparkfun_as7265x_platform.h source: - - path: public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x.c - - path: public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x_platform.c \ No newline at end of file + - path: public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x.c \ No newline at end of file diff --git a/driver/component/services/about_me.slcc b/driver/component/services/about_me.slcc new file mode 100644 index 00000000..82cf20c6 --- /dev/null +++ b/driver/component/services/about_me.slcc @@ -0,0 +1,26 @@ +id: about_me +package: third_party_hw_drivers +label: About Me +description: > + #NOTE: This is a help component. Do not install. + + + To show all components in this extension, make sure that + Evaluation quality software components are enabled + in the Software Component view. + + + The online Third Party Hardware Drivers documentation is available at the link below. + + https://docs.silabs.com/application-examples/latest + + + The application examples are hosted on Github and available at the link below. + + https://github.com/SiliconLabs/third_party_hw_drivers_extension + +category: About +quality: production +ui_hints: + visibility: basic +root_path: driver diff --git a/driver/component/services/fatfs.slcc b/driver/component/services/fatfs.slcc index 2bda1cdb..1aad2667 100644 --- a/driver/component/services/fatfs.slcc +++ b/driver/component/services/fatfs.slcc @@ -9,6 +9,8 @@ root_path: driver requires: - name: fatfs_storage_device - name: sleeptimer +- name: sleeptimer_si91x + condition: [device_si91x] - name: component_catalog provides: - name: services_fatfs diff --git a/driver/component/services/gpio_helper_si91x.slcc b/driver/component/services/gpio_helper_si91x.slcc new file mode 100644 index 00000000..fb4b4b9b --- /dev/null +++ b/driver/component/services/gpio_helper_si91x.slcc @@ -0,0 +1,27 @@ +id: gpio_helper_si91x +package: third_party_hw_drivers +label: GPIO helper for SI91X platform +description: > + GPIO helper for SI91X platform. +category: Services +quality: evaluation +root_path: driver +requires: + - name: sl_gpio + from: wiseconnect3_sdk + condition: + - device_si91x +provides: + - name: gpio_helper_si91x + allow_multiple: false +template_contribution: + - name: component_catalog + value: gpio_helper_si91x +include: + - path: public/silabs/services_gpio_helper_si91x/inc + file_list: + - path: gpio_helper_si91x.h +source: + - path: public/silabs/services_gpio_helper_si91x/src/gpio_helper_si91x.c + condition: + - device_si91x diff --git a/driver/component/services/mikroe_peripheral_drv_onewire.slcc b/driver/component/services/mikroe_peripheral_drv_onewire.slcc new file mode 100644 index 00000000..5d4777ed --- /dev/null +++ b/driver/component/services/mikroe_peripheral_drv_onewire.slcc @@ -0,0 +1,31 @@ +id: services_mikroe_peripheral_drivers_onewire +package: third_party_hw_drivers +label: OneWire +description: > + Interface provider for mikroSDK 2.0 SDK OneWire peripheral integration. +category: Services|mikroSDK 2.0 SDK - Peripheral Drivers +quality: evaluation +root_path: driver +provides: + - name: mikroe_peripheral_drivers_onewire + allow_multiple: false +template_contribution: + - name: component_catalog + value: services_mikroe_peripheral_drivers_onewire +requires: + - name: mikroe_peripheral_driver_digital_io + - name: udelay + condition: [device_series_1] + - name: udelay + condition: [device_series_2] +include: + - path: peripheral_drivers/mikroe/inc + file_list: + - path: drv_one_wire.h +source: + - path: peripheral_drivers/mikroe/src/drv_one_wire.c + condition: [device_series_1] + - path: peripheral_drivers/mikroe/src/drv_one_wire.c + condition: [device_series_2] + - path: peripheral_drivers/mikroe/src/drv_one_wire_si91x.c + condition: [device_si91x] diff --git a/driver/component/services/mikroe_peripheral_drv_spi.slcc b/driver/component/services/mikroe_peripheral_drv_spi.slcc index 70d0e62c..48a38211 100644 --- a/driver/component/services/mikroe_peripheral_drv_spi.slcc +++ b/driver/component/services/mikroe_peripheral_drv_spi.slcc @@ -13,6 +13,8 @@ requires: condition: [device_series_2] - name: sl_gspi condition: [device_si91x] + - name: sl_clock_manager + condition: [device_si91x] - name: mikroe_peripheral_driver_digital_io recommends: - id: spidrv diff --git a/driver/component/services/mikroe_peripheral_drv_ssi.slcc b/driver/component/services/mikroe_peripheral_drv_ssi.slcc new file mode 100644 index 00000000..44e04c68 --- /dev/null +++ b/driver/component/services/mikroe_peripheral_drv_ssi.slcc @@ -0,0 +1,24 @@ +id: services_mikroe_peripheral_drivers_ssi +package: third_party_hw_drivers +label: SPI +description: > + Interface provider for mikroSDK 2.0 SDK SPI peripheral integration. +category: Services|mikroSDK 2.0 SDK - Peripheral Drivers +quality: evaluation +root_path: driver +requires: + - name: sl_ssi + - name: sl_clock_manager + - name: mikroe_peripheral_driver_digital_io +provides: + - name: mikroe_peripheral_driver_ssi + allow_multiple: false +template_contribution: + - name: component_catalog + value: services_mikroe_peripheral_drivers_ssi +include: + - path: peripheral_drivers/mikroe/inc + file_list: + - path: drv_spi_master.h +source: + - path: peripheral_drivers/mikroe/src/drv_ssi_master_si91x.c diff --git a/driver/component/services/mikroe_peripheral_drv_uart.slcc b/driver/component/services/mikroe_peripheral_drv_uart.slcc index d24cc60f..cafc5391 100644 --- a/driver/component/services/mikroe_peripheral_drv_uart.slcc +++ b/driver/component/services/mikroe_peripheral_drv_uart.slcc @@ -7,8 +7,14 @@ category: Services|mikroSDK 2.0 SDK - Peripheral Drivers quality: evaluation root_path: driver requires: - - name: gsdk_version - name: iostream_transport + condition: [device_series_1] + - name: iostream_transport + condition: [device_series_2] + - name: sl_uart + condition: [device_si91x] + - name: app_assert + condition: [device_si91x] recommends: - id: iostream_transport instance: [mikroe] @@ -28,5 +34,14 @@ include: - path: drv_uart.h - path: drv_name.h - path: hal_target.h + - path: ring.h + condition: [device_si91x] source: - path: peripheral_drivers/mikroe/src/drv_uart.c + condition: [device_series_1] + - path: peripheral_drivers/mikroe/src/drv_uart.c + condition: [device_series_2] + - path: peripheral_drivers/mikroe/src/drv_uart_si91x.c + condition: [device_si91x] + - path: peripheral_drivers/mikroe/src/ring.c + condition: [device_si91x] diff --git a/driver/component/services/mipi_dbi_spi.slcc b/driver/component/services/mipi_dbi_spi.slcc new file mode 100644 index 00000000..dc1a1665 --- /dev/null +++ b/driver/component/services/mipi_dbi_spi.slcc @@ -0,0 +1,21 @@ +id: mipi_dbi_spi +package: third_party_hw_drivers +label: MIPI Display Bus Interface (SPI - 4Wire) +description: > + Support for MIPI DBI compliant display controllers. +category: Services +quality: evaluation +root_path: driver +requires: + - name: mipi_dbi_spi_gecko + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi_si91x + condition: + - device_si91x +provides: + - name: mipi_dbi_spi + allow_multiple: false +template_contribution: + - name: component_catalog + value: mipi_dbi_spi diff --git a/driver/component/services/mipi_dbi_spi_dma.slcc b/driver/component/services/mipi_dbi_spi_dma.slcc new file mode 100644 index 00000000..ceccad09 --- /dev/null +++ b/driver/component/services/mipi_dbi_spi_dma.slcc @@ -0,0 +1,23 @@ +id: mipi_dbi_spi_dma +package: third_party_hw_drivers +label: MIPI Display Bus Interface (SPI - 4Wire) +description: > + Support for MIPI DBI compliant display controllers. +category: Services +quality: evaluation +ui_hints: + visibility: never +root_path: driver +requires: + - name: mipi_dbi_spi_dma_gecko + condition: + - device # Enable for gecko device + - name: mipi_dbi_spi_si91x + condition: + - device_si91x +provides: + - name: mipi_dbi_spi_dma + allow_multiple: false +template_contribution: + - name: component_catalog + value: mipi_dbi_spi_dma \ No newline at end of file diff --git a/driver/component/services/mipi_dbi_spi_dma_gecko.slcc b/driver/component/services/mipi_dbi_spi_dma_gecko.slcc new file mode 100644 index 00000000..9b7a349b --- /dev/null +++ b/driver/component/services/mipi_dbi_spi_dma_gecko.slcc @@ -0,0 +1,30 @@ +id: mipi_dbi_spi_dma_gecko +package: third_party_hw_drivers +label: MIPI Display Bus Interface for gecko devices (SPI - 4Wire) +description: > + Support for MIPI DBI compliant display controllers. +category: Services +quality: evaluation +ui_hints: + visibility: never +root_path: driver +requires: + - name: spidrv_core +provides: + - name: mipi_dbi_spi_dma_gecko + allow_multiple: false +template_contribution: + - name: component_catalog + value: mipi_dbi_spi_dma_gecko +include: + - path: public/silabs/services_mipi_dbi/inc + file_list: + - path: mipi_dbi.h + - path: public/silabs/services_mipi_dbi/inc/gecko + file_list: + - path: mipi_dbi_spi.h +source: + - path: public/silabs/services_mipi_dbi/src/mipi_dbi_spi_dma_gecko.c + +define: + - name: MIPI_DBI_SPIDRV \ No newline at end of file diff --git a/driver/component/services/mipi_dbi_spi_gecko.slcc b/driver/component/services/mipi_dbi_spi_gecko.slcc new file mode 100644 index 00000000..634c2b9c --- /dev/null +++ b/driver/component/services/mipi_dbi_spi_gecko.slcc @@ -0,0 +1,29 @@ +id: mipi_dbi_spi_gecko +package: third_party_hw_drivers +label: MIPI Display Bus Interface for gecko devices (SPI - 4Wire) +description: > + Support for MIPI DBI compliant display controllers. +category: Services +quality: evaluation +ui_hints: + visibility: never +root_path: driver +requires: + - name: emlib_usart + condition: + - device # Enable for gecko device +provides: + - name: mipi_dbi_spi_gecko + allow_multiple: false +template_contribution: + - name: component_catalog + value: mipi_dbi_spi_gecko +include: + - path: public/silabs/services_mipi_dbi/inc + file_list: + - path: mipi_dbi.h + - path: public/silabs/services_mipi_dbi/inc/gecko + file_list: + - path: mipi_dbi_spi.h +source: + - path: public/silabs/services_mipi_dbi/src/mipi_dbi_spi_gecko.c \ No newline at end of file diff --git a/driver/component/services/mipi_dbi_spi_si91x.slcc b/driver/component/services/mipi_dbi_spi_si91x.slcc new file mode 100644 index 00000000..73d6f727 --- /dev/null +++ b/driver/component/services/mipi_dbi_spi_si91x.slcc @@ -0,0 +1,33 @@ +id: mipi_dbi_spi_si91x +package: third_party_hw_drivers +label: MIPI Display Bus Interface for si91x devices (SPI - 4Wire) +description: > + Support for MIPI DBI compliant display controllers. +category: Services +quality: evaluation +ui_hints: + visibility: never +root_path: driver +requires: + - name: sl_gpio + from: wiseconnect3_sdk + - name: gpio_helper_si91x + - name: sl_gspi + from: wiseconnect3_sdk + - name: sl_clock_manager + from: wiseconnect3_sdk +provides: + - name: mipi_dbi_spi_si91x + allow_multiple: false +template_contribution: + - name: component_catalog + value: mipi_dbi_spi_si91x +include: + - path: public/silabs/services_mipi_dbi/inc + file_list: + - path: mipi_dbi.h + - path: public/silabs/services_mipi_dbi/inc/si91x + file_list: + - path: mipi_dbi_spi.h +source: + - path: public/silabs/services_mipi_dbi/src/mipi_dbi_spi_si91x.c \ No newline at end of file diff --git a/driver/component/services/touch_screen.slcc b/driver/component/services/touch_screen.slcc index 0397936b..27976eb2 100644 --- a/driver/component/services/touch_screen.slcc +++ b/driver/component/services/touch_screen.slcc @@ -7,30 +7,10 @@ category: Human Machine Interface quality: evaluation root_path: driver requires: - - name: emlib_iadc - - name: udelay + - name: touch_screen_analog_interface provides: - name: touch_screen_analog allow_multiple: false -config_file: - - path: public/silabs/services_touch_screen/config/brd2601b/touch_screen_config.h - file_id: touch_screen_config - condition: [brd2601b] - - path: public/silabs/services_touch_screen/config/brd2703a/touch_screen_config.h - file_id: touch_screen_config - condition: [brd2703a] - - path: public/silabs/services_touch_screen/config/brd2704a/touch_screen_config.h - file_id: touch_screen_config - condition: [brd2704a] - - path: public/silabs/services_touch_screen/config/brd4314a/touch_screen_config.h - file_id: touch_screen_config - condition: [brd4314a] - - path: public/silabs/services_touch_screen/config/brd4108a/touch_screen_config.h - file_id: touch_screen_config - condition: [brd4108a] - - path: public/silabs/services_touch_screen/config/other/adafruit_ili9341_config.h - file_id: adafruit_ili9341_config - unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] template_contribution: - name: component_catalog value: services_touch_screen diff --git a/driver/component/services/touch_screen_gecko.slcc b/driver/component/services/touch_screen_gecko.slcc new file mode 100644 index 00000000..5921e271 --- /dev/null +++ b/driver/component/services/touch_screen_gecko.slcc @@ -0,0 +1,52 @@ +id: touch_screen_analog_gecko +package: third_party_hw_drivers +label: Touch Screen Analog Interface (Gecko) +description: > + Provide analog interface for touch screen driver. +category: Human Machine Interface +quality: evaluation +root_path: driver +requires: + - name: emlib_adc + condition: + - device_series_1 + - name: emlib_iadc + condition: + - device_series_2 + - name: emlib_gpio +provides: + - name: touch_screen_analog_interface + allow_multiple: false +config_file: + - path: public/silabs/services_touch_screen/config/brd2601b/touch_screen_config.h + file_id: touch_screen_config + condition: [brd2601b] + - path: public/silabs/services_touch_screen/config/brd2703a/touch_screen_config.h + file_id: touch_screen_config + condition: [brd2703a] + - path: public/silabs/services_touch_screen/config/brd2704a/touch_screen_config.h + file_id: touch_screen_config + condition: [brd2704a] + - path: public/silabs/services_touch_screen/config/brd4314a/touch_screen_config.h + file_id: touch_screen_config + condition: [brd4314a] + - path: public/silabs/services_touch_screen/config/brd4108a/touch_screen_config.h + file_id: touch_screen_config + condition: [brd4108a] + - path: public/silabs/services_touch_screen/config/other/touch_screen_config.h + file_id: touch_screen_config + unless: [brd2601b, brd2703a, brd2704a, brd4314a, brd4108a] +template_contribution: + - name: component_catalog + value: touch_screen_analog_gecko +include: + - path: public/silabs/services_touch_screen/inc + file_list: + - path: touch_screen.h +source: + - path: public/silabs/services_touch_screen/src/touch_screen_gecko_s1.c + condition: + - device_series_1 + - path: public/silabs/services_touch_screen/src/touch_screen_gecko_s2.c + condition: + - device_series_2 \ No newline at end of file diff --git a/driver/component/services/touch_screen_si91x.slcc b/driver/component/services/touch_screen_si91x.slcc new file mode 100644 index 00000000..baecc054 --- /dev/null +++ b/driver/component/services/touch_screen_si91x.slcc @@ -0,0 +1,38 @@ +id: touch_screen_analog_si91x +package: third_party_hw_drivers +label: Touch Screen Analog Interface (Si91x) +description: > + Provide analog interface for touch screen driver. +category: Human Machine Interface +quality: evaluation +root_path: driver +requires: + - name: sl_adc + condition: + - device_si91x + - name: gpio_helper_si91x + condition: + - device_si91x +provides: + - name: touch_screen_analog_interface + allow_multiple: false +config_file: + - path: public/silabs/services_touch_screen/config/brd4338a/touch_screen_config.h + file_id: touch_screen_config + condition: + - device_si91x + - brd4338a + - path: public/silabs/services_touch_screen/config/other/touch_screen_config.h + file_id: touch_screen_config + unless: [brd4338a] +template_contribution: + - name: component_catalog + value: touch_screen_analog_si91x +include: + - path: public/silabs/services_touch_screen/inc + file_list: + - path: touch_screen.h +source: + - path: public/silabs/services_touch_screen/src/touch_screen_si91x.c + condition: + - device_si91x \ No newline at end of file diff --git a/driver/peripheral_drivers/mikroe/inc/drv_one_wire.h b/driver/peripheral_drivers/mikroe/inc/drv_one_wire.h new file mode 100644 index 00000000..aada6ef7 --- /dev/null +++ b/driver/peripheral_drivers/mikroe/inc/drv_one_wire.h @@ -0,0 +1,107 @@ +/***************************************************************************//** + * @file drv_one_wire.h + * @brief mikroSDK 2.0 Click Peripheral Drivers - One Wire + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef _DRV_ONE_WIRE_H_ +#define _DRV_ONE_WIRE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "drv_name.h" + +#define ONE_WIRE_CMD_ROM_READ (0x33) +#define ONE_WIRE_CMD_ROM_SKIP (0xCC) +#define ONE_WIRE_CMD_ROM_MATCH (0x55) +#define ONE_WIRE_CMD_ROM_SEARCH (0xF0) +#define ONE_WIRE_CMD_ROM_READ_LEGACY (0x0F) + +/** + * @brief One Wire Driver return values. + */ +typedef enum { + ONE_WIRE_SUCCESS = 0, /*!< Success. */ + ONE_WIRE_ERROR = (-1) /*!< Error. */ +} one_wire_error_t; + +/** + * @brief Structure for storing One Wire device address. + * @details Unique One Wire address used for device addressing. + */ +typedef struct { + uint8_t address[8]; /*!< One Wire address buffer. */ +} one_wire_rom_address_t; + +/** + * @brief One Wire Driver initialization configuration structure. + * + * @details + * - data_pin value - to be configured as desired. + * - state value - NOTE must not be altered (it is supposed to be set automatically in Low Level Layer). + */ +typedef struct { + pin_name_t data_pin; /*!< One Wire pin - user is to configure it as desired. */ + bool state; /*!< State of a pin. NOTE must not be altered. */ +} one_wire_t; + +err_t one_wire_open(one_wire_t *obj); +void one_wire_configure_default(one_wire_t *obj); +err_t one_wire_reset(one_wire_t *obj); +err_t one_wire_read_rom(one_wire_t *obj, + one_wire_rom_address_t *device_rom_address); +err_t one_wire_skip_rom(one_wire_t *obj); +err_t one_wire_match_rom(one_wire_t *obj, + one_wire_rom_address_t *device_rom_address); +err_t one_wire_search_first_device(one_wire_t *obj, + one_wire_rom_address_t *one_wire_device_list); +err_t one_wire_search_next_device(one_wire_t *obj, + one_wire_rom_address_t *one_wire_device_list); +err_t one_wire_write_byte(one_wire_t *obj, + uint8_t *write_data_buffer, + size_t write_data_length); +err_t one_wire_read_byte(one_wire_t *obj, + uint8_t *read_data_buffer, + size_t read_data_length); + +#ifdef __cplusplus +} +#endif + +#endif // _DRV_ONE_WIRE_H_ +// ------------------------------------------------------------------------- END diff --git a/driver/peripheral_drivers/mikroe/inc/drv_uart.h b/driver/peripheral_drivers/mikroe/inc/drv_uart.h index b3589e65..f0d5a490 100644 --- a/driver/peripheral_drivers/mikroe/inc/drv_uart.h +++ b/driver/peripheral_drivers/mikroe/inc/drv_uart.h @@ -44,10 +44,11 @@ extern "C" { #endif +#include +#include #include "drv_name.h" -#include "sl_iostream.h" -#include "sl_iostream_uart.h" -#include "sl_iostream_usart.h" + +typedef const void *mikroe_uart_handle_t; ///< Created UART handle type typedef enum { @@ -98,7 +99,7 @@ typedef struct typedef struct { - sl_iostream_uart_t *handle; + mikroe_uart_handle_t handle; void *tx_ring_buffer; void *rx_ring_buffer; uart_config_t config; diff --git a/driver/peripheral_drivers/mikroe/inc/hal_gpio.h b/driver/peripheral_drivers/mikroe/inc/hal_gpio.h index f72d04cc..d8c4484f 100644 --- a/driver/peripheral_drivers/mikroe/inc/hal_gpio.h +++ b/driver/peripheral_drivers/mikroe/inc/hal_gpio.h @@ -49,8 +49,12 @@ extern "C" { #define PORT_SIZE (16) -#ifndef SL_SI91X_ULP_GPIO_PORT -#define SL_SI91X_ULP_GPIO_PORT 4 ///< ULP GPIO port number +#ifndef HP +#define HP 0 +#endif + +#ifndef ULP +#define ULP 4 #endif #define hal_gpio_pin_index(pin_name) \ @@ -62,15 +66,9 @@ extern "C" { #define hal_gpio_pin_mask(pin_name) \ (0x01 << gpio_pin_index(pin_name)) -#if (defined(SLI_SI917)) -#define hal_gpio_pin_name(port_index, pin_index) \ - ((port_index) == SL_SI91X_ULP_GPIO_PORT) \ - ? ((pin_name_t)(port_index) * PORT_SIZE + (pin_index)) \ - : ((pin_name_t)(pin_index)) -#else #define hal_gpio_pin_name(port_index, pin_index) \ ((pin_name_t)(port_index) * PORT_SIZE + (pin_index)) -#endif + #define hal_gpio_port_name(port_index) \ ((port_name_t)(port_index) * PORT_SIZE) diff --git a/driver/peripheral_drivers/mikroe/inc/hal_target.h b/driver/peripheral_drivers/mikroe/inc/hal_target.h index 33e57b4d..36322c3b 100644 --- a/driver/peripheral_drivers/mikroe/inc/hal_target.h +++ b/driver/peripheral_drivers/mikroe/inc/hal_target.h @@ -40,12 +40,16 @@ #ifndef _HAL_TARGET_H_ #define _HAL_TARGET_H_ +#include + #ifdef __cplusplus extern "C" { #endif -#define HAL_PIN_NC 0xffffffff -#define HAL_PORT_NC 0xffffffff +#define HAL_PIN_NC 0xffffffff +#define HAL_PORT_NC 0xffffffff + +#define US_DELAY_COUNTER 5 // Delay count typedef int32_t err_t; @@ -55,7 +59,20 @@ typedef enum { ACQUIRE_FAIL = (-1) } acquire_t; +#ifndef SLI_SI917 extern void sl_udelay_wait(unsigned us); + +#else +static inline void sl_udelay_wait(unsigned us) +{ + unsigned timeout = US_DELAY_COUNTER * us; + for (unsigned i = 0; i < timeout; i++) { + __asm__ __volatile__("nop"); + } +} + +#endif + extern void sl_sleeptimer_delay_millisecond(uint16_t time_ms); // Delay functions in microseconds diff --git a/driver/peripheral_drivers/mikroe/inc/ring.h b/driver/peripheral_drivers/mikroe/inc/ring.h new file mode 100644 index 00000000..e6e6fc5a --- /dev/null +++ b/driver/peripheral_drivers/mikroe/inc/ring.h @@ -0,0 +1,133 @@ +/***************************************************************************//** + * @file ring.h + * @brief mikroSDK 2.0 ring buffer + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef _RING_H_ +#define _RING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/*! + * @addtogroup platform Platform + * @{ + */ + +/*! + * @addtogroup ringbuf Ring buffer. + * @brief Ring buffer library. + * + * Detailed description here. + * @{ + */ + +typedef struct +{ + uint8_t *buffer; + size_t capacity; + volatile size_t size; + volatile size_t head; + volatile size_t tail; +} ring_buf8_t; + +/** + * @brief Initializes ring buffer with preallocated memory. + * + * @param ring The ring buffer instance. + * @param buf Preallocated memory address. + * @param capacity Preallocated memory size. + * + */ +void ring_buf8_init(ring_buf8_t *ring, uint8_t *buf, size_t capacity); + +/** + * @brief Pushes data to the ring buffer. + * + * @param ring The ring buffer instance. + * @param data_ Data to be pushed to the buffer. + * + * @return Returns true if data is pushed successfully, otherwise returns false. + */ +bool ring_buf8_push(ring_buf8_t *buf, uint8_t data_); + +/** + * @brief Pops data from the ring buffer. The caller needs to ensure that the + * ring buffer is not empty. + * + * @param ring The ring buffer instance. + * + * @return Returns data. + */ +uint8_t ring_buf8_pop(ring_buf8_t *buf); + +/** + * @brief Returns true if the ring buffer is empty, otherwise returns false. + */ +bool ring_buf8_is_empty(ring_buf8_t *buf); + +/** + * @brief Returns true if the ring buffer is full, otherwise returns false. + */ +bool ring_buf8_is_full(ring_buf8_t *buf); + +/** + * @brief Returns number of bytes in the ring buffer. + */ +size_t ring_buf8_size(ring_buf8_t *buf); + +/** + * @brief Clears the ring buffer. + */ +void ring_buf8_clear(ring_buf8_t *buf); + +/*! @} */ // ringbuf + +/*! @} */ // platform + +#ifdef __cplusplus +} +#endif + +/*! @} */ + +#endif // _RING_H_ +// ------------------------------------------------------------------------- END diff --git a/driver/peripheral_drivers/mikroe/src/drv_digital_in.c b/driver/peripheral_drivers/mikroe/src/drv_digital_in.c index f57eec9f..7d6a4d46 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_digital_in.c +++ b/driver/peripheral_drivers/mikroe/src/drv_digital_in.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file drv_digital_in.h + * @file drv_digital_in.c * @brief mikroSDK 2.0 Click Peripheral Drivers - Digital IN * @version 1.0.0 ******************************************************************************* diff --git a/driver/peripheral_drivers/mikroe/src/drv_digital_out.c b/driver/peripheral_drivers/mikroe/src/drv_digital_out.c index e702ecc1..ebed303a 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_digital_out.c +++ b/driver/peripheral_drivers/mikroe/src/drv_digital_out.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file drv_digital_out.h + * @file drv_digital_out.c * @brief mikroSDK 2.0 Click Peripheral Drivers - Digital OUT * @version 1.0.0 ******************************************************************************* diff --git a/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c b/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c index 18c2f025..a4e1cf60 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c +++ b/driver/peripheral_drivers/mikroe/src/drv_i2c_master.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file drv_i2c_master.h + * @file drv_i2c_master.c * @brief mikroSDK 2.0 Click Peripheral Drivers - I2C Master * @version 1.0.0 ******************************************************************************* diff --git a/driver/peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c index ca96ff2f..fe4f306c 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c +++ b/driver/peripheral_drivers/mikroe/src/drv_i2c_master_si91x.c @@ -44,19 +44,11 @@ #define TX_THRESHOLD 0 // tx threshold value #define RX_THRESHOLD 0 // rx threshold value -static sl_i2c_config_t i2c_config = { - .mode = SL_I2C_LEADER_MODE, - .operating_mode = SL_I2C_STANDARD_MODE, - .transfer_type = SL_I2C_USING_INTERRUPT, - .i2c_callback = NULL, -}; - static i2c_master_t *_owner = NULL; static uint32_t last_i2c_speed_used; static err_t _acquire(i2c_master_t *obj, bool obj_open_state); static err_t i2c_master_set_configuration(i2c_master_t *obj); -static void wait_till_i2c_gets_idle(sl_i2c_instance_t i2c_instance); void i2c_master_configure_default(i2c_master_config_t *config) { @@ -151,7 +143,7 @@ err_t i2c_master_write(i2c_master_t *obj, return I2C_MASTER_ERROR; } - wait_till_i2c_gets_idle(i2c_handle); + sl_si91x_i2c_wait_till_i2c_is_idle(i2c_handle); return I2C_MASTER_SUCCESS; } @@ -178,7 +170,7 @@ err_t i2c_master_read(i2c_master_t *obj, if (i2c_status != SL_I2C_SUCCESS) { return I2C_MASTER_ERROR; } - wait_till_i2c_gets_idle(i2c_handle); + sl_si91x_i2c_wait_till_i2c_is_idle(i2c_handle); return I2C_MASTER_SUCCESS; } @@ -224,7 +216,7 @@ err_t i2c_master_write_then_read(i2c_master_t *obj, if (i2c_status != SL_I2C_SUCCESS) { return I2C_MASTER_ERROR; } - wait_till_i2c_gets_idle(i2c_handle); + sl_si91x_i2c_wait_till_i2c_is_idle(i2c_handle); return I2C_MASTER_SUCCESS; } @@ -253,6 +245,12 @@ static err_t i2c_master_set_configuration(i2c_master_t *obj) { sl_i2c_status_t i2c_status; sl_i2c_instance_t i2c_handle = *(sl_i2c_instance_t *)obj->handle; + sl_i2c_config_t i2c_config = { + .mode = SL_I2C_LEADER_MODE, + .operating_mode = SL_I2C_STANDARD_MODE, + .transfer_type = SL_I2C_USING_INTERRUPT, + .i2c_callback = NULL, + }; last_i2c_speed_used = obj->config.speed; @@ -275,25 +273,4 @@ static err_t i2c_master_set_configuration(i2c_master_t *obj) return I2C_MASTER_SUCCESS; } -/******************************************************************************* - * Function to wait till I2C leader/follower comes to idle state - * - * @param i2c (I2C_TypeDef) Pointer to the I2C instance base address. - * @return none - ******************************************************************************/ -static void wait_till_i2c_gets_idle(sl_i2c_instance_t i2c_instance) -{ - I2C_TypeDef *i2c = I2C2; - - if (i2c_instance == SL_I2C0) { - i2c = I2C0; - } else if (i2c_instance == SL_I2C1) { - i2c = I2C1; - } else if (i2c_instance == SL_I2C2) { - i2c = I2C2; - } - // waiting for I2C instance to be in idle state - while (i2c->IC_STATUS_b.ACTIVITY) {} -} - // ------------------------------------------------------------------------- END diff --git a/driver/peripheral_drivers/mikroe/src/drv_one_wire.c b/driver/peripheral_drivers/mikroe/src/drv_one_wire.c new file mode 100644 index 00000000..722eef1e --- /dev/null +++ b/driver/peripheral_drivers/mikroe/src/drv_one_wire.c @@ -0,0 +1,749 @@ +/***************************************************************************//** + * @file drv_one_wire.c + * @brief mikroSDK 2.0 Click Peripheral Drivers - 1-Wire Master + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include +#include +#include "em_gpio.h" +#include "drv_one_wire.h" +#include "drv_digital_in.h" +#include "drv_digital_out.h" + +typedef struct { + pin_name_t pin_name; + GPIO_Port_TypeDef port_index; + unsigned int pin_index; +} one_wire_local_t; + +/*!< @brief Helper macro getting minimum bits per transfer. */ +#define HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER (8) + +// ------------------------------------------------------------------ VARIABLES + +/*!< @brief Static array for selecting One Wire data bits. */ +static const uint8_t hal_one_wire_selected_bit[ + HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER] = { + 1, 2, 4, 8, 16, 32, 64, 128 +}; + +/*!< @brief Helper macro for starting to enumerate device ID(s). */ +static uint8_t hal_one_wire_search_rom_command = ONE_WIRE_CMD_ROM_SEARCH; + +/*!< @brief Helper macro for reading a device ID. */ +static uint8_t hal_one_wire_read_rom_command = ONE_WIRE_CMD_ROM_READ; + +/*!< @brief Helper macro for ignoring a device ID. */ +static uint8_t hal_one_wire_skip_rom_command = ONE_WIRE_CMD_ROM_SKIP; + +/*!< @brief Helper macro for selecting a device with specific ID. */ +static uint8_t hal_one_wire_match_rom_command = ONE_WIRE_CMD_ROM_MATCH; + +/*!< @brief Helper flag if One Wire device is the last one left on the bus. */ +static uint8_t last_device_flag = 0; + +/*!< @brief Helper flag for last discrepancy. */ +static uint8_t last_discrepancy = 0; + +/*!< @brief Helper flag for last family discrepancy. */ +static uint8_t last_family_discrepancy = 0; + +static one_wire_t *owner = NULL; + +/*!< @brief Helper instance consisting of hardware specifics. */ +static one_wire_local_t one_wire_handle; + +static void hal_one_wire_reconfigure(one_wire_t *obj); +static err_t hal_one_wire_reset(void); +static err_t hal_one_wire_search(one_wire_rom_address_t *one_wire_device_list); +static void hal_one_wire_write_bit(uint8_t write_data_buffer); +static void hal_one_wire_read_bit(uint8_t *read_data_buffer); +static void hal_one_wire_write_byte(uint8_t *write_data_buffer, + size_t write_data_length); +static void hal_one_wire_read_byte(uint8_t *read_data_buffer, + size_t read_data_length); +static void one_wire_timing_value_a(void); +static void one_wire_timing_value_b(void); +static void one_wire_timing_value_c(void); +static void one_wire_timing_value_d(void); +static void one_wire_timing_value_e(void); +static void one_wire_timing_value_f(void); +static void one_wire_timing_value_h(void); +static void one_wire_timing_value_i(void); +static void one_wire_timing_value_j(void); + +err_t one_wire_open(one_wire_t *obj) +{ + if (obj == NULL) { + return ONE_WIRE_ERROR; + } + + if ((HAL_PIN_NC == obj->data_pin) || obj->state) { + return ONE_WIRE_ERROR; + } + + /* Enables appropriate PORT clock, configures pin to have digital output functionality, + * makes sure that HIGH voltage state is applied on pin before any One Wire actions. */ + hal_one_wire_reconfigure(obj); + + owner = obj; + + return ONE_WIRE_SUCCESS; +} + +void one_wire_configure_default(one_wire_t *obj) +{ + if (obj) { + obj->data_pin = 0xFFFFFFFF; + obj->state = false; + } +} + +err_t one_wire_reset(one_wire_t *obj) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_read_rom(one_wire_t *obj, + one_wire_rom_address_t *device_rom_address) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!device_rom_address) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate Reset sequence. + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + // Initiate "Read ROM" command. + hal_one_wire_write_byte(&hal_one_wire_read_rom_command, 1); + + // Read ROM address. + hal_one_wire_read_byte(device_rom_address->address, 8); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_skip_rom(one_wire_t *obj) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate Reset sequence. + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + // Initiate "Skip ROM" command. + hal_one_wire_write_byte(&hal_one_wire_skip_rom_command, 1); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_match_rom(one_wire_t *obj, + one_wire_rom_address_t *device_rom_address) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!device_rom_address) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate Reset sequence. + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + // Initiate "Match" command. + hal_one_wire_write_byte(&hal_one_wire_match_rom_command, 1); + + // Send ROM address. + hal_one_wire_write_byte(device_rom_address->address, 8); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_search_first_device(one_wire_t *obj, + one_wire_rom_address_t *one_wire_device_list) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!one_wire_device_list) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Reset the search state. + last_discrepancy = 0; + last_device_flag = 0; + last_family_discrepancy = 0; + + // Initiate search algorithm, in order to get first device on One Wire grid. + hal_one_wire_search(one_wire_device_list); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_search_next_device(one_wire_t *obj, + one_wire_rom_address_t *one_wire_device_list) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!one_wire_device_list) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate search algorithm, in order to get first device on One Wire grid. + hal_one_wire_search(one_wire_device_list); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_write_byte(one_wire_t *obj, + uint8_t *write_data_buffer, + size_t write_data_length) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (write_data_length <= 0) { + return ONE_WIRE_ERROR; + } + + if (!write_data_buffer) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + hal_one_wire_write_byte(write_data_buffer, write_data_length); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_read_byte(one_wire_t *obj, + uint8_t *read_data_buffer, + size_t read_data_length) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!read_data_buffer) { + return ONE_WIRE_ERROR; + } + + if (read_data_length <= 0) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + hal_one_wire_read_byte(read_data_buffer, read_data_length); + + return ONE_WIRE_SUCCESS; +} + +static void hal_one_wire_reconfigure(one_wire_t *obj) +{ + digital_out_t one_wire_pin; + + // Memorize info about pin number (for future use). + one_wire_handle.pin_name = obj->data_pin; + one_wire_handle.port_index = + (GPIO_Port_TypeDef) hal_gpio_port_index(one_wire_handle.pin_name); + one_wire_handle.pin_index = hal_gpio_pin_index(one_wire_handle.pin_name); + + // Set pin to be digital output. + digital_out_init(&one_wire_pin, one_wire_handle.pin_name); + + // Make sure that we have HIGH voltage state before executing any actions. + digital_out_high(&one_wire_pin); + + // Set object state to true. + obj->state = true; +} + +static err_t hal_one_wire_reset(void) +{ + /* Variable for checking whether there are device(s) on + * One Wire data pin (0) or there aren't any devices at all (1). */ + uint8_t device_response = 1; + + // Make sure that pin has output capability and set to LOW voltage level + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModePushPull, + 0); + + // Timing value for reset of One Wire bus - LOW voltage level. + one_wire_timing_value_h(); + + // Release pin (pull-up resistor will do the rest (pull the data line up)) + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModeInputPull, + 1); + + // Timing value for reset of One Wire bus - Master sample pulse. + one_wire_timing_value_i(); + + // Check whether there are devices on One Wire data pin. + device_response = (GPIO_PinInGet(one_wire_handle.port_index, + one_wire_handle.pin_index)) ? 0x01 : 0x00; + + // Provide enough time for power injection into internal power logic of devices that are present. + one_wire_timing_value_j(); + + // Return final result of device response. + return device_response; +} + +static void hal_one_wire_write_bit(uint8_t write_data_buffer) +{ + // Make sure that pin has output capability and set to LOW voltage level + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModePushPull, + 0); + + // Check whether a bit is binary one. + if (write_data_buffer & 1) { + // Timing value "a" for writing logical '1' - LOW voltage level. + one_wire_timing_value_a(); + // Else, bit is binary zero. + } else { + // Timing value "c" for writing logical '0' - LOW voltage level. + one_wire_timing_value_c(); + } + + // Release One Wire data line (pull-up resistor will pull the data line up) + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModeInputPull, + 1); + + // Recommended timing after writing 1's or 0's. + if (write_data_buffer & 1) { + // Timing value "b" for writing logical '1' - LOW voltage level. + one_wire_timing_value_b(); + } else { + // Timing value "d" for writing logical '0' - HIGH voltage level. + one_wire_timing_value_d(); + } +} + +static void hal_one_wire_read_bit(uint8_t *read_data_buffer) +{ + // Make sure that pin has output capability and set to LOW voltage level + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModePushPull, + 0); + + // Timing value "a" for bit reading - LOW voltage level. + one_wire_timing_value_a(); + + // Release One Wire data line (pull-up resistor will pull the data line up) + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModeInputPull, + 1); + + // Timing value "e" for sampling read information. + one_wire_timing_value_e(); + + // Read bit. + read_data_buffer[0] = (GPIO_PinInGet(one_wire_handle.port_index, + one_wire_handle.pin_index)) + ? 0x01 : 0x00; + + // Timing value "f" for the rest of the read operation. + one_wire_timing_value_f(); +} + +static err_t hal_one_wire_search(one_wire_rom_address_t *one_wire_device_list) +{ + // Final search result variable. + uint8_t search_result = 0; + + // Initialize variables for search method. + uint8_t rom_byte_number = 0; + uint8_t rom_byte_mask = 1; + uint8_t id_bit_number = 1; + uint8_t last_zero = 0; + + // The first bit read in a bit search sequence. + // ( logical AND of all of the id_bit_number bits of the devices that are still participating in the search ). + uint8_t id_bit = 0; + + // The complement of id_bit. + // ( logical AND of the complement of all id_bit_number bits of the devices that are still participating in the search ). + uint8_t cmp_id_bit = 0; + + // Search direction ( bit-per-bit search ). + uint8_t search_direction = 0; + + // If the last call was not the last one... + if (!last_device_flag) { + // If there were no any device while executing One Wire reset sequence... + if (hal_one_wire_reset()) { + // Reset all the important variables. + last_device_flag = 0; + last_discrepancy = 0; + last_family_discrepancy = 0; + + // Stop searching because there are no any One Wire capable devices. + return ONE_WIRE_ERROR; + } + + // If device(s) has(have) been found, initiate "Search" command. + hal_one_wire_write_byte(&hal_one_wire_search_rom_command, 1); + + // Iterate until all 64 bits (8 bytes) of unique ROM 'registration' numbers have not been found. + do { + // Read a bit. + hal_one_wire_read_bit(&id_bit); + + // Then, read its complement. + hal_one_wire_read_bit(&cmp_id_bit); + + // Check whether no devices participating in current search. + if ((id_bit == 1) && (cmp_id_bit == 1)) { + break; + // Proceed, because we have found some device(s). + } else { + // We are going to check once again whether read bit and + // its complement of all the devices on the One Wire grid are not the same. + // If they are not the same, we are going to start our search with non-complement bit. + if (id_bit != cmp_id_bit) { + search_direction = id_bit; // Bit write value for search. + + // Otherwise, there are both binary zeros and ones in the current + // bit position of the participating ROM numbers. This is a discrepancy. + } else { + if (id_bit_number < last_discrepancy) { + search_direction = + ((one_wire_device_list->address[rom_byte_number] & rom_byte_mask) + > 0); + } else { + search_direction = (id_bit_number == last_discrepancy); + } + + // If 0 is picked, save its position. + if (search_direction == 0) { + last_zero = id_bit_number; + + // Check for last discrepancy in family. + if (last_zero < 9) { + last_family_discrepancy = last_zero; + } + } + } + + // Set or clear bit in the ROM byte rom_byte_number with mask rom_byte_mask. + if (search_direction == 1) { + one_wire_device_list->address[rom_byte_number] |= rom_byte_mask; + } else { + one_wire_device_list->address[rom_byte_number] &= ~rom_byte_mask; + } + + // Search number search direction write bit. + hal_one_wire_write_bit(search_direction); + + // Increment the byte counter "id_bit_number", and shift the mask "rom_byte_mask". + id_bit_number++; + rom_byte_mask <<= 1; + + // If the mask is zero, then go to new "serial_num" byte, "rom_byte_number" and "reset_mask". + if (rom_byte_mask == 0) { + rom_byte_number++; + rom_byte_mask = 1; + } + } + } while (rom_byte_number < HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER); + + // If the search was successful then... + if (!(id_bit_number < 65)) { + last_discrepancy = last_zero; + + // Check for last device. + if (last_discrepancy == 0) { + last_device_flag = 1; + } + search_result = 1; + } + } + // If no device found then reset counters so next "search" will be like a first. + if (!search_result || !one_wire_device_list->address[0]) { + last_discrepancy = 0; + last_family_discrepancy = 0; + last_device_flag = 0; + search_result = 0; + } + + // Return info whether we have found some device ID or not. + return search_result; +} + +static void hal_one_wire_write_byte(uint8_t *write_data_buffer, + size_t write_data_length) +{ + size_t local_byte_checker = 0; + uint8_t local_bit_checker = 0; + + // For every byte to be sent... + while (local_byte_checker != write_data_length) { + // ...restart bit checker... + local_bit_checker = 0; + + // For every bit in byte to be sent... + while (local_bit_checker != HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER) { + // Make sure that pin has output capability and set to LOW voltage level + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModePushPull, + 0); + + // Check whether a bit is binary one. + if (write_data_buffer[local_byte_checker] + & hal_one_wire_selected_bit[local_bit_checker]) { + // Timing value "a" for writing logical '1' - LOW voltage level. + one_wire_timing_value_a(); + // Else, bit is binary zero. + } else { + // Timing value "c" for writing logical '0' - LOW voltage level. + one_wire_timing_value_c(); + } + + // Release One Wire data line (pull-up resistor will pull the data line up). + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModeInputPull, + 1); + + // Recommended timing after writing 1's or 0's. + if (write_data_buffer[local_byte_checker] + & hal_one_wire_selected_bit[local_bit_checker]) { + // Timing value "b" for writing logical '1' - LOW voltage level. + one_wire_timing_value_b(); + } else { + // Timing value "d" for writing logical '0' - HIGH voltage level. + one_wire_timing_value_d(); + } + // Increment so we could send another bit. + ++local_bit_checker; + } + // Increment so we could send another byte. + ++local_byte_checker; + } +} + +static void hal_one_wire_read_byte(uint8_t *read_data_buffer, + size_t read_data_length) +{ + size_t local_byte_checker = 0; + uint8_t local_bit_checker = 0; + uint8_t local_buffer = 0; + + // For every byte to be read... + while (local_byte_checker != read_data_length) { + // ...restart bit checker and buffer... + local_bit_checker = 0; + local_buffer = 0; + + // For every bit in byte to be read... + while (local_bit_checker != HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER) { + // Make sure that pin has output capability and set to LOW voltage level + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModePushPull, + 0); + + // Timing value "a" for bit reading - LOW voltage level. + one_wire_timing_value_a(); + + // Release One Wire data line (pull-up resistor will pull the data line up) + GPIO_PinModeSet(one_wire_handle.port_index, + one_wire_handle.pin_index, + gpioModeInputPull, + 1); + + // Timing value "e" for sampling read information. + one_wire_timing_value_e(); + + // Read bit. + local_buffer += ((GPIO_PinInGet(one_wire_handle.port_index, + one_wire_handle.pin_index)) + ? 0x01 : 0x00) << local_bit_checker; + + // Timing value "f" for the rest of the read operation. + one_wire_timing_value_f(); + + // Increment so we could send another bit. + ++local_bit_checker; + } + // Send back one logical level up a byte of data that has been just read. + read_data_buffer[local_byte_checker++] = local_buffer; + } +} + +static void one_wire_timing_value_a(void) +{ + sl_udelay_wait(6); +} + +static void one_wire_timing_value_b(void) +{ + sl_udelay_wait(64); +} + +static void one_wire_timing_value_c(void) +{ + sl_udelay_wait(60); +} + +static void one_wire_timing_value_d(void) +{ + sl_udelay_wait(10); +} + +static void one_wire_timing_value_e(void) +{ + sl_udelay_wait(9); +} + +static void one_wire_timing_value_f(void) +{ + sl_udelay_wait(55); +} + +static void one_wire_timing_value_h(void) +{ + sl_udelay_wait(480); +} + +static void one_wire_timing_value_i(void) +{ + sl_udelay_wait(70); +} + +static void one_wire_timing_value_j(void) +{ + sl_udelay_wait(410); +} + +// ------------------------------------------------------------------------- END diff --git a/driver/peripheral_drivers/mikroe/src/drv_one_wire_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_one_wire_si91x.c new file mode 100644 index 00000000..5fe97fd0 --- /dev/null +++ b/driver/peripheral_drivers/mikroe/src/drv_one_wire_si91x.c @@ -0,0 +1,760 @@ +/***************************************************************************//** + * @file drv_one_wire_si91x.c + * @brief mikroSDK 2.0 Click Peripheral Drivers - 1-Wire Master for Si91x + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include +#include +#include "drv_one_wire.h" +#include "drv_digital_in.h" +#include "drv_digital_out.h" +#include "sl_si91x_peripheral_gpio.h" + +typedef struct { + pin_name_t pin_name; + sl_gpio_port_t port_index; + unsigned int pin_index; +} one_wire_local_t; + +/*!< @brief Helper macro getting minimum bits per transfer. */ +#define HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER (8) + +// ------------------------------------------------------------------ VARIABLES + +/*!< @brief Static array for selecting One Wire data bits. */ +static const uint8_t hal_one_wire_selected_bit[ + HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER] = { + 1, 2, 4, 8, 16, 32, 64, 128 +}; + +/*!< @brief Helper macro for starting to enumerate device ID(s). */ +static uint8_t hal_one_wire_search_rom_command = ONE_WIRE_CMD_ROM_SEARCH; + +/*!< @brief Helper macro for reading a device ID. */ +static uint8_t hal_one_wire_read_rom_command = ONE_WIRE_CMD_ROM_READ; + +/*!< @brief Helper macro for ignoring a device ID. */ +static uint8_t hal_one_wire_skip_rom_command = ONE_WIRE_CMD_ROM_SKIP; + +/*!< @brief Helper macro for selecting a device with specific ID. */ +static uint8_t hal_one_wire_match_rom_command = ONE_WIRE_CMD_ROM_MATCH; + +/*!< @brief Helper flag if One Wire device is the last one left on the bus. */ +static uint8_t last_device_flag = 0; + +/*!< @brief Helper flag for last discrepancy. */ +static uint8_t last_discrepancy = 0; + +/*!< @brief Helper flag for last family discrepancy. */ +static uint8_t last_family_discrepancy = 0; + +static one_wire_t *owner = NULL; + +/*!< @brief Helper instance consisting of hardware specifics. */ +static one_wire_local_t one_wire_handle; + +static void hal_one_wire_reconfigure(one_wire_t *obj); +static err_t hal_one_wire_reset(void); +static err_t hal_one_wire_search(one_wire_rom_address_t *one_wire_device_list); +static void hal_one_wire_write_bit(uint8_t write_data_buffer); +static void hal_one_wire_read_bit(uint8_t *read_data_buffer); +static void hal_one_wire_write_byte(uint8_t *write_data_buffer, + size_t write_data_length); +static void hal_one_wire_read_byte(uint8_t *read_data_buffer, + size_t read_data_length); +static void one_wire_timing_value_a(void); +static void one_wire_timing_value_b(void); +static void one_wire_timing_value_c(void); +static void one_wire_timing_value_d(void); +static void one_wire_timing_value_e(void); +static void one_wire_timing_value_f(void); +static void one_wire_timing_value_h(void); +static void one_wire_timing_value_i(void); +static void one_wire_timing_value_j(void); + +err_t one_wire_open(one_wire_t *obj) +{ + if (obj == NULL) { + return ONE_WIRE_ERROR; + } + + if ((HAL_PIN_NC == obj->data_pin) || obj->state) { + return ONE_WIRE_ERROR; + } + + /* Enables appropriate PORT clock, configures pin to have digital output functionality, + * makes sure that HIGH voltage state is applied on pin before any One Wire actions. */ + hal_one_wire_reconfigure(obj); + + owner = obj; + + return ONE_WIRE_SUCCESS; +} + +void one_wire_configure_default(one_wire_t *obj) +{ + if (obj) { + obj->data_pin = 0xFFFFFFFF; + obj->state = false; + } +} + +err_t one_wire_reset(one_wire_t *obj) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_read_rom(one_wire_t *obj, + one_wire_rom_address_t *device_rom_address) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!device_rom_address) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate Reset sequence. + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + // Initiate "Read ROM" command. + hal_one_wire_write_byte(&hal_one_wire_read_rom_command, 1); + + // Read ROM address. + hal_one_wire_read_byte(device_rom_address->address, 8); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_skip_rom(one_wire_t *obj) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate Reset sequence. + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + // Initiate "Skip ROM" command. + hal_one_wire_write_byte(&hal_one_wire_skip_rom_command, 1); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_match_rom(one_wire_t *obj, + one_wire_rom_address_t *device_rom_address) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!device_rom_address) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate Reset sequence. + if (hal_one_wire_reset()) { + return ONE_WIRE_ERROR; + } + + // Initiate "Match" command. + hal_one_wire_write_byte(&hal_one_wire_match_rom_command, 1); + + // Send ROM address. + hal_one_wire_write_byte(device_rom_address->address, 8); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_search_first_device(one_wire_t *obj, + one_wire_rom_address_t *one_wire_device_list) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!one_wire_device_list) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Reset the search state. + last_discrepancy = 0; + last_device_flag = 0; + last_family_discrepancy = 0; + + // Initiate search algorithm, in order to get first device on One Wire grid. + hal_one_wire_search(one_wire_device_list); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_search_next_device(one_wire_t *obj, + one_wire_rom_address_t *one_wire_device_list) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!one_wire_device_list) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + // Initiate search algorithm, in order to get first device on One Wire grid. + hal_one_wire_search(one_wire_device_list); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_write_byte(one_wire_t *obj, + uint8_t *write_data_buffer, + size_t write_data_length) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (write_data_length <= 0) { + return ONE_WIRE_ERROR; + } + + if (!write_data_buffer) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + hal_one_wire_write_byte(write_data_buffer, write_data_length); + + return ONE_WIRE_SUCCESS; +} + +err_t one_wire_read_byte(one_wire_t *obj, + uint8_t *read_data_buffer, + size_t read_data_length) +{ + if (!obj) { + return ONE_WIRE_ERROR; + } + + if (!owner || (!obj->state)) { + return ONE_WIRE_ERROR; + } + + if (!read_data_buffer) { + return ONE_WIRE_ERROR; + } + + if (read_data_length <= 0) { + return ONE_WIRE_ERROR; + } + + if ((owner != obj)) { + hal_one_wire_reconfigure(obj); + } + + hal_one_wire_read_byte(read_data_buffer, read_data_length); + + return ONE_WIRE_SUCCESS; +} + +static void hal_one_wire_reconfigure(one_wire_t *obj) +{ + digital_out_t one_wire_pin; + + // Memorize info about pin number (for future use). + one_wire_handle.pin_name = obj->data_pin; + one_wire_handle.port_index = + (sl_gpio_port_t) hal_gpio_port_index(one_wire_handle.pin_name); + one_wire_handle.pin_index = hal_gpio_pin_index(one_wire_handle.pin_name); + + // Set pin to be digital output. + digital_out_init(&one_wire_pin, one_wire_handle.pin_name); + + // Make sure that we have HIGH voltage state before executing any actions. + digital_out_high(&one_wire_pin); + + // Set object state to true. + obj->state = true; +} + +static err_t hal_one_wire_reset(void) +{ + /* Variable for checking whether there are device(s) on + * One Wire data pin (0) or there aren't any devices at all (1). */ + uint8_t device_response = 1; + + // Make sure that pin has output capability. + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_OUTPUT); + + // Set pin to LOW voltage level. + sl_gpio_clear_pin_output(one_wire_handle.port_index, + one_wire_handle.pin_index); + + // Timing value for reset of One Wire bus - LOW voltage level. + one_wire_timing_value_h(); + + // Release pin ( pull-up resistor will do the rest (pull the data line up) ). + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_INPUT); + + // Timing value for reset of One Wire bus - Master sample pulse. + one_wire_timing_value_i(); + + // Check whether there are devices on One Wire data pin. + device_response = (sl_gpio_get_pin_input(one_wire_handle.port_index, + one_wire_handle.pin_index)) + ? 0x01 : 0x00; + + // Provide enough time for power injection into internal power logic of devices that are present. + one_wire_timing_value_j(); + + // Return final result of device response. + return device_response; +} + +static void hal_one_wire_write_bit(uint8_t write_data_buffer) +{ + // Make sure that pin has output capability. + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_OUTPUT); + + // Set pin to LOW voltage level. + sl_gpio_clear_pin_output(one_wire_handle.port_index, + one_wire_handle.pin_index); + + // Check whether a bit is binary one. + if (write_data_buffer & 1) { + // Timing value "a" for writing logical '1' - LOW voltage level. + one_wire_timing_value_a(); + // Else, bit is binary zero. + } else { + // Timing value "c" for writing logical '0' - LOW voltage level. + one_wire_timing_value_c(); + } + + // Release One Wire data line ( pull-up resistor will pull the data line up ). + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_INPUT); + + // Recommended timing after writing 1's or 0's. + if (write_data_buffer & 1) { + // Timing value "b" for writing logical '1' - LOW voltage level. + one_wire_timing_value_b(); + } else { + // Timing value "d" for writing logical '0' - HIGH voltage level. + one_wire_timing_value_d(); + } +} + +static void hal_one_wire_read_bit(uint8_t *read_data_buffer) +{ + // Make sure that pin has output capability. + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_OUTPUT); + + // Set pin to LOW voltage level. + sl_gpio_clear_pin_output(one_wire_handle.port_index, + one_wire_handle.pin_index); + + // Timing value "a" for bit reading - LOW voltage level. + one_wire_timing_value_a(); + + // Release One Wire data line ( pull-up resistor will pull the data line up ). + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_INPUT); + + // Timing value "e" for sampling read information. + one_wire_timing_value_e(); + + // Read bit. + read_data_buffer[0] = (sl_gpio_get_pin_input(one_wire_handle.port_index, + one_wire_handle.pin_index)) + ? 0x01 : 0x00; + + // Timing value "f" for the rest of the read operation. + one_wire_timing_value_f(); +} + +static err_t hal_one_wire_search(one_wire_rom_address_t *one_wire_device_list) +{ + // Final search result variable. + uint8_t search_result = 0; + + // Initialize variables for search method. + uint8_t rom_byte_number = 0; + uint8_t rom_byte_mask = 1; + uint8_t id_bit_number = 1; + uint8_t last_zero = 0; + + // The first bit read in a bit search sequence. + // ( logical AND of all of the id_bit_number bits of the devices that are still participating in the search ). + uint8_t id_bit = 0; + + // The complement of id_bit. + // ( logical AND of the complement of all id_bit_number bits of the devices that are still participating in the search ). + uint8_t cmp_id_bit = 0; + + // Search direction ( bit-per-bit search ). + uint8_t search_direction = 0; + + // If the last call was not the last one... + if (!last_device_flag) { + // If there were no any device while executing One Wire reset sequence... + if (hal_one_wire_reset()) { + // Reset all the important variables. + last_device_flag = 0; + last_discrepancy = 0; + last_family_discrepancy = 0; + + // Stop searching because there are no any One Wire capable devices. + return ONE_WIRE_ERROR; + } + + // If device(s) has(have) been found, initiate "Search" command. + hal_one_wire_write_byte(&hal_one_wire_search_rom_command, 1); + + // Iterate until all 64 bits (8 bytes) of unique ROM 'registration' numbers have not been found. + do { + // Read a bit. + hal_one_wire_read_bit(&id_bit); + + // Then, read its complement. + hal_one_wire_read_bit(&cmp_id_bit); + + // Check whether no devices participating in current search. + if ((id_bit == 1) && (cmp_id_bit == 1)) { + break; + // Proceed, because we have found some device(s). + } else { + // We are going to check once again whether read bit and + // its complement of all the devices on the One Wire grid are not the same. + // If they are not the same, we are going to start our search with non-complement bit. + if (id_bit != cmp_id_bit) { + search_direction = id_bit; // Bit write value for search. + + // Otherwise, there are both binary zeros and ones in the current + // bit position of the participating ROM numbers. This is a discrepancy. + } else { + if (id_bit_number < last_discrepancy) { + search_direction = + ((one_wire_device_list->address[rom_byte_number] & rom_byte_mask) + > 0); + } else { + search_direction = (id_bit_number == last_discrepancy); + } + + // If 0 is picked, save its position. + if (search_direction == 0) { + last_zero = id_bit_number; + + // Check for last discrepancy in family. + if (last_zero < 9) { + last_family_discrepancy = last_zero; + } + } + } + + // Set or clear bit in the ROM byte rom_byte_number with mask rom_byte_mask. + if (search_direction == 1) { + one_wire_device_list->address[rom_byte_number] |= rom_byte_mask; + } else { + one_wire_device_list->address[rom_byte_number] &= ~rom_byte_mask; + } + + // Search number search direction write bit. + hal_one_wire_write_bit(search_direction); + + // Increment the byte counter "id_bit_number", and shift the mask "rom_byte_mask". + id_bit_number++; + rom_byte_mask <<= 1; + + // If the mask is zero, then go to new "serial_num" byte, "rom_byte_number" and "reset_mask". + if (rom_byte_mask == 0) { + rom_byte_number++; + rom_byte_mask = 1; + } + } + } while (rom_byte_number < HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER); + + // If the search was successful then... + if (!(id_bit_number < 65)) { + last_discrepancy = last_zero; + + // Check for last device. + if (last_discrepancy == 0) { + last_device_flag = 1; + } + search_result = 1; + } + } + // If no device found then reset counters so next "search" will be like a first. + if (!search_result || !one_wire_device_list->address[0]) { + last_discrepancy = 0; + last_family_discrepancy = 0; + last_device_flag = 0; + search_result = 0; + } + + // Return info whether we have found some device ID or not. + return search_result; +} + +static void hal_one_wire_write_byte(uint8_t *write_data_buffer, + size_t write_data_length) +{ + size_t local_byte_checker = 0; + uint8_t local_bit_checker = 0; + + // For every byte to be sent... + while (local_byte_checker != write_data_length) { + // ...restart bit checker... + local_bit_checker = 0; + + // For every bit in byte to be sent... + while (local_bit_checker != HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER) { + // Make sure that pin has output capability. + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_OUTPUT); + + // Set pin to LOW voltage level. + sl_gpio_clear_pin_output(one_wire_handle.port_index, + one_wire_handle.pin_index); + + // Check whether a bit is binary one. + if (write_data_buffer[local_byte_checker] + & hal_one_wire_selected_bit[local_bit_checker]) { + // Timing value "a" for writing logical '1' - HIGH voltage level. + one_wire_timing_value_a(); + // Else, bit is binary zero. + } else { + // Timing value "c" for writing logical '0' - LOW voltage level. + one_wire_timing_value_c(); + } + + // Release One Wire data line ( pull-up resistor will pull the data line up ). + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_INPUT); + + // Recommended timing after writing 1's or 0's. + if (write_data_buffer[local_byte_checker] + & hal_one_wire_selected_bit[local_bit_checker]) { + // Timing value "b" for writing logical '1' - LOW voltage level. + one_wire_timing_value_b(); + } else { + // Timing value "d" for writing logical '0' - HIGH voltage level. + one_wire_timing_value_d(); + } + // Increment so we could send another bit. + ++local_bit_checker; + } + // Increment so we could send another byte. + ++local_byte_checker; + } +} + +static void hal_one_wire_read_byte(uint8_t *read_data_buffer, + size_t read_data_length) +{ + size_t local_byte_checker = 0; + uint8_t local_bit_checker = 0; + uint8_t local_buffer = 0; + + // For every byte to be read... + while (local_byte_checker != read_data_length) { + // ...restart bit checker and buffer... + local_bit_checker = 0; + local_buffer = 0; + + // For every bit in byte to be read... + while (local_bit_checker != HAL_ONE_WIRE_MINIMUM_BITS_PER_TRANSFER) { + // Make sure that pin has output capability. + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_OUTPUT); + + // Set pin to LOW voltage level. + sl_gpio_clear_pin_output(one_wire_handle.port_index, + one_wire_handle.pin_index); + + // Timing value "a" for bit reading - LOW voltage level. + one_wire_timing_value_a(); + + // Release One Wire data line ( pull-up resistor will pull the data line up ). + sl_si91x_gpio_set_pin_direction(one_wire_handle.port_index, + one_wire_handle.pin_index, + (sl_si91x_gpio_direction_t)GPIO_INPUT); + + // Timing value "e" for sampling read information. + one_wire_timing_value_e(); + + // Read bit. + local_buffer += ((sl_gpio_get_pin_input(one_wire_handle.port_index, + one_wire_handle.pin_index)) + ? 0x01 : 0x00) << local_bit_checker; + + // Timing value "f" for the rest of the read operation. + one_wire_timing_value_f(); + + // Increment so we could send another bit. + ++local_bit_checker; + } + // Send back one logical level up a byte of data that has been just read. + read_data_buffer[local_byte_checker++] = local_buffer; + } +} + +static void one_wire_timing_value_a(void) +{ + sl_udelay_wait(1); +} + +static void one_wire_timing_value_b(void) +{ + sl_udelay_wait(93); +} + +static void one_wire_timing_value_c(void) +{ + sl_udelay_wait(89); +} + +static void one_wire_timing_value_d(void) +{ + sl_udelay_wait(8); +} + +static void one_wire_timing_value_e(void) +{ + sl_udelay_wait(7); +} + +static void one_wire_timing_value_f(void) +{ + sl_udelay_wait(75); +} + +static void one_wire_timing_value_h(void) +{ + sl_udelay_wait(755); +} + +static void one_wire_timing_value_i(void) +{ + sl_udelay_wait(102); +} + +static void one_wire_timing_value_j(void) +{ + sl_udelay_wait(645); +} + +// ------------------------------------------------------------------------- END diff --git a/driver/peripheral_drivers/mikroe/src/drv_pwm.c b/driver/peripheral_drivers/mikroe/src/drv_pwm.c index 1955c278..65ebfffc 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_pwm.c +++ b/driver/peripheral_drivers/mikroe/src/drv_pwm.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file drv_pwm.h + * @file drv_pwm.c * @brief mikroSDK 2.0 Click Peripheral Drivers - PWM * @version 1.0.0 ******************************************************************************* diff --git a/driver/peripheral_drivers/mikroe/src/drv_pwm_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_pwm_si91x.c index da508a82..04cbcf89 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_pwm_si91x.c +++ b/driver/peripheral_drivers/mikroe/src/drv_pwm_si91x.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file drv_pwm.h + * @file drv_pwm_si91x.c * @brief mikroSDK 2.0 Click Peripheral Drivers - PWM for Si91x * @version 1.0.0 ******************************************************************************* diff --git a/driver/peripheral_drivers/mikroe/src/drv_spi_master.c b/driver/peripheral_drivers/mikroe/src/drv_spi_master.c index fdeb410b..850fbb85 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_spi_master.c +++ b/driver/peripheral_drivers/mikroe/src/drv_spi_master.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file drv_spi_master.h + * @file drv_spi_master.c * @brief mikroSDK 2.0 Click Peripheral Drivers - SPI Master * @version 1.0.0 ******************************************************************************* diff --git a/driver/peripheral_drivers/mikroe/src/drv_spi_master_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_spi_master_si91x.c index df755aa5..848ad71f 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_spi_master_si91x.c +++ b/driver/peripheral_drivers/mikroe/src/drv_spi_master_si91x.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file drv_spi_master.h + * @file drv_spi_master_si91x.c * @brief mikroSDK 2.0 Click Peripheral Drivers - SPI Master for Si91x * @version 1.0.0 ******************************************************************************* @@ -40,6 +40,8 @@ #include "drv_spi_master.h" #include "drv_digital_out.h" #include "sl_si91x_gspi.h" +#include "sl_si91x_clock_manager.h" +#include "rsi_rom_clks.h" #define GSPI_INTF_PLL_CLK 180000000 // Intf pll clock frequency #define GSPI_INTF_PLL_REF_CLK 40000000 // Intf pll reference clock freq @@ -53,6 +55,12 @@ #define GSPI_BITRATE 10000000 // Bitrate for setting #define GSPI_BIT_WIDTH 8 // Default Bit width +#define SOC_PLL_CLK ((uint32_t)(180000000)) // 180MHz default SoC PLL Clock as source to Processor +#define INTF_PLL_CLK ((uint32_t)(180000000)) // 180MHz default Interface PLL Clock as source to all peripherals +#define QSPI_ODD_DIV_ENABLE 0 // Odd division enable for QSPI clock +#define QSPI_SWALLO_ENABLE 0 // Swallo enable for QSPI clock +#define QSPI_DIVISION_FACTOR 0 // Division factor for QSPI clock + static spi_master_t *_owner = NULL; static sl_gspi_handle_t gspi_driver_handle = NULL; static uint32_t last_spi_speed_used; @@ -67,6 +75,7 @@ static void callback_event(uint32_t event); static err_t _acquire(spi_master_t *obj, bool obj_open_state); static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name); static err_t spi_master_set_configuration(spi_master_t *obj); +static void default_clock_configuration(void); void spi_master_configure_default(spi_master_config_t *config) { @@ -97,6 +106,9 @@ err_t spi_master_open(spi_master_t *obj, spi_master_config_t *config) return SPI_MASTER_ERROR; } + // default clock configuration by application common for whole system + default_clock_configuration(); + // Configuration of clock with the default clock parameters status = sl_si91x_gspi_configure_clock(&clock_config); if (status != SL_STATUS_OK) { @@ -388,12 +400,20 @@ static err_t spi_master_set_configuration(spi_master_t *obj) sl_gspi_control_config_t gspi_config = { .bit_width = GSPI_BIT_WIDTH, .bitrate = obj->config.speed, - .clock_mode = obj->config.mode, .slave_select_mode = SL_GSPI_MASTER_HW_OUTPUT, .swap_read = GSPI_SWAP_READ_DATA, .swap_write = GSPI_SWAP_WRITE_DATA }; + // GSPI just only support SPI mode 0 & 3 + if (obj->config.mode == SPI_MASTER_MODE_0) { + gspi_config.clock_mode = SL_GSPI_MODE_0; + } else if (obj->config.mode == SPI_MASTER_MODE_3) { + gspi_config.clock_mode = SL_GSPI_MODE_3; + } else { + return SPI_MASTER_ERROR; + } + last_spi_speed_used = obj->config.speed; last_spi_mode_used = obj->config.mode; @@ -414,6 +434,26 @@ static err_t spi_master_set_configuration(spi_master_t *obj) return SPI_MASTER_SUCCESS; } +// Function to configure clock on powerup +static void default_clock_configuration(void) +{ + // Core Clock runs at 180MHz SOC PLL Clock + sl_si91x_clock_manager_m4_set_core_clk(M4_SOCPLLCLK, SOC_PLL_CLK); + + // All peripherals' source to be set to Interface PLL Clock + // and it runs at 180MHz + sl_si91x_clock_manager_set_pll_freq(INFT_PLL, + INTF_PLL_CLK, + PLL_REF_CLK_VAL_XTAL); + + // Configure QSPI clock as input source + ROMAPI_M4SS_CLK_API->clk_qspi_clk_config(M4CLK, + QSPI_INTFPLLCLK, + QSPI_SWALLO_ENABLE, + QSPI_ODD_DIV_ENABLE, + QSPI_DIVISION_FACTOR); +} + /******************************************************************************* * Callback event function * It is responsible for the event which are triggered by GSPI interface diff --git a/driver/peripheral_drivers/mikroe/src/drv_ssi_master_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_ssi_master_si91x.c new file mode 100644 index 00000000..c70f6ea7 --- /dev/null +++ b/driver/peripheral_drivers/mikroe/src/drv_ssi_master_si91x.c @@ -0,0 +1,478 @@ +/***************************************************************************//** + * @file drv_ssi_master_si91x + * @brief mikroSDK 2.0 Click Peripheral Drivers - SSI Master for Si91x + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#include "drv_spi_master.h" +#include "drv_digital_out.h" +#include "sl_si91x_ssi.h" +#include "sl_si91x_clock_manager.h" +#include "rsi_rom_clks.h" + +#define SSI_MASTER_BUFFER_SIZE 1024 // Length of data to be sent through SPI +#define SSI_MASTER_DIVISION_FACTOR 0 // Division Factor +#define SSI_MASTER_INTF_PLL_CLK 180000000 // PLL Clock frequency +#define SSI_MASTER_INTF_PLL_REF_CLK 40000000 // PLL Ref Clock frequency +#define SSI_MASTER_SOC_PLL_CLK 20000000 // SOC PLL Clock frequency +#define SSI_MASTER_SOC_PLL_REF_CLK 40000000 // SOC PLL REFERENCE CLOCK frequency +#define SSI_MASTER_INTF_PLL_500_CTRL_VALUE 0xD900 // Interface PLL control value +#define SSI_MASTER_SOC_PLL_MM_COUNT_LIMIT 0xA4 // SOC PLL count limit +#define SSI_MASTER_BIT_WIDTH 8 // SSI bit width +#define SSI_MASTER_BAUDRATE 10000000 // SSI baudrate +#define SSI_MASTER_MAX_BIT_WIDTH 16 // Maximum Bit width +#define SSI_MASTER_RECEIVE_SAMPLE_DELAY 0 // By default sample delay is 0 + +#define SOC_PLL_CLK ((uint32_t)(180000000)) // 180MHz default SoC PLL Clock as source to Processor +#define INTF_PLL_CLK ((uint32_t)(180000000)) // 180MHz default Interface PLL Clock as source to all peripherals +#define QSPI_ODD_DIV_ENABLE 0 // Odd division enable for QSPI clock +#define QSPI_SWALLO_ENABLE 0 // Swallo enable for QSPI clock +#define QSPI_DIVISION_FACTOR 0 // Division factor for QSPI clock + +static spi_master_t *_owner = NULL; +static sl_ssi_handle_t ssi_driver_handle = NULL; +static uint32_t last_spi_speed_used; +static spi_master_mode_t last_spi_mode_used; + +extern sl_ssi_control_config_t ssi_configuration; + +static spi_master_chip_select_polarity_t spi_master_chip_select_polarity = + SPI_MASTER_CHIP_SELECT_DEFAULT_POLARITY; + +static void callback_event(uint32_t event); +static err_t _acquire(spi_master_t *obj, bool obj_open_state); +static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name); +static err_t spi_master_set_configuration(spi_master_t *obj); +static void default_clock_configuration(void); + +void spi_master_configure_default(spi_master_config_t *config) +{ + config->default_write_data = 0; + config->sck = 0xFFFFFFFF; + config->miso = 0xFFFFFFFF; + config->mosi = 0xFFFFFFFF; + config->speed = 1000000; + config->mode = SPI_MASTER_MODE_DEFAULT; +} + +err_t spi_master_open(spi_master_t *obj, spi_master_config_t *config) +{ + sl_status_t status; + spi_master_config_t *p_config = &obj->config; + sl_ssi_clock_config_t ssi_clock_config = { + .soc_pll_mm_count_value = SSI_MASTER_SOC_PLL_MM_COUNT_LIMIT, + .intf_pll_500_control_value = SSI_MASTER_INTF_PLL_500_CTRL_VALUE, + .intf_pll_clock = SSI_MASTER_INTF_PLL_CLK, + .intf_pll_reference_clock = SSI_MASTER_INTF_PLL_REF_CLK, + .soc_pll_clock = SSI_MASTER_SOC_PLL_CLK, + .soc_pll_reference_clock = SSI_MASTER_SOC_PLL_REF_CLK, + .division_factor = SSI_MASTER_DIVISION_FACTOR + }; + + memcpy(p_config, config, sizeof(spi_master_config_t)); + if (_acquire(obj, true) == ACQUIRE_FAIL) { + return SPI_MASTER_ERROR; + } + + // default clock configuration by application common for whole system + default_clock_configuration(); + + // Configuration of clock with the default clock parameters + status = sl_si91x_ssi_configure_clock(&ssi_clock_config); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + // Initialize the SSI driver + status = sl_si91x_ssi_init(SL_SSI_MASTER_ACTIVE, &ssi_driver_handle); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + + if (spi_master_set_configuration(obj) != SPI_MASTER_SUCCESS) { + return SPI_MASTER_ERROR; + } + // Register user callback function + status = sl_si91x_ssi_register_event_callback(ssi_driver_handle, + callback_event); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + + // Validation for executing the API only once + status = sl_si91x_ssi_set_slave_number(SSI_SLAVE_0); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + + return SPI_MASTER_SUCCESS; +} + +void spi_master_select_device(pin_name_t chip_select) +{ + digital_out_t struct_cs; + + if (chip_select == 0xFFFFFFFF) { + return; + } + + spi_master_configure_gpio_pin(&struct_cs, chip_select); + + if (spi_master_chip_select_polarity + == SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH) { + digital_out_high(&struct_cs); + } else { + digital_out_low(&struct_cs); + } +} + +void spi_master_deselect_device(pin_name_t chip_select) +{ + digital_out_t struct_cs; + + if (chip_select == 0xFFFFFFFF) { + return; + } + + spi_master_configure_gpio_pin(&struct_cs, chip_select); + + if (spi_master_chip_select_polarity + == SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH) { + digital_out_low(&struct_cs); + } else { + digital_out_high(&struct_cs); + } +} + +void spi_master_set_chip_select_polarity( + spi_master_chip_select_polarity_t polarity) +{ + if (polarity == SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH) { + spi_master_chip_select_polarity = + SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_HIGH; + } else { + spi_master_chip_select_polarity = + SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_LOW; + } +} + +/***************************************************************************//** + * Set SPI Master driver communication speed. + ******************************************************************************/ +err_t spi_master_set_speed(spi_master_t *obj, uint32_t speed) +{ + if (_acquire(obj, false) != ACQUIRE_SUCCESS) { + return SPI_MASTER_ERROR; + } + + obj->config.speed = speed; + + return spi_master_set_configuration(obj); +} + +/***************************************************************************//** + * Set SPI Master driver communication mode. + ******************************************************************************/ +err_t spi_master_set_mode(spi_master_t *obj, spi_master_mode_t mode) +{ + if (_acquire(obj, false) != ACQUIRE_SUCCESS) { + return SPI_MASTER_ERROR; + } + + obj->config.mode = mode; + + return spi_master_set_configuration(obj); +} + +/***************************************************************************//** + * Set SPI Master driver default ( dummy ) write data. + ******************************************************************************/ +err_t spi_master_set_default_write_data(spi_master_t *obj, + uint8_t default_write_data) +{ + if (_acquire(obj, false) != ACQUIRE_SUCCESS) { + return SPI_MASTER_ERROR; + } + + obj->config.default_write_data = default_write_data; + return SPI_MASTER_SUCCESS; +} + +/***************************************************************************//** + * Write byte to SPI bus. + ******************************************************************************/ +err_t spi_master_write(spi_master_t *obj, + uint8_t *write_data_buffer, + size_t write_data_length) +{ + sl_status_t status; + + if (_acquire(obj, false) != ACQUIRE_SUCCESS) { + return SPI_MASTER_ERROR; + } + + if ((last_spi_speed_used != obj->config.speed) + || (last_spi_mode_used != obj->config.mode)) { + // Update the config + spi_master_set_configuration(obj); + } + + status = sl_si91x_ssi_send_data(ssi_driver_handle, + write_data_buffer, + write_data_length); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + return SPI_MASTER_SUCCESS; +} + +/***************************************************************************//** + * Read byte from SPI bus. + ******************************************************************************/ +err_t spi_master_read(spi_master_t *obj, + uint8_t *read_data_buffer, + size_t read_data_length) +{ + sl_status_t status; + uint8_t write_data_buffer[read_data_length]; + + if (_acquire(obj, false) != ACQUIRE_SUCCESS) { + return SPI_MASTER_ERROR; + } + + if ((last_spi_speed_used != obj->config.speed) + || (last_spi_mode_used != obj->config.mode)) { + // Update the config + spi_master_set_configuration(obj); + } + + // The data transmit buffer will be populated with user-defined data + for (size_t i = 0; i < read_data_length; i++) { + write_data_buffer[i] = _owner->config.default_write_data; + } + + status = sl_si91x_ssi_transfer_data(ssi_driver_handle, + write_data_buffer, + read_data_buffer, + read_data_length); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + return SPI_MASTER_SUCCESS; +} + +/***************************************************************************//** + * Exchange bytes on SPI bus. + ******************************************************************************/ +err_t spi_master_exchange(spi_master_t *obj, + uint8_t *write_data_buffer, + uint8_t *read_data_buffer, + size_t exchange_data_length) +{ + sl_status_t status; + + if (_acquire(obj, false) != ACQUIRE_SUCCESS) { + return SPI_MASTER_ERROR; + } + + if ((last_spi_speed_used != obj->config.speed) + || (last_spi_mode_used != obj->config.mode)) { + // Update the config + spi_master_set_configuration(obj); + } + + status = sl_si91x_ssi_transfer_data(ssi_driver_handle, + write_data_buffer, + read_data_buffer, + exchange_data_length); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + return SPI_MASTER_SUCCESS; +} + +/***************************************************************************//** + * Perform a sequence of SPI Master writes + * immediately followed by a SPI Master read. + ******************************************************************************/ +err_t spi_master_write_then_read(spi_master_t *obj, + uint8_t *write_data_buffer, + size_t length_write_data, + uint8_t *read_data_buffer, + size_t length_read_data) +{ + sl_status_t status; + size_t tx_len = length_write_data + length_read_data; + uint8_t tx_buffer[tx_len]; + uint8_t rx_buffer[tx_len]; + + if (_acquire(obj, false) != ACQUIRE_SUCCESS) { + return SPI_MASTER_ERROR; + } + + if ((last_spi_speed_used != obj->config.speed) + || (last_spi_mode_used != obj->config.mode)) { + // Update the config + spi_master_set_configuration(obj); + } + + for (size_t i = 0; i < length_write_data; i++) { + tx_buffer[i] = write_data_buffer[i]; + } + // The data transmit buffer will be populated with user-defined data + for (size_t i = length_write_data; i < tx_len; i++) { + tx_buffer[i] = _owner->config.default_write_data; + } + + status = sl_si91x_ssi_transfer_data(ssi_driver_handle, + tx_buffer, + rx_buffer, + tx_len); + if (status != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + + for (size_t i = 0; i < length_read_data; i++) { + read_data_buffer[i] = rx_buffer[i + length_write_data]; + } + + return SPI_MASTER_SUCCESS; +} + +void spi_master_close(spi_master_t *obj) +{ + obj->handle = NULL; + _owner = NULL; +} + +static err_t _acquire(spi_master_t *obj, bool obj_open_state) +{ + if ((obj_open_state == true) && (_owner == obj)) { + return ACQUIRE_FAIL; + } + + if (_owner != obj) { + _owner = obj; + } + + return ACQUIRE_SUCCESS; +} + +static void spi_master_configure_gpio_pin(digital_out_t *out, pin_name_t name) +{ + out->pin.base = hal_gpio_port_index(name); + out->pin.mask = hal_gpio_pin_index(name); +} + +static err_t spi_master_set_configuration(spi_master_t *obj) +{ + sl_ssi_control_config_t ssi_config = { + .bit_width = SSI_MASTER_BIT_WIDTH, + .device_mode = (uint32_t) SL_SSI_MASTER_ACTIVE, + .baud_rate = obj->config.speed, + .receive_sample_delay = SSI_MASTER_RECEIVE_SAMPLE_DELAY, + }; + + if (obj->config.mode == SPI_MASTER_MODE_0) { + ssi_config.clock_mode = SL_SSI_PERIPHERAL_CPOL0_CPHA0; + } else if (obj->config.mode == SPI_MASTER_MODE_1) { + ssi_config.clock_mode = SL_SSI_PERIPHERAL_CPOL0_CPHA1; + } else if (obj->config.mode == SPI_MASTER_MODE_2) { + ssi_config.clock_mode = SL_SSI_PERIPHERAL_CPOL1_CPHA0; + } else if (obj->config.mode == SPI_MASTER_MODE_3) { + ssi_config.clock_mode = SL_SSI_PERIPHERAL_CPOL1_CPHA1; + } else { + return SPI_MASTER_ERROR; + } + + last_spi_speed_used = obj->config.speed; + last_spi_mode_used = obj->config.mode; + + // Overwrite gspi default + ssi_configuration = ssi_config; + + /** + * Configuration of all other parameters that are required by GSPI + * control_configuration structure is from sl_si91x_ssi_init.h file. + * The user can modify this structure with the configuration of + * his choice by filling this structure. + */ + if (sl_si91x_ssi_set_configuration(ssi_driver_handle, + &ssi_config, + SSI_SLAVE_0) != SL_STATUS_OK) { + return SPI_MASTER_ERROR; + } + + return SPI_MASTER_SUCCESS; +} + +// Function to configure clock on powerup +static void default_clock_configuration(void) +{ + // Core Clock runs at 180MHz SOC PLL Clock + sl_si91x_clock_manager_m4_set_core_clk(M4_SOCPLLCLK, SOC_PLL_CLK); + + // All peripherals' source to be set to Interface PLL Clock + // and it runs at 180MHz + sl_si91x_clock_manager_set_pll_freq(INFT_PLL, + INTF_PLL_CLK, + PLL_REF_CLK_VAL_XTAL); + + // Configure QSPI clock as input source + ROMAPI_M4SS_CLK_API->clk_qspi_clk_config(M4CLK, + QSPI_INTFPLLCLK, + QSPI_SWALLO_ENABLE, + QSPI_ODD_DIV_ENABLE, + QSPI_DIVISION_FACTOR); +} + +/******************************************************************************* + * Callback event function + * It is responsible for the event which are triggered by GSPI interface + * It updates the respective member of the structure as the event is triggered. + ******************************************************************************/ +static void callback_event(uint32_t event) +{ + switch (event) { + case SSI_EVENT_TRANSFER_COMPLETE: + break; + case SSI_EVENT_DATA_LOST: + break; + case SSI_EVENT_MODE_FAULT: + break; + } +} + +// ------------------------------------------------------------------------- END diff --git a/driver/peripheral_drivers/mikroe/src/drv_uart.c b/driver/peripheral_drivers/mikroe/src/drv_uart.c index d5a004ea..a98bb7a4 100644 --- a/driver/peripheral_drivers/mikroe/src/drv_uart.c +++ b/driver/peripheral_drivers/mikroe/src/drv_uart.c @@ -1,6 +1,6 @@ /***************************************************************************//** * @file drv_uart.c - * @brief mikroSDK 2.0 Click Peripheral Drivers + * @brief mikroSDK 2.0 Click Peripheral Drivers - UART * @version 1.0.0 ******************************************************************************* * # License @@ -37,40 +37,39 @@ * ******************************************************************************/ - - #include -#include "sl_gsdk_version.h" #if defined(SL_COMPONENT_CATALOG_PRESENT) #include "sl_component_catalog.h" #endif #include "sl_atomic.h" #include "drv_uart.h" +#include "sl_status.h" +#include "sl_iostream.h" +#include "sl_iostream_uart.h" +#include "sl_iostream_usart.h" static void uart_config_baudrate(uart_t *obj); static void uart_config_frame(uart_t *obj); static uart_t *_owner = NULL; -static err_t _acquire( uart_t *obj, bool obj_open_state ) +static err_t _acquire(uart_t *obj, bool obj_open_state) { err_t status = ACQUIRE_SUCCESS; - if ( obj_open_state == true && _owner == obj ) - { + if ((obj_open_state == true) && (_owner == obj)) { return ACQUIRE_FAIL; } - if ( _owner != obj ) - { + if (_owner != obj) { _owner = obj; } return status; } -void uart_configure_default( uart_config_t *config ) +void uart_configure_default(uart_config_t *config) { config->tx_pin = 0xFFFFFFFF; config->rx_pin = 0xFFFFFFFF; @@ -83,10 +82,11 @@ void uart_configure_default( uart_config_t *config ) config->rx_ring_size = 0; } -err_t uart_open( uart_t *obj, uart_config_t *config ) +err_t uart_open(uart_t *obj, uart_config_t *config) { uart_config_t *p_config = &obj->config; - memcpy( p_config, config, sizeof( uart_config_t ) ); + memcpy(p_config, config, sizeof(uart_config_t)); + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; // Configure baudrate. uart_config_baudrate(obj); @@ -95,19 +95,18 @@ err_t uart_open( uart_t *obj, uart_config_t *config ) uart_config_frame(obj); // Don't use auto cr lf - sl_iostream_uart_set_auto_cr_lf(obj->handle, false); + sl_iostream_uart_set_auto_cr_lf(ptr, false); // Default to blocking mode uart_set_blocking(obj, true); - return _acquire( obj, true ); + return _acquire(obj, true); } -err_t uart_set_baud( uart_t *obj, uint32_t baud ) +err_t uart_set_baud(uart_t *obj, uint32_t baud) { if (baud > 0) { - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) - { + if (_acquire(obj, false) != ACQUIRE_FAIL) { obj->config.baud = baud; // Configure baudrate. uart_config_baudrate(obj); @@ -117,10 +116,10 @@ err_t uart_set_baud( uart_t *obj, uint32_t baud ) return UART_ERROR; } -err_t uart_set_parity( uart_t *obj, uart_parity_t parity ) +err_t uart_set_parity(uart_t *obj, uart_parity_t parity) { if (parity <= UART_PARITY_ODD) { - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) { + if (_acquire(obj, false) != ACQUIRE_FAIL) { obj->config.parity = parity; // Configure frame. @@ -131,10 +130,10 @@ err_t uart_set_parity( uart_t *obj, uart_parity_t parity ) return UART_ERROR; } -err_t uart_set_stop_bits( uart_t *obj, uart_stop_bits_t stop ) +err_t uart_set_stop_bits(uart_t *obj, uart_stop_bits_t stop) { if (stop <= UART_STOP_BITS_TWO) { - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) { + if (_acquire(obj, false) != ACQUIRE_FAIL) { obj->config.stop_bits = stop; // Configure frame. @@ -145,10 +144,10 @@ err_t uart_set_stop_bits( uart_t *obj, uart_stop_bits_t stop ) return UART_ERROR; } -err_t uart_set_data_bits( uart_t *obj, uart_data_bits_t bits ) +err_t uart_set_data_bits(uart_t *obj, uart_data_bits_t bits) { if (bits <= UART_DATA_BITS_9) { - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) { + if (_acquire(obj, false) != ACQUIRE_FAIL) { obj->config.data_bits = bits; // Configure frame. @@ -159,7 +158,7 @@ err_t uart_set_data_bits( uart_t *obj, uart_data_bits_t bits ) return UART_ERROR; } -void uart_set_blocking( uart_t *obj, bool blocking) +void uart_set_blocking(uart_t *obj, bool blocking) { #if (defined(SL_CATALOG_KERNEL_PRESENT)) sl_iostream_uart_set_read_block(obj->handle); @@ -167,13 +166,13 @@ void uart_set_blocking( uart_t *obj, bool blocking) obj->is_blocking = blocking; } -err_t uart_write( uart_t *obj, uint8_t *buffer, size_t size ) +err_t uart_write(uart_t *obj, uint8_t *buffer, size_t size) { sl_status_t status; - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) - { - status = sl_iostream_write(&(obj->handle->stream), + if (_acquire(obj, false) != ACQUIRE_FAIL) { + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; + status = sl_iostream_write(&(ptr->stream), buffer, size); if (SL_STATUS_OK == status) { @@ -183,33 +182,39 @@ err_t uart_write( uart_t *obj, uint8_t *buffer, size_t size ) return UART_ERROR; } -err_t uart_read( uart_t *obj, uint8_t *buffer, size_t size ) +err_t uart_read(uart_t *obj, uint8_t *buffer, size_t size) { sl_status_t status; size_t read_size; int32_t total_size = 0; - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) { - while (size) { - status = sl_iostream_read(&(obj->handle->stream), + if (_acquire(obj, false) != ACQUIRE_FAIL) { + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; + if (obj->is_blocking) { + while (size) { + status = sl_iostream_read(&(ptr->stream), + buffer, + size, + &read_size); + if (SL_STATUS_OK == status) { + if (read_size > 0) { + if (read_size <= size) { + size -= read_size; + buffer += read_size; + total_size += read_size; + } else { + size = 0; + } + } + } + } + } else { // Non-blocking read + status = sl_iostream_read(&(ptr->stream), buffer, size, &read_size); if (SL_STATUS_OK == status) { - if (read_size > 0) { - if (read_size <= size) { - size -= read_size; - buffer += read_size; - total_size += read_size; - } else { - size = 0; - } - } - } else { - // Non-blocking read - if (!obj->is_blocking) { - return total_size; - } + total_size = read_size; } } return total_size; @@ -217,37 +222,38 @@ err_t uart_read( uart_t *obj, uint8_t *buffer, size_t size ) return UART_ERROR; } -err_t uart_print( uart_t *obj, char *text ) +err_t uart_print(uart_t *obj, char *text) { - size_t data_written = 0; + size_t data_written = 0; - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) - { - while (*text) { - if (SL_STATUS_OK != sl_iostream_write(&(obj->handle->stream), text++, 1)) { - return data_written; - } - data_written++; + if (_acquire(obj, false) != ACQUIRE_FAIL) { + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; + while (*text) { + if (SL_STATUS_OK != sl_iostream_write(&(ptr->stream), text++, 1)) { + return data_written; } - return data_written; - } else { - return UART_ERROR; + data_written++; } + return data_written; + } else { + return UART_ERROR; + } } -err_t uart_println( uart_t *obj, char *text ) +err_t uart_println(uart_t *obj, char *text) { size_t data_written = 0; - if ( _acquire( obj, false ) != ACQUIRE_FAIL ) - { + if (_acquire(obj, false) != ACQUIRE_FAIL) { + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; while (*text) { - if (SL_STATUS_OK != sl_iostream_write(&(obj->handle->stream), text++, 1)) { + if (SL_STATUS_OK != sl_iostream_write(&(ptr->stream), text++, 1)) { return data_written; } data_written++; } - if (SL_STATUS_OK != sl_iostream_write(&(obj->handle->stream), (uint8_t *)"\r\n", 2)) { + if (SL_STATUS_OK != sl_iostream_write(&(ptr->stream), (uint8_t *)"\r\n", + 2)) { return data_written; } data_written += 2; @@ -257,95 +263,27 @@ err_t uart_println( uart_t *obj, char *text ) } } -#if SL_GSDK_MAJOR_VERSION == 4 -#if SL_GSDK_MINOR_VERSION <= 1 -static sl_status_t uart_get_data_available(sl_iostream_uart_context_t *uart_context, size_t *data_size) +static uint8_t * get_write_ptr(const sl_iostream_uart_context_t *uart_context) { - CORE_DECLARE_IRQ_STATE; - CORE_ENTER_ATOMIC(); - *data_size = (size_t)uart_context->rx_count; - CORE_EXIT_ATOMIC(); - return SL_STATUS_OK; -} -static sl_status_t uart_clear_rx_buffer(sl_iostream_t *stream) -{ - sl_iostream_usart_context_t *ctx = (sl_iostream_usart_context_t *)stream->context; + uint8_t *dst; - CORE_DECLARE_IRQ_STATE; - CORE_ENTER_ATOMIC(); - while (USART_StatusGet(ctx->usart) & USART_STATUS_RXDATAV) { - uint8_t tmp = ctx->usart->RXDATA; - (void)tmp; - } - ctx->context.rx_count = 0; - CORE_EXIT_ATOMIC(); - return SL_STATUS_OK; -} -#else -#if SL_GSDK_MINOR_VERSION == 2 && SL_GSDK_PATCH_VERSION == 0 -static size_t nolock_uart_get_data_available(sl_iostream_uart_context_t *uart_context) -{ - if (uart_context->dma.data_available == false) { - #if defined(SL_CATALOG_KERNEL_PRESENT) - if (uart_context->block) { - EFM_ASSERT(false); // Should always have data in blocking mode - } - #endif - return 0; - } - - uint8_t *write_ptr; - int remaining; - Ecode_t ecode; - - unsigned int channel = uart_context->dma.channel; - size_t num_bytes_available = 0; - - uint8_t *read_start = uart_context->read_ptr; - // Get tranfer remaining from DMADRV - ecode = DMADRV_PauseTransfer(channel); // Pause for safety - EFM_ASSERT(ecode == ECODE_OK); - ecode = DMADRV_TransferRemainingCount(channel, &remaining); - EFM_ASSERT(ecode == ECODE_OK); - - // Calculate write_ptr - write_ptr = uart_context->dma.active_desc.dst; - write_ptr += (uart_context->dma.active_desc.count - remaining); - - // Calculate the number of bytes available for read - if (write_ptr > read_start) { - num_bytes_available = write_ptr - read_start; - } else { - num_bytes_available = (uart_context->rx_buffer + uart_context->rx_buffer_len) - read_start; - } - - // Finished updating the descriptor, resume the transfer - ecode = DMADRV_ResumeTransfer(channel); - EFM_ASSERT(ecode == ECODE_OK); - - return num_bytes_available; -} -#else // Support for later version -static uint8_t* get_write_ptr(const sl_iostream_uart_context_t * uart_context) -{ - uint8_t* dst; - - #if defined(DMA_PRESENT) +#if defined(DMA_PRESENT) int remaining; Ecode_t ecode; ecode = DMADRV_TransferRemainingCount(uart_context->dma.channel, &remaining); EFM_ASSERT(ecode == ECODE_OK); - DMA_DESCRIPTOR_TypeDef* desc = ((DMA_DESCRIPTOR_TypeDef *)(DMA->CTRLBASE)) + uart_context->dma.channel; - dst = (uint8_t*)desc->DSTEND - remaining; + DMA_DESCRIPTOR_TypeDef *desc = ((DMA_DESCRIPTOR_TypeDef *)(DMA->CTRLBASE)) + + uart_context->dma.channel; + dst = (uint8_t *)desc->DSTEND - remaining; - #elif defined(LDMA_PRESENT) +#elif defined(LDMA_PRESENT) dst = (uint8_t *)LDMA->CH[uart_context->dma.channel].DST; - #else - #error Missing (L)DMA peripheral - #endif +#else +#error Missing (L)DMA peripheral +#endif // Check for buffer over/underflow EFM_ASSERT(dst <= (uart_context->rx_buffer + uart_context->rx_buffer_len) @@ -353,14 +291,16 @@ static uint8_t* get_write_ptr(const sl_iostream_uart_context_t * uart_context) return dst; } -static size_t nolock_uart_get_data_available(sl_iostream_uart_context_t *uart_context) + +static size_t nolock_uart_get_data_available( + sl_iostream_uart_context_t *uart_context) { if (uart_context->rx_data_available == false) { - #if defined(SL_CATALOG_KERNEL_PRESENT) +#if defined(SL_CATALOG_KERNEL_PRESENT) if (uart_context->block) { EFM_ASSERT(false); // Should always have data in blocking mode } - #endif +#endif return 0; } @@ -371,17 +311,17 @@ static size_t nolock_uart_get_data_available(sl_iostream_uart_context_t *uart_co // Compute the read_size { - #if defined(DMA_PRESENT) +#if defined(DMA_PRESENT) ecode = DMADRV_PauseTransfer(uart_context->dma.channel); EFM_ASSERT(ecode == ECODE_OK); - #endif // DMA_PRESENT +#endif // DMA_PRESENT write_ptr = get_write_ptr(uart_context); - #if defined(DMA_PRESENT) +#if defined(DMA_PRESENT) ecode = DMADRV_ResumeTransfer(uart_context->dma.channel); EFM_ASSERT(ecode == ECODE_OK); - #endif // DMA_PRESENT +#endif // DMA_PRESENT if (write_ptr == uart_context->rx_read_ptr) { // (L)DMA is wrapped over rx_read_ptr, make sure it is stopped @@ -397,15 +337,18 @@ static size_t nolock_uart_get_data_available(sl_iostream_uart_context_t *uart_co } // (L)DMA wrapped around RX buffer, read data between read ptr and end of RX buffer else { - read_size = (uart_context->rx_buffer + uart_context->rx_buffer_len) - uart_context->rx_read_ptr; + read_size = (uart_context->rx_buffer + uart_context->rx_buffer_len) + - uart_context->rx_read_ptr; } } // Number of bytes written to user buffer can be different if control character are present return read_size; } -#endif // #if SL_GSDK_MINOR_VERSION == 2 && SL_GSDK_PATCH_VERSION == 0 -static sl_status_t uart_get_data_available(sl_iostream_uart_context_t *uart_context, size_t *data_size) + +static sl_status_t uart_get_data_available( + sl_iostream_uart_context_t *uart_context, + size_t *data_size) { CORE_DECLARE_IRQ_STATE; @@ -420,7 +363,8 @@ static sl_status_t uart_get_data_available(sl_iostream_uart_context_t *uart_cont } if (uart_context->block) { - EFM_ASSERT(osSemaphoreAcquire(uart_context->read_signal, osWaitForever) == osOK); + EFM_ASSERT(osSemaphoreAcquire(uart_context->read_signal, + osWaitForever) == osOK); } } #endif @@ -441,7 +385,8 @@ static sl_status_t uart_get_data_available(sl_iostream_uart_context_t *uart_cont static sl_status_t uart_clear_rx_buffer(sl_iostream_t *stream) { - sl_iostream_usart_context_t *context = (sl_iostream_usart_context_t *)stream->context; + sl_iostream_usart_context_t *context = + (sl_iostream_usart_context_t *)stream->context; size_t data_size = 0; sl_status_t sc; @@ -452,10 +397,10 @@ static sl_status_t uart_clear_rx_buffer(sl_iostream_t *stream) uint8_t tmp; size_t read_size = 0; - if(SL_STATUS_OK != sl_iostream_read(stream, - &tmp, - 1, - &read_size)) { + if (SL_STATUS_OK != sl_iostream_read(stream, + &tmp, + 1, + &read_size)) { break; } if (read_size == 0) { @@ -466,16 +411,12 @@ static sl_status_t uart_clear_rx_buffer(sl_iostream_t *stream) } return sc; } -#endif // #if SL_GSDK_MINOR_VERSION <= 1 -#else -#error "Current version of gecko sdk is not supported" -#endif // #if SL_GSDK_MAJOR_VERSION == 4 - - -size_t uart_bytes_available( uart_t *obj ) +size_t uart_bytes_available(uart_t *obj) { - sl_iostream_usart_context_t *ctx = (sl_iostream_usart_context_t *)obj->handle->stream.context; + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; + sl_iostream_usart_context_t *ctx = + (sl_iostream_usart_context_t *)ptr->stream.context; size_t data_size; if (SL_STATUS_OK != uart_get_data_available(&(ctx->context), &data_size)) { @@ -484,12 +425,13 @@ size_t uart_bytes_available( uart_t *obj ) return data_size; } -void uart_clear( uart_t *obj ) +void uart_clear(uart_t *obj) { - uart_clear_rx_buffer(&(obj->handle->stream)); + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; + uart_clear_rx_buffer(&(ptr->stream)); } -void uart_close( uart_t *obj ) +void uart_close(uart_t *obj) { obj->handle = NULL; _owner = NULL; @@ -497,7 +439,9 @@ void uart_close( uart_t *obj ) static void uart_config_baudrate(uart_t *obj) { - sl_iostream_usart_context_t *ctx = (sl_iostream_usart_context_t *)obj->handle->stream.context; + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; + sl_iostream_usart_context_t *ctx = + (sl_iostream_usart_context_t *)ptr->stream.context; // Configure baudrate. USART_BaudrateAsyncSet(ctx->usart, @@ -508,7 +452,9 @@ static void uart_config_baudrate(uart_t *obj) static void uart_config_frame(uart_t *obj) { - sl_iostream_usart_context_t *ctx = (sl_iostream_usart_context_t *)obj->handle->stream.context; + sl_iostream_uart_t *ptr = (sl_iostream_uart_t *)obj->handle; + sl_iostream_usart_context_t *ctx = + (sl_iostream_usart_context_t *)ptr->stream.context; uint32_t parity, stopbits, databits; switch (obj->config.data_bits) { @@ -556,6 +502,7 @@ static void uart_config_frame(uart_t *obj) stopbits = ctx->usart->FRAME & _USART_FRAME_STOPBITS_MASK; break; } + /* Configure databits, leave stopbits and parity. */ ctx->usart->FRAME = databits | stopbits | parity; } diff --git a/driver/peripheral_drivers/mikroe/src/drv_uart_si91x.c b/driver/peripheral_drivers/mikroe/src/drv_uart_si91x.c new file mode 100644 index 00000000..6209a9fa --- /dev/null +++ b/driver/peripheral_drivers/mikroe/src/drv_uart_si91x.c @@ -0,0 +1,417 @@ +/***************************************************************************//** + * @file drv_uart_si91x.c + * @brief mikroSDK 2.0 Click Peripheral Drivers - UART for Si91x + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#include +#include "sl_core.h" +#include "sl_si91x_usart.h" +#include "drv_uart.h" +#include "ring.h" + +static uart_t *_owner = NULL; +static sl_usart_handle_t drv_usart_handle; +static sl_si91x_usart_control_config_t drv_usart_config; + +static volatile boolean_t usart_send_complete = false; +static volatile boolean_t is_rx_enable = false; +static ring_buf8_t ring_rx_handle; +static uint8_t rx_buffer; + +static usart_parity_typedef_t uart_parity_mapping(uart_parity_t parity); +static usart_stopbit_typedef_t uart_stopbit_mapping(uart_stop_bits_t stop_bits); +static usart_databits_typedef_t uart_databits_mapping( + uart_data_bits_t data_bits); +void usart_callback_event(uint32_t event); + +static err_t _acquire(uart_t *obj, bool obj_open_state) +{ + err_t status = ACQUIRE_SUCCESS; + + if ((obj_open_state == true) && (_owner == obj)) { + return ACQUIRE_FAIL; + } + + if (_owner != obj) { + _owner = obj; + } + + return status; +} + +void uart_configure_default(uart_config_t *config) +{ + config->tx_pin = 0xFFFFFFFF; + config->rx_pin = 0xFFFFFFFF; + + config->baud = 115200; + config->data_bits = UART_DATA_BITS_DEFAULT; + config->parity = UART_PARITY_DEFAULT; + config->stop_bits = UART_STOP_BITS_DEFAULT; + config->tx_ring_size = 0; + config->rx_ring_size = 0; +} + +err_t uart_open(uart_t *obj, uart_config_t *config) +{ + uart_config_t *p_config = &obj->config; + + memcpy(p_config, config, sizeof(uart_config_t)); + if (_acquire(obj, true) == ACQUIRE_FAIL) { + return UART_ERROR; + } + + sl_status_t status; + + drv_usart_config.baudrate = obj->config.baud; + drv_usart_config.parity = uart_parity_mapping(obj->config.parity); + drv_usart_config.stopbits = uart_stopbit_mapping(obj->config.stop_bits); + drv_usart_config.databits = uart_databits_mapping(obj->config.data_bits); + drv_usart_config.mode = SL_USART_MODE_ASYNCHRONOUS; + drv_usart_config.hwflowcontrol = SL_USART_FLOW_CONTROL_NONE; + drv_usart_config.usart_module = *(uint32_t *)obj->handle; + + is_rx_enable = false; + ring_buf8_init(&ring_rx_handle, obj->rx_ring_buffer, + obj->config.rx_ring_size); + + // Initialize the UART + status = + sl_si91x_usart_init((usart_peripheral_t)drv_usart_config.usart_module, + &drv_usart_handle); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + // Configure the USART configurations + status = sli_si91x_usart_set_non_uc_configuration(drv_usart_handle, + &drv_usart_config); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + // Register user callback function + status = + sl_si91x_usart_multiple_instance_register_event_callback( + (usart_peripheral_t)drv_usart_config.usart_module, + usart_callback_event); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + + return UART_SUCCESS; +} + +err_t uart_set_baud(uart_t *obj, uint32_t baud) +{ + if ((_acquire(obj, false) == ACQUIRE_FAIL) || (baud == 0)) { + return UART_ERROR; + } + sl_status_t status; + + obj->config.baud = baud; + drv_usart_config.baudrate = baud; + // Configure the USART configurations + status = sli_si91x_usart_set_non_uc_configuration(drv_usart_handle, + &drv_usart_config); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + return UART_SUCCESS; +} + +err_t uart_set_parity(uart_t *obj, uart_parity_t parity) +{ + if ((_acquire(obj, false) == ACQUIRE_FAIL) || (parity > UART_PARITY_ODD)) { + return UART_ERROR; + } + sl_status_t status; + + obj->config.parity = parity; + drv_usart_config.parity = uart_parity_mapping(parity); + // Configure the USART configurations + status = sli_si91x_usart_set_non_uc_configuration(drv_usart_handle, + &drv_usart_config); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + return UART_SUCCESS; +} + +err_t uart_set_stop_bits(uart_t *obj, uart_stop_bits_t stop) +{ + if ((_acquire(obj, false) == ACQUIRE_FAIL) || (stop > UART_STOP_BITS_TWO)) { + return UART_ERROR; + } + sl_status_t status; + + obj->config.stop_bits = stop; + drv_usart_config.stopbits = uart_stopbit_mapping(stop); + // Configure the USART configurations + status = sli_si91x_usart_set_non_uc_configuration(drv_usart_handle, + &drv_usart_config); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + return UART_SUCCESS; +} + +err_t uart_set_data_bits(uart_t *obj, uart_data_bits_t bits) +{ + if ((_acquire(obj, false) == ACQUIRE_FAIL) || (bits > UART_DATA_BITS_9)) { + return UART_ERROR; + } + sl_status_t status; + + obj->config.data_bits = bits; + drv_usart_config.databits = uart_databits_mapping(bits); + // Configure the USART configurations + status = sli_si91x_usart_set_non_uc_configuration(drv_usart_handle, + &drv_usart_config); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + return UART_SUCCESS; +} + +void uart_set_blocking(uart_t *obj, bool blocking) +{ + obj->is_blocking = blocking; +} + +err_t uart_write(uart_t *obj, uint8_t *buffer, size_t size) +{ + if ((_acquire(obj, false) == ACQUIRE_FAIL) + || (buffer == NULL) || (size == 0)) { + return UART_ERROR; + } + + sl_status_t status; + + // Transfer the char + status = sl_si91x_usart_send_data(drv_usart_handle, buffer, size); + if (status != SL_STATUS_OK) { + return UART_ERROR; + } + + while (!usart_send_complete) {} + // Clear the variable to send next buffer + usart_send_complete = false; + + return size; +} + +err_t uart_read(uart_t *obj, uint8_t *buffer, size_t size) +{ + if ((_acquire(obj, false) == ACQUIRE_FAIL) + || (buffer == NULL) || (size == 0)) { + return UART_ERROR; + } + + sl_status_t status; + size_t data_read = 0; + + // Enable module rx, if it's disabled + if (!is_rx_enable) { + is_rx_enable = true; + status = sl_si91x_usart_receive_data(drv_usart_handle, &rx_buffer, 1); + if (status != SL_STATUS_OK) { + is_rx_enable = false; + return UART_ERROR; + } + } + + // Wait for some data to be received to the buffer if in blocking mode. + while (ring_buf8_is_empty(&ring_rx_handle)) { + if (!obj->is_blocking) { + return 0; + } + Delay_1ms(); + } + + while ((size > 0) && !ring_buf8_is_empty(&ring_rx_handle)) { + uint8_t data_byte; + CORE_DECLARE_IRQ_STATE; + CORE_ENTER_CRITICAL(); + data_byte = ring_buf8_pop(&ring_rx_handle); + + if (!is_rx_enable && !ring_buf8_is_full(&ring_rx_handle)) { + is_rx_enable = true; + status = sl_si91x_usart_receive_data(drv_usart_handle, &rx_buffer, 1); + if (status != SL_STATUS_OK) { + is_rx_enable = false; + CORE_EXIT_CRITICAL(); + return UART_ERROR; + } + } + CORE_EXIT_CRITICAL(); + + buffer[data_read++] = data_byte; + size--; + } + return data_read; +} + +err_t uart_print(uart_t *obj, char *text) +{ + size_t data_written = 0; + + if ((_acquire(obj, false) == ACQUIRE_FAIL) || (text == NULL)) { + return UART_ERROR; + } + while (text[data_written] != '\0') { + if (uart_write(obj, (uint8_t *)&text[data_written], 1) != 1) { + return data_written; + } + data_written++; + } + + return data_written; +} + +err_t uart_println(uart_t *obj, char *text) +{ + if ((_acquire(obj, false) == ACQUIRE_FAIL) || (text == NULL)) { + return UART_ERROR; + } + + err_t data_written = uart_print(obj, text); + + if (data_written < 0) { + return UART_ERROR; + } + + return data_written + uart_print(obj, "\r\n"); +} + +size_t uart_bytes_available(uart_t *obj) +{ + if (_acquire(obj, false) == ACQUIRE_FAIL) { + return UART_ERROR; + } + + return ring_buf8_size(&ring_rx_handle); +} + +void uart_clear(uart_t *obj) +{ + ring_buf8_clear(&ring_rx_handle); + (void) obj; +} + +void uart_close(uart_t *obj) +{ + obj->handle = NULL; + _owner = NULL; +} + +static usart_parity_typedef_t uart_parity_mapping(uart_parity_t parity) +{ + usart_parity_typedef_t val; + + switch (parity) { + default: + case UART_PARITY_NONE: + val = SL_USART_NO_PARITY; + break; + case UART_PARITY_EVEN: + val = SL_USART_EVEN_PARITY; + break; + case UART_PARITY_ODD: + val = SL_USART_ODD_PARITY; + break; + } + return val; +} + +static usart_stopbit_typedef_t uart_stopbit_mapping(uart_stop_bits_t stop_bits) +{ + usart_stopbit_typedef_t val; + + switch (stop_bits) { + default: + case UART_STOP_BITS_ONE: + val = SL_USART_STOP_BITS_1; + break; + case UART_STOP_BITS_ONE_AND_A_HALF: + val = SL_USART_STOP_BITS_1_5; + break; + case UART_STOP_BITS_TWO: + val = SL_USART_STOP_BITS_2; + break; + } + return val; +} + +static usart_databits_typedef_t uart_databits_mapping( + uart_data_bits_t data_bits) +{ + usart_databits_typedef_t val; + + switch (data_bits) { + default: + case UART_DATA_BITS_7: + val = SL_USART_DATA_BITS_7; + break; + case UART_DATA_BITS_8: + val = SL_USART_DATA_BITS_8; + break; + } + return val; +} + +/******************************************************************************* + * Callback function triggered on data Transfer and reception + ******************************************************************************/ +void usart_callback_event(uint32_t event) +{ + switch (event) { + case SL_USART_EVENT_SEND_COMPLETE: + usart_send_complete = true; + break; + case SL_USART_EVENT_RECEIVE_COMPLETE: + if (ring_buf8_is_full(&ring_rx_handle)) { + is_rx_enable = false; + return; + } + ring_buf8_push(&ring_rx_handle, rx_buffer); + if (is_rx_enable) { + sl_si91x_usart_receive_data(drv_usart_handle, &rx_buffer, 1); + } + break; + } +} + +// ------------------------------------------------------------------------- END diff --git a/driver/peripheral_drivers/mikroe/src/ring.c b/driver/peripheral_drivers/mikroe/src/ring.c new file mode 100644 index 00000000..291446b4 --- /dev/null +++ b/driver/peripheral_drivers/mikroe/src/ring.c @@ -0,0 +1,97 @@ +/***************************************************************************//** + * @file ring.c + * @brief mikroSDK 2.0 ring buffer library source file. + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include +#include "ring.h" +#include "app_assert.h" + +void ring_buf8_init(ring_buf8_t *ring, uint8_t *buf, size_t capacity) +{ + memset(buf, 0x00, capacity); + + ring->buffer = buf; + ring->capacity = capacity; +} + +bool ring_buf8_push(ring_buf8_t *ring, uint8_t data_) +{ + if (ring->size == ring->capacity) { + return false; + } + + ring->buffer[ring->head] = data_; + ring->head = (ring->head + 1) % ring->capacity; + ring->size++; + + return true; +} + +uint8_t ring_buf8_pop(ring_buf8_t *ring) +{ + uint8_t result; + app_assert(ring->size > 0); + + result = ring->buffer[ring->tail]; + ring->tail = (ring->tail + 1) % ring->capacity; + ring->size--; + + return result; +} + +bool ring_buf8_is_empty(ring_buf8_t *ring) +{ + return ring->size == 0; +} + +bool ring_buf8_is_full(ring_buf8_t *ring) +{ + return ring->size == ring->capacity; +} + +size_t ring_buf8_size(ring_buf8_t *ring) +{ + return ring->size; +} + +void ring_buf8_clear(ring_buf8_t *ring) +{ + ring->size = 0; + ring->head = 0; + ring->tail = 0; +} + +// ------------------------------------------------------------------------- END diff --git a/driver/public/mikroe/accurrent/config/brd2703a/mikroe_accurrent_config.h b/driver/public/mikroe/accurrent/config/brd2703a/mikroe_accurrent_config.h new file mode 100644 index 00000000..42442651 --- /dev/null +++ b/driver/public/mikroe/accurrent/config/brd2703a/mikroe_accurrent_config.h @@ -0,0 +1,81 @@ +/***************************************************************************//** + * @file mikroe_accurrent_config.h + * @brief Mikroe AC Current Click Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_ACCURRENT_CONFIG_H_ +#define MIKROE_ACCURRENT_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "em_gpio.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE ACCURRENT SPI Configuration +// MIKROE ACCURRENT SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MCP3201_SPI_UC 1 + +// Bit Rate (Bits/Second) <1-1600000> +// Default: 800000 +#define MIKROE_MCP3201_SPI_BITRATE 800000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ACCURRENT_CS +// $[GPIO_ACCURRENT_CS] +// #define ACCURRENT_CS_PORT 0 +// #define ACCURRENT_CS_PIN 0 +// [GPIO_ACCURRENT_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} + +#endif +#endif // MIKROE_ACCURRENT_CONFIG_H_ diff --git a/driver/public/mikroe/accurrent/config/brd4108a/mikroe_accurrent_config.h b/driver/public/mikroe/accurrent/config/brd4108a/mikroe_accurrent_config.h new file mode 100644 index 00000000..42442651 --- /dev/null +++ b/driver/public/mikroe/accurrent/config/brd4108a/mikroe_accurrent_config.h @@ -0,0 +1,81 @@ +/***************************************************************************//** + * @file mikroe_accurrent_config.h + * @brief Mikroe AC Current Click Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_ACCURRENT_CONFIG_H_ +#define MIKROE_ACCURRENT_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "em_gpio.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE ACCURRENT SPI Configuration +// MIKROE ACCURRENT SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MCP3201_SPI_UC 1 + +// Bit Rate (Bits/Second) <1-1600000> +// Default: 800000 +#define MIKROE_MCP3201_SPI_BITRATE 800000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ACCURRENT_CS +// $[GPIO_ACCURRENT_CS] +// #define ACCURRENT_CS_PORT 0 +// #define ACCURRENT_CS_PIN 0 +// [GPIO_ACCURRENT_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} + +#endif +#endif // MIKROE_ACCURRENT_CONFIG_H_ diff --git a/driver/public/mikroe/accurrent/config/brd4314a/mikroe_accurrent_config.h b/driver/public/mikroe/accurrent/config/brd4314a/mikroe_accurrent_config.h new file mode 100644 index 00000000..42442651 --- /dev/null +++ b/driver/public/mikroe/accurrent/config/brd4314a/mikroe_accurrent_config.h @@ -0,0 +1,81 @@ +/***************************************************************************//** + * @file mikroe_accurrent_config.h + * @brief Mikroe AC Current Click Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_ACCURRENT_CONFIG_H_ +#define MIKROE_ACCURRENT_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "em_gpio.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE ACCURRENT SPI Configuration +// MIKROE ACCURRENT SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MCP3201_SPI_UC 1 + +// Bit Rate (Bits/Second) <1-1600000> +// Default: 800000 +#define MIKROE_MCP3201_SPI_BITRATE 800000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ACCURRENT_CS +// $[GPIO_ACCURRENT_CS] +// #define ACCURRENT_CS_PORT 0 +// #define ACCURRENT_CS_PIN 0 +// [GPIO_ACCURRENT_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} + +#endif +#endif // MIKROE_ACCURRENT_CONFIG_H_ diff --git a/driver/public/mikroe/accurrent/config/brd4338a/mikroe_accurrent_config.h b/driver/public/mikroe/accurrent/config/brd4338a/mikroe_accurrent_config.h new file mode 100644 index 00000000..35e21e4d --- /dev/null +++ b/driver/public/mikroe/accurrent/config/brd4338a/mikroe_accurrent_config.h @@ -0,0 +1,79 @@ +/***************************************************************************//** + * @file mikroe_accurrent_config.h + * @brief Mikroe AC Current Click Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_ACCURRENT_CONFIG_H_ +#define MIKROE_ACCURRENT_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE ACCURRENT SPI Configuration +// MIKROE ACCURRENT SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_ACCURRENT_SPI_UC 1 + +// Bit Rate (Bits/Second) <1-1600000> +// Default: 800000 +#define MIKROE_ACCURRENT_SPI_BITRATE 800000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ACCURRENT_CS +// $[GPIO_ACCURRENT_CS] +// #define ACCURRENT_CS_PORT 0 +// #define ACCURRENT_CS_PIN 0 +// [GPIO_ACCURRENT_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} + +#endif +#endif // MIKROE_ACCURRENT_CONFIG_H_ diff --git a/driver/public/mikroe/accurrent/config/other/mikroe_accurrent_config.h b/driver/public/mikroe/accurrent/config/other/mikroe_accurrent_config.h new file mode 100644 index 00000000..f4f3b861 --- /dev/null +++ b/driver/public/mikroe/accurrent/config/other/mikroe_accurrent_config.h @@ -0,0 +1,79 @@ +/***************************************************************************//** + * @file mikroe_dcmotor26_config.h + * @brief Mikroe DC Motor 26 Click Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_ACCURRENT_CONFIG_H_ +#define MIKROE_ACCURRENT_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE ACCURRENT SPI Configuration +// MIKROE ACCURRENT SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MCP3201_SPI_UC 1 + +// Bit Rate (Bits/Second) <1-1600000> +// Default: 800000 +#define MIKROE_MCP3201_SPI_BITRATE 800000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ACCURRENT_CS +// $[GPIO_ACCURRENT_CS] +// #define ACCURRENT_CS_PORT 0 +// #define ACCURRENT_CS_PIN 0 +// [GPIO_ACCURRENT_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} + +#endif +#endif // MIKROE_DCMOTOR26_CONFIG_H_ diff --git a/driver/public/silabs/human_presence_ak9753/inc/sparkfun_ak9753_platform.h b/driver/public/mikroe/accurrent/inc/mikroe_accurrent.h similarity index 59% rename from driver/public/silabs/human_presence_ak9753/inc/sparkfun_ak9753_platform.h rename to driver/public/mikroe/accurrent/inc/mikroe_accurrent.h index 34bc31e2..cbbf49d9 100644 --- a/driver/public/silabs/human_presence_ak9753/inc/sparkfun_ak9753_platform.h +++ b/driver/public/mikroe/accurrent/inc/mikroe_accurrent.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file sparkfun_ak9753_platform.h - * @brief AK9753 Platform + * @file mikroe_accurrent.h + * @brief SCL ACCURRENT Prototypes * @version 1.0.0 ******************************************************************************* * # License @@ -37,88 +37,88 @@ * ******************************************************************************/ -#ifndef _SPARKFUN_AK9753_PLATFORM_H_ -#define _SPARKFUN_AK9753_PLATFORM_H_ +#ifndef MIKROE_ACCURRENT_H_ +#define MIKROE_ACCURRENT_H_ -#include #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { #endif -/** @defgroup ak9753_platform AK9753 Driver Platform */ +/** + * @brief Config Macros + */ -/***************************************************************************//** - * @addtogroup ak9753_platform - * @brief AK9753 Driver Platform - * @details - * @{ - ******************************************************************************/ +#define MIKROE_ACCURRENT_ADC_ITERATIONS 10 +#define MIKROE_ACCURRENT_ADC_RESOLUTION 0x0FFF +#define MIKROE_ACCURRENT_AC_TO_DC_V_SCALE 1.8f +#define MIKROE_ACCURRENT_SENSOR_RESOLUTION 30.0f +#define MIKROE_ACCURRENT_A_TO_MA_SCALE 1000.0f /***************************************************************************//** * @brief - * This function sets the IC2SPM instance used by platform functions. + * Initialization function. * - * @param[in] i2cspm_instance - * I2CSPM instance, default: SPARKFUN_AK9753_CONFIG_I2C_INSTANCE + * @param[in] spi_instance + * SPI instance handle * + * @return + * SL_STATUS_OK Successful initialization. + * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -void sparkfun_ak9753_platform_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_accurrent_init(mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief - * This function is used to read a register. - * - * @param[in] addr - * Address of register - * @param[out] pdata - * Pointer of output value + * This function sets the SPI instance used by platform functions. * - * @return sl_status_t SL_STATUS_OK on success or SL_STATUS_TRANSMIT on failure + * @param[in] spi_instance + * SPI instance handle * + * @return + * SL_STATUS_OK if there are no errors. + * SL_STATUS_INVALID_PARAMETER if spi_instance is null. ******************************************************************************/ -sl_status_t sparkfun_ak9753_platform_read_register(uint8_t addr, - uint8_t *pdata); +sl_status_t mikroe_accurrent_set_spi_instance(mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief - * This function is used to write a register. + * This function use the SPI to perform generic transfer. * - * @param[in] addr - * Address of register - * @param[out] data - * input value - * - * @return sl_status_t SL_STATUS_OK on success or SL_STATUS_TRANSMIT on failure + * @param[in] wr_buf Write data buffer + * @param[in] wr_len Number of byte in write data buffer + * @param[in] rd_buf Read data buffer + * @param[in] rd_len Number of byte in read data buffer * + * @return + * None ******************************************************************************/ -sl_status_t sparkfun_ak9753_platform_write_register(uint8_t addr, - uint8_t data); +void mikroe_accurrent_generic_transfer(uint8_t *wr_buf, uint16_t wr_len, + uint8_t *rd_buf, uint16_t rd_len); /***************************************************************************//** * @brief - * This function is used to write a register. - * - * @param[in] addr - * Address of register - * @param[out] pdata - * Pointer of output value - * @param[in] len - * Length of data to read - * - * @return sl_status_t SL_STATUS_OK on success or SL_STATUS_TRANSMIT on failure + * Gets current value of AC Current in A. * + * @return + * Returns float value of current in A. ******************************************************************************/ -sl_status_t sparkfun_ak9753_platform_read_blocking_register(uint8_t addr, - uint8_t *pdata, - uint8_t len); +float mikroe_accurrent_get_a(void); -/** @} (end addtogroup ak9753_platform) */ +/***************************************************************************//** + * @brief + * Gets current value of AC Current in mA. + * + * @return + * Returns float value of current in mA. + ******************************************************************************/ +float mikroe_accurrent_get_ma(void); #ifdef __cplusplus } #endif -#endif /* SPARKFUN_AK9753_PLATFORM_H */ +/** @} */ +#endif /* MIKROE_MAX30101_H_ */ diff --git a/driver/public/mikroe/accurrent/src/mikroe_accurrent.c b/driver/public/mikroe/accurrent/src/mikroe_accurrent.c new file mode 100644 index 00000000..b4da55e7 --- /dev/null +++ b/driver/public/mikroe/accurrent/src/mikroe_accurrent.c @@ -0,0 +1,115 @@ +/***************************************************************************//** + * @file mikroe_accurrent.c + * @brief SCL ACCURRENT Driver + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#include "accurrent.h" +#include "mikroe_accurrent.h" +#include "mikroe_accurrent_config.h" + +static accurrent_t ctx; +static accurrent_cfg_t ctx_cfg; + +/***************************************************************************//** + * @brief This function initializes all necessary pins and peripherals used + * for this click board. + ******************************************************************************/ +sl_status_t mikroe_accurrent_init(mikroe_spi_handle_t spi_instance) +{ + if (NULL == spi_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + accurrent_cfg_setup(&ctx_cfg); + + // Configure default spi instance + ctx.spi.handle = spi_instance; + +#if defined(ACCURRENT_CS_PORT) && defined(ACCURRENT_CS_PIN) + ctx_cfg.cs = hal_gpio_pin_name(ACCURRENT_CS_PORT, + ACCURRENT_CS_PIN); +#endif + +#if (MIKROE_ACCURRENT_SPI_UC == 1) + ctx_cfg.spi_speed = MIKROE_ACCURRENT_SPI_BITRATE; +#endif + + if (accurrent_init(&ctx, &ctx_cfg) != ACCURRENT_OK) { + return SL_STATUS_INITIALIZATION; + } + + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief This function sets the SPI instance. + ******************************************************************************/ +sl_status_t mikroe_accurrent_set_spi_instance(mikroe_spi_handle_t spi_instance) +{ + if (NULL == spi_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + ctx.spi.handle = spi_instance; + + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief This function use the SPI to perform generic transfer. + ******************************************************************************/ +void mikroe_accurrent_generic_transfer(uint8_t *wr_buf, uint16_t wr_len, + uint8_t *rd_buf, uint16_t rd_len) +{ + return accurrent_generic_transfer(&ctx, wr_buf, wr_len, rd_buf, rd_len); +} + +/***************************************************************************//** + * @brief Gets current value of AC Current in A. + ******************************************************************************/ +float mikroe_accurrent_get_a(void) +{ + return accurrent_get_a(&ctx); +} + +/***************************************************************************//** + * @brief Gets current value of AC Current in mA. + ******************************************************************************/ +float mikroe_accurrent_get_ma(void) +{ + return accurrent_get_ma(&ctx); +} diff --git a/driver/public/mikroe/barcode2_em3080w/config/brd2703a/mikroe_em3080w_config.h b/driver/public/mikroe/barcode2_em3080w/config/brd2703a/mikroe_em3080w_config.h index d89e12d5..2b1e7586 100644 --- a/driver/public/mikroe/barcode2_em3080w/config/brd2703a/mikroe_em3080w_config.h +++ b/driver/public/mikroe/barcode2_em3080w/config/brd2703a/mikroe_em3080w_config.h @@ -4,7 +4,7 @@ * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -39,6 +39,8 @@ #ifndef MIKROE_EM3080W_CONFIG_H_ #define MIKROE_EM3080W_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -47,14 +49,22 @@ extern "C" { // CONFIG_EM3080W_RST // $[GPIO_CONFIG_EM3080W_RST] -#define CONFIG_EM3080W_RST_PORT gpioPortC -#define CONFIG_EM3080W_RST_PIN 8 +#ifndef CONFIG_EM3080W_RST_PORT +#define CONFIG_EM3080W_RST_PORT gpioPortC +#endif +#ifndef CONFIG_EM3080W_RST_PIN +#define CONFIG_EM3080W_RST_PIN 8 +#endif // [GPIO_CONFIG_EM3080W_RST]$ // CONFIG_EM3080W_TRG // $[GPIO_CONFIG_EM3080W_TRG] -#define CONFIG_EM3080W_TRG_PORT gpioPortA -#define CONFIG_EM3080W_TRG_PIN 0 +#ifndef CONFIG_EM3080W_TRG_PORT +#define CONFIG_EM3080W_TRG_PORT gpioPortA +#endif +#ifndef CONFIG_EM3080W_TRG_PIN +#define CONFIG_EM3080W_TRG_PIN 0 +#endif // [GPIO_CONFIG_EM3080W_TRG]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/barcode2_em3080w/config/brd4108a/mikroe_em3080w_config.h b/driver/public/mikroe/barcode2_em3080w/config/brd4108a/mikroe_em3080w_config.h index 37d69f14..7d2bf707 100644 --- a/driver/public/mikroe/barcode2_em3080w/config/brd4108a/mikroe_em3080w_config.h +++ b/driver/public/mikroe/barcode2_em3080w/config/brd4108a/mikroe_em3080w_config.h @@ -4,7 +4,7 @@ * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -39,6 +39,8 @@ #ifndef MIKROE_EM3080W_CONFIG_H_ #define MIKROE_EM3080W_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -47,14 +49,22 @@ extern "C" { // CONFIG_EM3080W_RST // $[GPIO_CONFIG_EM3080W_RST] -#define CONFIG_EM3080W_RST_PORT gpioPortC -#define CONFIG_EM3080W_RST_PIN 6 +#ifndef CONFIG_EM3080W_RST_PORT +#define CONFIG_EM3080W_RST_PORT gpioPortC +#endif +#ifndef CONFIG_EM3080W_RST_PIN +#define CONFIG_EM3080W_RST_PIN 6 +#endif // [GPIO_CONFIG_EM3080W_RST]$ // CONFIG_EM3080W_TRG // $[GPIO_CONFIG_EM3080W_TRG] -#define CONFIG_EM3080W_TRG_PORT gpioPortB -#define CONFIG_EM3080W_TRG_PIN 4 +#ifndef CONFIG_EM3080W_TRG_PORT +#define CONFIG_EM3080W_TRG_PORT gpioPortB +#endif +#ifndef CONFIG_EM3080W_TRG_PIN +#define CONFIG_EM3080W_TRG_PIN 4 +#endif // [GPIO_CONFIG_EM3080W_TRG]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/barcode2_em3080w/config/brd4314a/mikroe_em3080w_config.h b/driver/public/mikroe/barcode2_em3080w/config/brd4314a/mikroe_em3080w_config.h index 37d69f14..7d2bf707 100644 --- a/driver/public/mikroe/barcode2_em3080w/config/brd4314a/mikroe_em3080w_config.h +++ b/driver/public/mikroe/barcode2_em3080w/config/brd4314a/mikroe_em3080w_config.h @@ -4,7 +4,7 @@ * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -39,6 +39,8 @@ #ifndef MIKROE_EM3080W_CONFIG_H_ #define MIKROE_EM3080W_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -47,14 +49,22 @@ extern "C" { // CONFIG_EM3080W_RST // $[GPIO_CONFIG_EM3080W_RST] -#define CONFIG_EM3080W_RST_PORT gpioPortC -#define CONFIG_EM3080W_RST_PIN 6 +#ifndef CONFIG_EM3080W_RST_PORT +#define CONFIG_EM3080W_RST_PORT gpioPortC +#endif +#ifndef CONFIG_EM3080W_RST_PIN +#define CONFIG_EM3080W_RST_PIN 6 +#endif // [GPIO_CONFIG_EM3080W_RST]$ // CONFIG_EM3080W_TRG // $[GPIO_CONFIG_EM3080W_TRG] -#define CONFIG_EM3080W_TRG_PORT gpioPortB -#define CONFIG_EM3080W_TRG_PIN 4 +#ifndef CONFIG_EM3080W_TRG_PORT +#define CONFIG_EM3080W_TRG_PORT gpioPortB +#endif +#ifndef CONFIG_EM3080W_TRG_PIN +#define CONFIG_EM3080W_TRG_PIN 4 +#endif // [GPIO_CONFIG_EM3080W_TRG]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/barcode2_em3080w/config/brd4338a/mikroe_em3080w_config.h b/driver/public/mikroe/barcode2_em3080w/config/brd4338a/mikroe_em3080w_config.h new file mode 100644 index 00000000..22897e6f --- /dev/null +++ b/driver/public/mikroe/barcode2_em3080w/config/brd4338a/mikroe_em3080w_config.h @@ -0,0 +1,74 @@ +/***************************************************************************//** + * @file mikroe_em3080w_config.h + * @brief Micro EM3080W Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_EM3080W_CONFIG_H_ +#define MIKROE_EM3080W_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< sl:start pin_tool >>> + +// CONFIG_EM3080W_RST +// $[GPIO_CONFIG_EM3080W_RST] +#ifndef CONFIG_EM3080W_RST_PORT +#define CONFIG_EM3080W_RST_PORT HP +#endif +#ifndef CONFIG_EM3080W_RST_PIN +#define CONFIG_EM3080W_RST_PIN 46 +#endif +// [GPIO_CONFIG_EM3080W_RST]$ + +// CONFIG_EM3080W_TRG +// $[GPIO_CONFIG_EM3080W_TRG] +#ifndef CONFIG_EM3080W_TRG_PORT +#define CONFIG_EM3080W_TRG_PORT HP +#endif +#ifndef CONFIG_EM3080W_TRG_PIN +#define CONFIG_EM3080W_TRG_PIN 47 +#endif +// [GPIO_CONFIG_EM3080W_TRG]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* MIKROE_EM3080W_CONFIG_H_ */ diff --git a/driver/public/mikroe/barcode2_em3080w/config/other/mikroe_em3080w_config.h b/driver/public/mikroe/barcode2_em3080w/config/other/mikroe_em3080w_config.h index 61f7aff7..a914b0aa 100644 --- a/driver/public/mikroe/barcode2_em3080w/config/other/mikroe_em3080w_config.h +++ b/driver/public/mikroe/barcode2_em3080w/config/other/mikroe_em3080w_config.h @@ -39,6 +39,10 @@ #ifndef MIKROE_EM3080W_CONFIG_H_ #define MIKROE_EM3080W_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/barcode2_em3080w/inc/mikroe_em3080w.h b/driver/public/mikroe/barcode2_em3080w/inc/mikroe_em3080w.h index 6df04a9b..91c765de 100644 --- a/driver/public/mikroe/barcode2_em3080w/inc/mikroe_em3080w.h +++ b/driver/public/mikroe/barcode2_em3080w/inc/mikroe_em3080w.h @@ -84,7 +84,7 @@ typedef barcode2_t mikroe_barcode2_t; * used for this click. ******************************************************************************/ sl_status_t mikroe_barcode2_init (mikroe_barcode2_t *barcode2, - sl_iostream_uart_t *stream, + mikroe_uart_handle_t uart_handle, uint16_t baud_rate); /***************************************************************************//** diff --git a/driver/public/mikroe/barcode2_em3080w/src/mikroe_em3080w.c b/driver/public/mikroe/barcode2_em3080w/src/mikroe_em3080w.c index 5b8d9640..61bb1bc0 100644 --- a/driver/public/mikroe/barcode2_em3080w/src/mikroe_em3080w.c +++ b/driver/public/mikroe/barcode2_em3080w/src/mikroe_em3080w.c @@ -37,13 +37,12 @@ #include "mikroe_em3080w.h" sl_status_t mikroe_barcode2_init(mikroe_barcode2_t *barcode2, - sl_iostream_uart_t *stream, + mikroe_uart_handle_t uart_handle, uint16_t baud_rate) { barcode2_cfg_t cfg; - BARCODE2_RETVAL retval; - if (!barcode2 || !stream) { + if (!barcode2 || !uart_handle) { return SL_STATUS_INVALID_PARAMETER; } @@ -53,9 +52,11 @@ sl_status_t mikroe_barcode2_init(mikroe_barcode2_t *barcode2, if (baud_rate > 0) { cfg.baud_rate = baud_rate; } - barcode2->uart.handle = stream; - retval = barcode2_init(barcode2, &cfg); - return BARCODE2_OK == retval ? SL_STATUS_OK : SL_STATUS_FAIL; + barcode2->uart.handle = uart_handle; + if (barcode2_init(barcode2, &cfg) != BARCODE2_OK) { + return SL_STATUS_INITIALIZATION; + } + return SL_STATUS_OK; } sl_status_t mikroe_barcode2_generic_write(mikroe_barcode2_t *barcode2, diff --git a/driver/public/mikroe/brushless16_lb11685av/config/brd2703a/mikroe_lb11685av_config.h b/driver/public/mikroe/brushless16_lb11685av/config/brd2703a/mikroe_lb11685av_config.h index efd63e7b..eadd9433 100644 --- a/driver/public/mikroe/brushless16_lb11685av/config/brd2703a/mikroe_lb11685av_config.h +++ b/driver/public/mikroe/brushless16_lb11685av/config/brd2703a/mikroe_lb11685av_config.h @@ -39,29 +39,31 @@ #ifndef MIKROE_LB11685AV_CONFIG_H_ #define MIKROE_LB11685AV_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< sl:start pin_tool >>> -// BRUSHLESS_16_RD -// $[GPIO_BRUSHLESS_16_RD] -#define BRUSHLESS_16_RD_PORT gpioPortB -#define BRUSHLESS_16_RD_PIN 1 -// [GPIO_BRUSHLESS_16_RD]$ +// BRUSHLESS16_RD +// $[GPIO_BRUSHLESS16_RD] +#define BRUSHLESS16_RD_PORT gpioPortB +#define BRUSHLESS16_RD_PIN 1 +// [GPIO_BRUSHLESS16_RD]$ -// BRUSHLESS_16_FG -// $[GPIO_BRUSHLESS_16_FG] -#define BRUSHLESS_16_FG_PORT gpioPortA -#define BRUSHLESS_16_FG_PIN 0 -// [GPIO_BRUSHLESS_16_FG]$ +// BRUSHLESS16_FG +// $[GPIO_BRUSHLESS16_FG] +#define BRUSHLESS16_FG_PORT gpioPortA +#define BRUSHLESS16_FG_PIN 0 +// [GPIO_BRUSHLESS16_FG]$ -// BRUSHLESS_16_EN -// $[GPIO_BRUSHLESS_16_EN] -#define BRUSHLESS_16_EN_PORT gpioPortC -#define BRUSHLESS_16_EN_PIN 0 -// [GPIO_BRUSHLESS_16_EN]$ +// BRUSHLESS16_EN +// $[GPIO_BRUSHLESS16_EN] +#define BRUSHLESS16_EN_PORT gpioPortC +#define BRUSHLESS16_EN_PIN 0 +// [GPIO_BRUSHLESS16_EN]$ // <<< sl:end pin_tool >>> @@ -69,4 +71,4 @@ extern "C" { } #endif -#endif /* MIKROE_LB11685AV_CONFIG_H_ */ +#endif // MIKROE_LB11685AV_CONFIG_H_ diff --git a/driver/public/mikroe/brushless16_lb11685av/config/brd4108a/mikroe_lb11685av_config.h b/driver/public/mikroe/brushless16_lb11685av/config/brd4108a/mikroe_lb11685av_config.h index a9bd367f..0c2af4ca 100644 --- a/driver/public/mikroe/brushless16_lb11685av/config/brd4108a/mikroe_lb11685av_config.h +++ b/driver/public/mikroe/brushless16_lb11685av/config/brd4108a/mikroe_lb11685av_config.h @@ -39,29 +39,31 @@ #ifndef MIKROE_LB11685AV_CONFIG_H_ #define MIKROE_LB11685AV_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< sl:start pin_tool >>> -// BRUSHLESS_16_RD -// $[GPIO_BRUSHLESS_16_RD] -#define BRUSHLESS_16_RD_PORT gpioPortB -#define BRUSHLESS_16_RD_PIN 3 -// [GPIO_BRUSHLESS_16_RD]$ +// BRUSHLESS16_RD +// $[GPIO_BRUSHLESS16_RD] +#define BRUSHLESS16_RD_PORT gpioPortB +#define BRUSHLESS16_RD_PIN 3 +// [GPIO_BRUSHLESS16_RD]$ -// BRUSHLESS_16_FG -// $[GPIO_BRUSHLESS_16_FG] -#define BRUSHLESS_16_FG_PORT gpioPortB -#define BRUSHLESS_16_FG_PIN 4 -// [GPIO_BRUSHLESS_16_FG]$ +// BRUSHLESS16_FG +// $[GPIO_BRUSHLESS16_FG] +#define BRUSHLESS16_FG_PORT gpioPortB +#define BRUSHLESS16_FG_PIN 4 +// [GPIO_BRUSHLESS16_FG]$ -// BRUSHLESS_16_EN -// $[GPIO_BRUSHLESS_16_EN] -#define BRUSHLESS_16_EN_PORT gpioPortC -#define BRUSHLESS_16_EN_PIN 3 -// [GPIO_BRUSHLESS_16_EN]$ +// BRUSHLESS16_EN +// $[GPIO_BRUSHLESS16_EN] +#define BRUSHLESS16_EN_PORT gpioPortC +#define BRUSHLESS16_EN_PIN 3 +// [GPIO_BRUSHLESS16_EN]$ // <<< sl:end pin_tool >>> @@ -69,4 +71,4 @@ extern "C" { } #endif -#endif /* MIKROE_LB11685AV_CONFIG_H_ */ +#endif // MIKROE_LB11685AV_CONFIG_H_ diff --git a/driver/public/mikroe/brushless16_lb11685av/config/brd4314a/mikroe_lb11685av_config.h b/driver/public/mikroe/brushless16_lb11685av/config/brd4314a/mikroe_lb11685av_config.h index a9bd367f..0c2af4ca 100644 --- a/driver/public/mikroe/brushless16_lb11685av/config/brd4314a/mikroe_lb11685av_config.h +++ b/driver/public/mikroe/brushless16_lb11685av/config/brd4314a/mikroe_lb11685av_config.h @@ -39,29 +39,31 @@ #ifndef MIKROE_LB11685AV_CONFIG_H_ #define MIKROE_LB11685AV_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< sl:start pin_tool >>> -// BRUSHLESS_16_RD -// $[GPIO_BRUSHLESS_16_RD] -#define BRUSHLESS_16_RD_PORT gpioPortB -#define BRUSHLESS_16_RD_PIN 3 -// [GPIO_BRUSHLESS_16_RD]$ +// BRUSHLESS16_RD +// $[GPIO_BRUSHLESS16_RD] +#define BRUSHLESS16_RD_PORT gpioPortB +#define BRUSHLESS16_RD_PIN 3 +// [GPIO_BRUSHLESS16_RD]$ -// BRUSHLESS_16_FG -// $[GPIO_BRUSHLESS_16_FG] -#define BRUSHLESS_16_FG_PORT gpioPortB -#define BRUSHLESS_16_FG_PIN 4 -// [GPIO_BRUSHLESS_16_FG]$ +// BRUSHLESS16_FG +// $[GPIO_BRUSHLESS16_FG] +#define BRUSHLESS16_FG_PORT gpioPortB +#define BRUSHLESS16_FG_PIN 4 +// [GPIO_BRUSHLESS16_FG]$ -// BRUSHLESS_16_EN -// $[GPIO_BRUSHLESS_16_EN] -#define BRUSHLESS_16_EN_PORT gpioPortC -#define BRUSHLESS_16_EN_PIN 3 -// [GPIO_BRUSHLESS_16_EN]$ +// BRUSHLESS16_EN +// $[GPIO_BRUSHLESS16_EN] +#define BRUSHLESS16_EN_PORT gpioPortC +#define BRUSHLESS16_EN_PIN 3 +// [GPIO_BRUSHLESS16_EN]$ // <<< sl:end pin_tool >>> @@ -69,4 +71,4 @@ extern "C" { } #endif -#endif /* MIKROE_LB11685AV_CONFIG_H_ */ +#endif // MIKROE_LB11685AV_CONFIG_H_ diff --git a/driver/public/mikroe/brushless16_lb11685av/config/brd4338a/mikroe_lb11685av_config.h b/driver/public/mikroe/brushless16_lb11685av/config/brd4338a/mikroe_lb11685av_config.h new file mode 100644 index 00000000..f2c7190a --- /dev/null +++ b/driver/public/mikroe/brushless16_lb11685av/config/brd4338a/mikroe_lb11685av_config.h @@ -0,0 +1,72 @@ +/***************************************************************************//** + * @file mikroe_lb11685av_config.h + * @brief SCL LB11685AV config file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_LB11685AV_CONFIG_H_ +#define MIKROE_LB11685AV_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< sl:start pin_tool >>> + +// BRUSHLESS16_RD +// $[GPIO_BRUSHLESS16_RD] +#define BRUSHLESS16_RD_PORT HP +#define BRUSHLESS16_RD_PIN 46 +// [GPIO_BRUSHLESS16_RD]$ + +// BRUSHLESS16_FG +// $[GPIO_BRUSHLESS16_FG] +#define BRUSHLESS16_FG_PORT HP +#define BRUSHLESS16_FG_PIN 47 +// [GPIO_BRUSHLESS16_FG]$ + +// BRUSHLESS16_EN +// $[GPIO_BRUSHLESS16_EN] +#define BRUSHLESS16_EN_PORT HP +#define BRUSHLESS16_EN_PIN 48 +// [GPIO_BRUSHLESS16_EN]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_LB11685AV_CONFIG_H_ diff --git a/driver/public/mikroe/brushless16_lb11685av/config/other/mikroe_lb11685av_config.h b/driver/public/mikroe/brushless16_lb11685av/config/other/mikroe_lb11685av_config.h index 4513e5d6..6c037ad5 100644 --- a/driver/public/mikroe/brushless16_lb11685av/config/other/mikroe_lb11685av_config.h +++ b/driver/public/mikroe/brushless16_lb11685av/config/other/mikroe_lb11685av_config.h @@ -39,32 +39,36 @@ #ifndef MIKROE_LB11685AV_CONFIG_H_ #define MIKROE_LB11685AV_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif // <<< sl:start pin_tool >>> -// BRUSHLESS_16_RD -// $[GPIO_BRUSHLESS_16_RD] +// BRUSHLESS16_RD +// $[GPIO_BRUSHLESS16_RD] #warning "RD pin for BRUSHLESS 16 is not configured" -// #define BRUSHLESS_16_RD_PORT gpioPortB -// #define BRUSHLESS_16_RD_PIN 3 -// [GPIO_BRUSHLESS_16_RD]$ +// #define BRUSHLESS16_RD_PORT 0 +// #define BRUSHLESS16_RD_PIN 0 +// [GPIO_BRUSHLESS16_RD]$ -// BRUSHLESS_16_FG -// $[GPIO_BRUSHLESS_16_FG] +// BRUSHLESS16_FG +// $[GPIO_BRUSHLESS16_FG] #warning "FG pin for BRUSHLESS 16 is not configured" -// #define BRUSHLESS_16_FG_PORT gpioPortB -// #define BRUSHLESS_16_FG_PIN 4 -// [GPIO_BRUSHLESS_16_FG]$ +// #define BRUSHLESS16_FG_PORT 0 +// #define BRUSHLESS16_FG_PIN 0 +// [GPIO_BRUSHLESS16_FG]$ -// BRUSHLESS_16_EN -// $[GPIO_BRUSHLESS_16_EN] +// BRUSHLESS16_EN +// $[GPIO_BRUSHLESS16_EN] #warning "EN pin for BRUSHLESS 16 is not configured" -// #define BRUSHLESS_16_EN_PORT gpioPortC -// #define BRUSHLESS_16_EN_PIN 3 -// [GPIO_BRUSHLESS_16_EN]$ +// #define BRUSHLESS16_EN_PORT 0 +// #define BRUSHLESS16_EN_PIN 0 +// [GPIO_BRUSHLESS16_EN]$ // <<< sl:end pin_tool >>> @@ -72,4 +76,4 @@ extern "C" { } #endif -#endif /* MIKROE_LB11685AV_CONFIG_H_ */ +#endif // MIKROE_LB11685AV_CONFIG_H_ diff --git a/driver/public/mikroe/brushless16_lb11685av/inc/mikroe_lb11685av.h b/driver/public/mikroe/brushless16_lb11685av/inc/mikroe_lb11685av.h index 0c2eadae..da7a6c92 100644 --- a/driver/public/mikroe/brushless16_lb11685av/inc/mikroe_lb11685av.h +++ b/driver/public/mikroe/brushless16_lb11685av/inc/mikroe_lb11685av.h @@ -41,6 +41,10 @@ #include "sl_status.h" +#ifdef __cplusplus +extern "C" { +#endif + /***************************************************************************//** * @addtogroup mikroe_lb11685 LB11685AV - BRUSHLESS 16 Click * @brief @@ -107,4 +111,8 @@ uint8_t mikroe_lb11685av_get_fg(void); /** @} (end addtogroup mikroe_lb11685) */ -#endif /* MIKROE_LB11685AV_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_LB11685AV_H_ diff --git a/driver/public/mikroe/brushless16_lb11685av/src/mikroe_lb11685av.c b/driver/public/mikroe/brushless16_lb11685av/src/mikroe_lb11685av.c index f320f2dd..f57ac5c6 100644 --- a/driver/public/mikroe/brushless16_lb11685av/src/mikroe_lb11685av.c +++ b/driver/public/mikroe/brushless16_lb11685av/src/mikroe_lb11685av.c @@ -37,8 +37,6 @@ * ******************************************************************************/ -#include "em_gpio.h" -#include "third_party_hw_drivers_helpers.h" #include "mikroe_lb11685av_config.h" #include "mikroe_lb11685av.h" #include "brushless16.h" @@ -51,29 +49,28 @@ static brushless16_cfg_t brushless16_cfg; ******************************************************************************/ sl_status_t mikroe_lb11685av_init(void) { - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - brushless16_cfg_setup(&brushless16_cfg); -#if defined(BRUSHLESS_16_EN_PORT) && defined(BRUSHLESS_16_EN_PIN) - brushless16_cfg.en = hal_gpio_pin_name(BRUSHLESS_16_EN_PORT, - BRUSHLESS_16_EN_PIN); +#if defined(BRUSHLESS16_EN_PORT) && defined(BRUSHLESS16_EN_PIN) + brushless16_cfg.en = hal_gpio_pin_name(BRUSHLESS16_EN_PORT, + BRUSHLESS16_EN_PIN); #endif -#if defined(BRUSHLESS_16_FG_PORT) && defined(BRUSHLESS_16_FG_PIN) - brushless16_cfg.fg = hal_gpio_pin_name(BRUSHLESS_16_FG_PORT, - BRUSHLESS_16_FG_PIN); +#if defined(BRUSHLESS16_FG_PORT) && defined(BRUSHLESS16_FG_PIN) + brushless16_cfg.fg = hal_gpio_pin_name(BRUSHLESS16_FG_PORT, + BRUSHLESS16_FG_PIN); #endif -#if defined(BRUSHLESS_16_RD_PORT) && defined(BRUSHLESS_16_RD_PIN) - brushless16_cfg.rd = hal_gpio_pin_name(BRUSHLESS_16_RD_PORT, - BRUSHLESS_16_RD_PIN); +#if defined(BRUSHLESS16_RD_PORT) && defined(BRUSHLESS16_RD_PIN) + brushless16_cfg.rd = hal_gpio_pin_name(BRUSHLESS16_RD_PORT, + BRUSHLESS16_RD_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(brushless16_init(&brushless16, - &brushless16_cfg)); + if (brushless16_init(&brushless16, &brushless16_cfg) != BRUSHLESS16_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } /**************************************************************************//** diff --git a/driver/public/mikroe/captouch2_cap1166/config/brd2703a/mikroe_cap1166_config.h b/driver/public/mikroe/captouch2_cap1166/config/brd2703a/mikroe_cap1166_config.h index bc9741d9..e6be6ed9 100644 --- a/driver/public/mikroe/captouch2_cap1166/config/brd2703a/mikroe_cap1166_config.h +++ b/driver/public/mikroe/captouch2_cap1166/config/brd2703a/mikroe_cap1166_config.h @@ -40,12 +40,38 @@ #ifndef SCL_CAP1166_CONFIG_H_ #define SCL_CAP1166_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE CAP1166 SPI Configuration + +// MIKROE CAP1166 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_CAP1166_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_CAP1166_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// CAP1166_CS +// $[GPIO_CAP1166_CS] +// #define CAP1166_CS_PORT 0 +// #define CAP1166_CS_PIN 0 +// [GPIO_CAP1166_CS]$ + // CAP1166_RESET // $[GPIO_CAP1166_RESET] #define CAP1166_RESET_PORT gpioPortC @@ -64,4 +90,4 @@ extern "C" { } #endif -#endif /* SCL_CAP1166_CONFIG_H_ */ +#endif // SCL_CAP1166_CONFIG_H_ diff --git a/driver/public/mikroe/captouch2_cap1166/config/brd4108a/mikroe_cap1166_config.h b/driver/public/mikroe/captouch2_cap1166/config/brd4108a/mikroe_cap1166_config.h index 811f4cba..8e68e662 100644 --- a/driver/public/mikroe/captouch2_cap1166/config/brd4108a/mikroe_cap1166_config.h +++ b/driver/public/mikroe/captouch2_cap1166/config/brd4108a/mikroe_cap1166_config.h @@ -40,12 +40,38 @@ #ifndef SCL_CAP1166_CONFIG_H_ #define SCL_CAP1166_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE CAP1166 SPI Configuration + +// MIKROE CAP1166 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_CAP1166_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_CAP1166_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// CAP1166_CS +// $[GPIO_CAP1166_CS] +// #define CAP1166_CS_PORT 0 +// #define CAP1166_CS_PIN 0 +// [GPIO_CAP1166_CS]$ + // CAP1166_RESET // $[GPIO_CAP1166_RESET] #define CAP1166_RESET_PORT gpioPortC @@ -64,4 +90,4 @@ extern "C" { } #endif -#endif /* SCL_CAP1166_CONFIG_H_ */ +#endif // SCL_CAP1166_CONFIG_H_ diff --git a/driver/public/mikroe/captouch2_cap1166/config/brd4314a/mikroe_cap1166_config.h b/driver/public/mikroe/captouch2_cap1166/config/brd4314a/mikroe_cap1166_config.h index 811f4cba..8e68e662 100644 --- a/driver/public/mikroe/captouch2_cap1166/config/brd4314a/mikroe_cap1166_config.h +++ b/driver/public/mikroe/captouch2_cap1166/config/brd4314a/mikroe_cap1166_config.h @@ -40,12 +40,38 @@ #ifndef SCL_CAP1166_CONFIG_H_ #define SCL_CAP1166_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE CAP1166 SPI Configuration + +// MIKROE CAP1166 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_CAP1166_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_CAP1166_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// CAP1166_CS +// $[GPIO_CAP1166_CS] +// #define CAP1166_CS_PORT 0 +// #define CAP1166_CS_PIN 0 +// [GPIO_CAP1166_CS]$ + // CAP1166_RESET // $[GPIO_CAP1166_RESET] #define CAP1166_RESET_PORT gpioPortC @@ -64,4 +90,4 @@ extern "C" { } #endif -#endif /* SCL_CAP1166_CONFIG_H_ */ +#endif // SCL_CAP1166_CONFIG_H_ diff --git a/driver/public/mikroe/captouch2_cap1166/config/brd4338a/mikroe_cap1166_config.h b/driver/public/mikroe/captouch2_cap1166/config/brd4338a/mikroe_cap1166_config.h new file mode 100644 index 00000000..82879673 --- /dev/null +++ b/driver/public/mikroe/captouch2_cap1166/config/brd4338a/mikroe_cap1166_config.h @@ -0,0 +1,91 @@ +/***************************************************************************//** + * @file mikroe_cap1166_config.h + * @brief SCL CAP1166 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SCL_CAP1166_CONFIG_H_ +#define SCL_CAP1166_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE CAP1166 SPI Configuration + +// MIKROE CAP1166 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_CAP1166_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_CAP1166_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// CAP1166_CS +// $[GPIO_CAP1166_CS] +// #define CAP1166_CS_PORT 0 +// #define CAP1166_CS_PIN 0 +// [GPIO_CAP1166_CS]$ + +// CAP1166_RESET +// $[GPIO_CAP1166_RESET] +#define CAP1166_RESET_PORT HP +#define CAP1166_RESET_PIN 47 +// [GPIO_CAP1166_RESET]$ + +// CAP1166_ALERT +// $[GPIO_CAP1166_ALERT] +#define CAP1166_ALERT_PORT HP +#define CAP1166_ALERT_PIN 46 +// [GPIO_CAP1166_ALERT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // SCL_CAP1166_CONFIG_H_ diff --git a/driver/public/mikroe/captouch2_cap1166/config/other/mikroe_cap1166_config.h b/driver/public/mikroe/captouch2_cap1166/config/other/mikroe_cap1166_config.h index 7873f449..79ce45ff 100644 --- a/driver/public/mikroe/captouch2_cap1166/config/other/mikroe_cap1166_config.h +++ b/driver/public/mikroe/captouch2_cap1166/config/other/mikroe_cap1166_config.h @@ -40,12 +40,40 @@ #ifndef SCL_CAP1166_CONFIG_H_ #define SCL_CAP1166_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE CAP1166 SPI Configuration + +// MIKROE CAP1166 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_CAP1166_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_CAP1166_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// CAP1166_CS +// $[GPIO_CAP1166_CS] +// #define CAP1166_CS_PORT 0 +// #define CAP1166_CS_PIN 0 +// [GPIO_CAP1166_CS]$ + // CAP1166_RESET // $[GPIO_CAP1166_RESET] #warning "Reset pin for CAP1166 is not configured" @@ -66,4 +94,4 @@ extern "C" { } #endif -#endif /* SCL_CAP1166_CONFIG_H_ */ +#endif // SCL_CAP1166_CONFIG_H_ diff --git a/driver/public/mikroe/captouch2_cap1166/inc/mikroe_cap1166.h b/driver/public/mikroe/captouch2_cap1166/inc/mikroe_cap1166.h index 0ab77129..5d3cce59 100644 --- a/driver/public/mikroe/captouch2_cap1166/inc/mikroe_cap1166.h +++ b/driver/public/mikroe/captouch2_cap1166/inc/mikroe_cap1166.h @@ -41,7 +41,7 @@ #define MIKROE_CAP1166_H_ #include "sl_status.h" -#include "spidrv.h" +#include "captouch2.h" #ifdef __cplusplus extern "C" { @@ -191,7 +191,7 @@ void mikroe_cap1166_default_cfg(void); * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if error spi communication. ******************************************************************************/ -sl_status_t mikroe_cap1166_init(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_cap1166_init(mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief @@ -204,7 +204,7 @@ sl_status_t mikroe_cap1166_init(SPIDRV_Handle_t spi_instance); * SL_STATUS_OK if there are no errors * SL_STATUS_INVALID_PARAMETER if spi_instance is null ******************************************************************************/ -sl_status_t mikroe_cap1166_set_spi_instance(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_cap1166_set_spi_instance(mikroe_spi_handle_t spi_instance); /** * @brief Generic Read function diff --git a/driver/public/mikroe/captouch2_cap1166/src/mikroe_cap1166.c b/driver/public/mikroe/captouch2_cap1166/src/mikroe_cap1166.c index f0b300ff..9917bfd1 100644 --- a/driver/public/mikroe/captouch2_cap1166/src/mikroe_cap1166.c +++ b/driver/public/mikroe/captouch2_cap1166/src/mikroe_cap1166.c @@ -37,12 +37,8 @@ * ******************************************************************************/ -#include "captouch2.h" #include "mikroe_cap1166.h" #include "mikroe_cap1166_config.h" -#include "third_party_hw_drivers_helpers.h" -#include "drv_digital_out.h" -#include "drv_digital_in.h" static captouch2_t captouch2; static captouch2_cfg_t captouch2_cfg; @@ -52,14 +48,12 @@ void mikroe_cap1166_default_cfg(void) captouch2_default_cfg(&captouch2); } -sl_status_t mikroe_cap1166_init(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_cap1166_init(mikroe_spi_handle_t spi_instance) { if (NULL == spi_instance) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - // Configure default spi instance captouch2.spi.handle = spi_instance; @@ -74,12 +68,22 @@ sl_status_t mikroe_cap1166_init(SPIDRV_Handle_t spi_instance) captouch2_cfg.alt = hal_gpio_pin_name(CAP1166_ALERT_PORT, CAP1166_ALERT_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(captouch2_init(&captouch2, &captouch2_cfg)); +#if defined(CAP1166_CS_PORT) && defined(CAP1166_CS_PIN) + captouch2_cfg.cs = hal_gpio_pin_name(CAP1166_CS_PORT, CAP1166_CS_PIN); +#endif + +#if (MIKROE_CAP1166_SPI_UC == 1) + captouch2_cfg.spi_speed = MIKROE_CAP1166_SPI_BITRATE; +#endif - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + if (captouch2_init(&captouch2, &captouch2_cfg) != CAPTOUCH2_OK) { + return SL_STATUS_INITIALIZATION; + } + + return SL_STATUS_OK; } -sl_status_t mikroe_cap1166_set_spi_instance(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_cap1166_set_spi_instance(mikroe_spi_handle_t spi_instance) { if (NULL == spi_instance) { return SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/co_mq7/config/brd2703a/mikroe_mq7_config.h b/driver/public/mikroe/co_mq7/config/brd2703a/mikroe_mq7_config.h index 4a16b5cf..31768642 100644 --- a/driver/public/mikroe/co_mq7/config/brd2703a/mikroe_mq7_config.h +++ b/driver/public/mikroe/co_mq7/config/brd2703a/mikroe_mq7_config.h @@ -40,6 +40,8 @@ #ifndef MIKROE_MQ7_CONFIG_H_ #define MIKROE_MQ7_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { diff --git a/driver/public/mikroe/co_mq7/config/brd4108a/mikroe_mq7_config.h b/driver/public/mikroe/co_mq7/config/brd4108a/mikroe_mq7_config.h index 4a16b5cf..31768642 100644 --- a/driver/public/mikroe/co_mq7/config/brd4108a/mikroe_mq7_config.h +++ b/driver/public/mikroe/co_mq7/config/brd4108a/mikroe_mq7_config.h @@ -40,6 +40,8 @@ #ifndef MIKROE_MQ7_CONFIG_H_ #define MIKROE_MQ7_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { diff --git a/driver/public/mikroe/co_mq7/config/brd4314a/mikroe_mq7_config.h b/driver/public/mikroe/co_mq7/config/brd4314a/mikroe_mq7_config.h index 4a16b5cf..31768642 100644 --- a/driver/public/mikroe/co_mq7/config/brd4314a/mikroe_mq7_config.h +++ b/driver/public/mikroe/co_mq7/config/brd4314a/mikroe_mq7_config.h @@ -40,6 +40,8 @@ #ifndef MIKROE_MQ7_CONFIG_H_ #define MIKROE_MQ7_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { diff --git a/driver/public/mikroe/co_mq7/config/brd4338a/mikroe_mq7_config.h b/driver/public/mikroe/co_mq7/config/brd4338a/mikroe_mq7_config.h new file mode 100644 index 00000000..6faa1dd7 --- /dev/null +++ b/driver/public/mikroe/co_mq7/config/brd4338a/mikroe_mq7_config.h @@ -0,0 +1,43 @@ +/***************************************************************************//** + * @file mikroe_mq7_config.h + * @brief SCL MQ7 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_MQ7_CONFIG_H_ +#define MIKROE_MQ7_CONFIG_H_ + +#endif /* MIKROE_MQ7_CONFIG_H_ */ diff --git a/driver/public/mikroe/co_mq7/inc/mikroe_mq7.h b/driver/public/mikroe/co_mq7/inc/mikroe_mq7.h index 695b6196..c0cdbd55 100644 --- a/driver/public/mikroe/co_mq7/inc/mikroe_mq7.h +++ b/driver/public/mikroe/co_mq7/inc/mikroe_mq7.h @@ -40,13 +40,22 @@ #ifndef MIKROE_MQ7_H_ #define MIKROE_MQ7_H_ -sl_status_t mikroe_mq7_init(IADC_TypeDef *adc_instance); +#include "drv_analog_in.h" -sl_status_t mikroe_mq7_set_adc_instance( - IADC_TypeDef *adc_instance); +#ifdef __cplusplus +extern "C" { +#endif + +sl_status_t mikroe_mq7_init(mikroe_adc_handle_t handle); + +sl_status_t mikroe_mq7_set_adc_instance(mikroe_adc_handle_t handle); sl_status_t mikroe_mq7_read_an_pin_value(uint16_t *data_out); sl_status_t mikroe_mq7_read_an_pin_voltage(float *data_out); -#endif /* MIKROE_MQ7_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_MQ7_H_ diff --git a/driver/public/mikroe/co_mq7/src/mikroe_mq7.c b/driver/public/mikroe/co_mq7/src/mikroe_mq7.c index 3f9c6f26..73d70cce 100644 --- a/driver/public/mikroe/co_mq7/src/mikroe_mq7.c +++ b/driver/public/mikroe/co_mq7/src/mikroe_mq7.c @@ -38,55 +38,51 @@ ******************************************************************************/ #include -#include "em_device.h" #include "sl_status.h" -#include "third_party_hw_drivers_helpers.h" #include "co.h" #include "mikroe_mq7_config.h" -#if defined(_SILICON_LABS_32B_SERIES_1) -#include "em_adc.h" -#elif defined(_SILICON_LABS_32B_SERIES_2) -#include "em_iadc.h" -#endif - static co_t co; static co_cfg_t co_cfg; -sl_status_t mikroe_mq7_init(IADC_TypeDef *adc_instance) +sl_status_t mikroe_mq7_init(mikroe_adc_handle_t handle) { - if (NULL == adc_instance) { + if (NULL == handle) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - // Configure default i2csmp instance - co.adc.handle = adc_instance; - + co.adc.handle = handle; // Call basic setup functions co_cfg_setup(&co_cfg); - co_cfg.an = hal_gpio_pin_name(MQ7_AN_PORT, MQ7_AN_PIN); - THIRD_PARTY_HW_DRV_RETCODE_TEST(co_init(&co, &co_cfg)); +#if defined(MQ7_AN_PORT) && defined(MQ7_AN_PIN) + co_cfg.an = hal_gpio_pin_name(MQ7_AN_PORT, MQ7_AN_PIN); +#endif - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + if (co_init(&co, &co_cfg) != CO_OK) { + return SL_STATUS_INITIALIZATION; + } + return SL_STATUS_OK; } -sl_status_t mikroe_mq7_set_adc_instance( - IADC_TypeDef *adc_instance) +sl_status_t mikroe_mq7_set_adc_instance(mikroe_adc_handle_t handle) { - if (NULL == adc_instance) { + if (NULL == handle) { return SL_STATUS_INVALID_PARAMETER; } - co.adc.handle = adc_instance; + co.adc.handle = handle; return SL_STATUS_OK; } sl_status_t mikroe_mq7_read_an_pin_value(uint16_t *data_out) { + if (NULL == data_out) { + return SL_STATUS_INVALID_PARAMETER; + } + if (co_read_an_pin_value(&co, data_out) != ADC_SUCCESS) { return SL_STATUS_FAIL; } @@ -96,6 +92,10 @@ sl_status_t mikroe_mq7_read_an_pin_value(uint16_t *data_out) sl_status_t mikroe_mq7_read_an_pin_voltage(float *data_out) { + if (NULL == data_out) { + return SL_STATUS_INVALID_PARAMETER; + } + if (co_read_an_pin_voltage(&co, data_out) != ADC_SUCCESS) { return SL_STATUS_FAIL; } diff --git a/driver/public/mikroe/dcmotor24_l9958/config/brd2703a/mikroe_l9958_config.h b/driver/public/mikroe/dcmotor24_l9958/config/brd2703a/mikroe_l9958_config.h index 4f558139..9a6696a0 100644 --- a/driver/public/mikroe/dcmotor24_l9958/config/brd2703a/mikroe_l9958_config.h +++ b/driver/public/mikroe/dcmotor24_l9958/config/brd2703a/mikroe_l9958_config.h @@ -42,8 +42,32 @@ #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE L9958 SPI Configuration + +// MIKROE L9958 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_L9958_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_L9958_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// DCMOTOR24_CS +// $[GPIO_DCMOTOR24_CS] +// #define DCMOTOR24_CS_PORT 0 +// #define DCMOTOR24_CS_PIN 0 +// [GPIO_DCMOTOR24_CS]$ + // DCMOTOR24_DIRECTION // $[GPIO_DCMOTOR24_DIRECTION] #define DCMOTOR24_DIRECTION_PORT gpioPortB diff --git a/driver/public/mikroe/dcmotor24_l9958/config/brd4108a/mikroe_l9958_config.h b/driver/public/mikroe/dcmotor24_l9958/config/brd4108a/mikroe_l9958_config.h index 2a3b0b3c..e88b7a71 100644 --- a/driver/public/mikroe/dcmotor24_l9958/config/brd4108a/mikroe_l9958_config.h +++ b/driver/public/mikroe/dcmotor24_l9958/config/brd4108a/mikroe_l9958_config.h @@ -42,8 +42,32 @@ #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE L9958 SPI Configuration + +// MIKROE L9958 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_L9958_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_L9958_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// DCMOTOR24_CS +// $[GPIO_DCMOTOR24_CS] +// #define DCMOTOR24_CS_PORT 0 +// #define DCMOTOR24_CS_PIN 0 +// [GPIO_DCMOTOR24_CS]$ + // DCMOTOR24_DIRECTION // $[GPIO_DCMOTOR24_DIRECTION] #define DCMOTOR24_DIRECTION_PORT gpioPortB diff --git a/driver/public/mikroe/dcmotor24_l9958/config/brd4314a/mikroe_l9958_config.h b/driver/public/mikroe/dcmotor24_l9958/config/brd4314a/mikroe_l9958_config.h index 2a3b0b3c..e88b7a71 100644 --- a/driver/public/mikroe/dcmotor24_l9958/config/brd4314a/mikroe_l9958_config.h +++ b/driver/public/mikroe/dcmotor24_l9958/config/brd4314a/mikroe_l9958_config.h @@ -42,8 +42,32 @@ #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE L9958 SPI Configuration + +// MIKROE L9958 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_L9958_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_L9958_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// DCMOTOR24_CS +// $[GPIO_DCMOTOR24_CS] +// #define DCMOTOR24_CS_PORT 0 +// #define DCMOTOR24_CS_PIN 0 +// [GPIO_DCMOTOR24_CS]$ + // DCMOTOR24_DIRECTION // $[GPIO_DCMOTOR24_DIRECTION] #define DCMOTOR24_DIRECTION_PORT gpioPortB diff --git a/driver/public/mikroe/dcmotor24_l9958/config/brd4338a/mikroe_l9958_config.h b/driver/public/mikroe/dcmotor24_l9958/config/brd4338a/mikroe_l9958_config.h new file mode 100644 index 00000000..95ee1720 --- /dev/null +++ b/driver/public/mikroe/dcmotor24_l9958/config/brd4338a/mikroe_l9958_config.h @@ -0,0 +1,83 @@ +/***************************************************************************//** + * @file mikroe_l9958_config.h + * @brief SCL L9958 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_L9958_CONFIG_H_ +#define MIKROE_L9958_CONFIG_H_ + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE L9958 SPI Configuration + +// MIKROE L9958 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_L9958_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_L9958_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DCMOTOR24_CS +// $[GPIO_DCMOTOR24_CS] +// #define DCMOTOR24_CS_PORT 0 +// #define DCMOTOR24_CS_PIN 0 +// [GPIO_DCMOTOR24_CS]$ + +// DCMOTOR24_DIRECTION +// $[GPIO_DCMOTOR24_DIRECTION] +#define DCMOTOR24_DIRECTION_PORT HP +#define DCMOTOR24_DIRECTION_PIN 48 +// [GPIO_DCMOTOR24_DIRECTION]$ + +// DCMOTOR24_ENABLE +// $[GPIO_DCMOTOR24_ENABLE] +#define DCMOTOR24_ENABLE_PORT HP +#define DCMOTOR24_ENABLE_PIN 46 +// [GPIO_DCMOTOR24_ENABLE]$ + +// <<< sl:end pin_tool >>> + +#endif /* MIKROE_L9958_CONFIG_H_ */ diff --git a/driver/public/mikroe/dcmotor24_l9958/config/other/mikroe_l9958_config.h b/driver/public/mikroe/dcmotor24_l9958/config/other/mikroe_l9958_config.h index d13f2487..575fc3d2 100644 --- a/driver/public/mikroe/dcmotor24_l9958/config/other/mikroe_l9958_config.h +++ b/driver/public/mikroe/dcmotor24_l9958/config/other/mikroe_l9958_config.h @@ -40,10 +40,36 @@ #ifndef MIKROE_L9958_CONFIG_H_ #define MIKROE_L9958_CONFIG_H_ +#ifndef SLI_SI917 #include "em_gpio.h" +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE L9958 SPI Configuration + +// MIKROE L9958 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_L9958_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_L9958_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> // <<< sl:start pin_tool >>> +// DCMOTOR24_CS +// $[GPIO_DCMOTOR24_CS] +// #define DCMOTOR24_CS_PORT 0 +// #define DCMOTOR24_CS_PIN 0 +// [GPIO_DCMOTOR24_CS]$ + // DCMOTOR24_DIRECTION // $[GPIO_DCMOTOR24_DIRECTION] #warning "GPIO_DCMOTOR24_DIRECTION is not configured" @@ -60,4 +86,4 @@ // <<< sl:end pin_tool >>> -#endif /* MIKROE_L9958_CONFIG_H_ */ +#endif // MIKROE_L9958_CONFIG_H_ diff --git a/driver/public/mikroe/dcmotor24_l9958/inc/mikroe_l9958.h b/driver/public/mikroe/dcmotor24_l9958/inc/mikroe_l9958.h index f1157660..b17f68ab 100644 --- a/driver/public/mikroe/dcmotor24_l9958/inc/mikroe_l9958.h +++ b/driver/public/mikroe/dcmotor24_l9958/inc/mikroe_l9958.h @@ -41,8 +41,8 @@ #define _MIKROE_L9958_H_ #include "sl_status.h" -#include "sl_pwm.h" -#include "spidrv.h" +#include "drv_pwm.h" +#include "drv_spi_master.h" #include "stdint.h" #ifdef __cplusplus @@ -122,8 +122,8 @@ extern "C" { * SL_STATUS_FAIL Initialization failed. * SL_STATUS_INVALID_PARAMETER if spi_instance is null. ******************************************************************************/ -sl_status_t mikroe_l9958_init (SPIDRV_Handle_t spi_instance, - sl_pwm_instance_t *pwm_instance); +sl_status_t mikroe_l9958_init (mikroe_spi_handle_t spi_instance, + mikroe_pwm_handle_t pwm_instance); /***************************************************************************//** * @brief DC Motor 24 default configuration function. diff --git a/driver/public/mikroe/dcmotor24_l9958/src/mikroe_l9958.c b/driver/public/mikroe/dcmotor24_l9958/src/mikroe_l9958.c index 118b033b..07f92b77 100644 --- a/driver/public/mikroe/dcmotor24_l9958/src/mikroe_l9958.c +++ b/driver/public/mikroe/dcmotor24_l9958/src/mikroe_l9958.c @@ -40,7 +40,6 @@ #include "dcmotor24.h" #include "mikroe_l9958.h" #include "mikroe_l9958_config.h" -#include "third_party_hw_drivers_helpers.h" static dcmotor24_t dcmotor; static dcmotor24_cfg_t dcmotor_cfg; @@ -49,21 +48,20 @@ static dcmotor24_cfg_t dcmotor_cfg; * @brief This function initializes all necessary pins and peripherals used * for this click board. ******************************************************************************/ -sl_status_t mikroe_l9958_init(SPIDRV_Handle_t spi_instance, - sl_pwm_instance_t *pwm_instance) +sl_status_t mikroe_l9958_init(mikroe_spi_handle_t spi_instance, + mikroe_pwm_handle_t pwm_instance) { if ((NULL == spi_instance) || (NULL == pwm_instance)) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - // Configure default spi instance dcmotor.spi.handle = spi_instance; dcmotor.pwm.handle = pwm_instance; // Call basic setup functions dcmotor24_cfg_setup(&dcmotor_cfg); + dcmotor_cfg.spi_mode = SPI_MASTER_MODE_0; #if defined(DCMOTOR24_ENABLE_PORT) && defined(DCMOTOR24_ENABLE_PIN) dcmotor_cfg.en = hal_gpio_pin_name(DCMOTOR24_ENABLE_PORT, @@ -75,9 +73,22 @@ sl_status_t mikroe_l9958_init(SPIDRV_Handle_t spi_instance, DCMOTOR24_DIRECTION_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(dcmotor24_init(&dcmotor, &dcmotor_cfg)); +#if defined(DCMOTOR24_CS_PORT) && defined(DCMOTOR24_CS_PIN) + dcmotor_cfg.cs = hal_gpio_pin_name(DCMOTOR24_CS_PORT, DCMOTOR24_CS_PIN); + // CS pin need to init here since the mikroe_sdk_v2 missed this step + digital_out_t struct_cs; + digital_out_init(&struct_cs, dcmotor_cfg.cs); +#endif + +#if (MIKROE_L9958_SPI_UC == 1) + dcmotor_cfg.spi_speed = MIKROE_L9958_SPI_BITRATE; +#endif + + if (dcmotor24_init(&dcmotor, &dcmotor_cfg) != SPI_MASTER_SUCCESS) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } /***************************************************************************//** diff --git a/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd2703a/mikroe_dcmotor26_config.h b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd2703a/mikroe_dcmotor26_config.h index f28865ed..4948d5f9 100644 --- a/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd2703a/mikroe_dcmotor26_config.h +++ b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd2703a/mikroe_dcmotor26_config.h @@ -44,8 +44,41 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE DCMOTOR26 SPI Configuration +// MIKROE DCMOTOR26 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DCMOTOR26_SPI_BITRATE 10000000 + +// +// + +// MIKROE DCMOTOR26 I2C Configuration +// MIKROE DCMOTOR26 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_SPEED_MODE 0 + +// +// + // I2C address // DCMOTOR26 PCA9538A ADDRESS // <0=> None @@ -54,7 +87,7 @@ extern "C" { // <0x72=> 0x72 // <0x73=> 0x73 // Default: 0x70 -#define DCMOTOR26_PCA9538A_ADDRESS 0x70 +#define DCMOTOR26_PCA9538A_ADDRESS 0x70 // @@ -62,6 +95,12 @@ extern "C" { // <<< sl:start pin_tool >>> +// DCMOTOR26_CS +// $[GPIO_DCMOTOR26_CS] +// #define DCMOTOR26_CS_PORT 0 +// #define DCMOTOR26_CS_PIN 0 +// [GPIO_DCMOTOR26_CS]$ + // DCMOTOR26_CHANNEL_MONITOR // $[GPIO_DCMOTOR26_CHANNEL_MONITOR] #define DCMOTOR26_CHANNEL_MONITOR_PORT gpioPortB @@ -92,4 +131,4 @@ extern "C" { } #endif -#endif /* MIKROE_DCMOTOR26_CONFIG_H_ */ +#endif // MIKROE_DCMOTOR26_CONFIG_H_ diff --git a/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4108a/mikroe_dcmotor26_config.h b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4108a/mikroe_dcmotor26_config.h index 71d98a6f..022c06e9 100644 --- a/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4108a/mikroe_dcmotor26_config.h +++ b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4108a/mikroe_dcmotor26_config.h @@ -44,8 +44,41 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE DCMOTOR26 SPI Configuration +// MIKROE DCMOTOR26 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DCMOTOR26_SPI_BITRATE 10000000 + +// +// + +// MIKROE DCMOTOR26 I2C Configuration +// MIKROE DCMOTOR26 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_SPEED_MODE 0 + +// +// + // I2C address // DCMOTOR26 PCA9538A ADDRESS // <0=> None @@ -54,7 +87,7 @@ extern "C" { // <0x72=> 0x72 // <0x73=> 0x73 // Default: 0x70 -#define DCMOTOR26_PCA9538A_ADDRESS 0x70 +#define DCMOTOR26_PCA9538A_ADDRESS 0x70 // @@ -62,6 +95,12 @@ extern "C" { // <<< sl:start pin_tool >>> +// DCMOTOR26_CS +// $[GPIO_DCMOTOR26_CS] +// #define DCMOTOR26_CS_PORT 0 +// #define DCMOTOR26_CS_PIN 0 +// [GPIO_DCMOTOR26_CS]$ + // DCMOTOR26_CHANNEL_MONITOR // $[GPIO_DCMOTOR26_CHANNEL_MONITOR] #define DCMOTOR26_CHANNEL_MONITOR_PORT gpioPortB @@ -92,4 +131,4 @@ extern "C" { } #endif -#endif /* MIKROE_DCMOTOR26_CONFIG_H_ */ +#endif // MIKROE_DCMOTOR26_CONFIG_H_ diff --git a/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4314a/mikroe_dcmotor26_config.h b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4314a/mikroe_dcmotor26_config.h index 71d98a6f..022c06e9 100644 --- a/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4314a/mikroe_dcmotor26_config.h +++ b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4314a/mikroe_dcmotor26_config.h @@ -44,8 +44,41 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE DCMOTOR26 SPI Configuration +// MIKROE DCMOTOR26 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DCMOTOR26_SPI_BITRATE 10000000 + +// +// + +// MIKROE DCMOTOR26 I2C Configuration +// MIKROE DCMOTOR26 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_SPEED_MODE 0 + +// +// + // I2C address // DCMOTOR26 PCA9538A ADDRESS // <0=> None @@ -54,7 +87,7 @@ extern "C" { // <0x72=> 0x72 // <0x73=> 0x73 // Default: 0x70 -#define DCMOTOR26_PCA9538A_ADDRESS 0x70 +#define DCMOTOR26_PCA9538A_ADDRESS 0x70 // @@ -62,6 +95,12 @@ extern "C" { // <<< sl:start pin_tool >>> +// DCMOTOR26_CS +// $[GPIO_DCMOTOR26_CS] +// #define DCMOTOR26_CS_PORT 0 +// #define DCMOTOR26_CS_PIN 0 +// [GPIO_DCMOTOR26_CS]$ + // DCMOTOR26_CHANNEL_MONITOR // $[GPIO_DCMOTOR26_CHANNEL_MONITOR] #define DCMOTOR26_CHANNEL_MONITOR_PORT gpioPortB @@ -92,4 +131,4 @@ extern "C" { } #endif -#endif /* MIKROE_DCMOTOR26_CONFIG_H_ */ +#endif // MIKROE_DCMOTOR26_CONFIG_H_ diff --git a/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4338a/mikroe_dcmotor26_config.h b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4338a/mikroe_dcmotor26_config.h new file mode 100644 index 00000000..2eae8be4 --- /dev/null +++ b/driver/public/mikroe/dcmotor26_tb9053ftg/config/brd4338a/mikroe_dcmotor26_config.h @@ -0,0 +1,126 @@ +/***************************************************************************//** + * @file mikroe_dcmotor26_config.h + * @brief Mikroe DC Motor 26 Click Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_DCMOTOR26_CONFIG_H_ +#define MIKROE_DCMOTOR26_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE DCMOTOR26 SPI Configuration +// MIKROE DCMOTOR26 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DCMOTOR26_SPI_BITRATE 10000000 + +// +// + +// MIKROE DCMOTOR26 I2C Configuration +// MIKROE DCMOTOR26 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_SPEED_MODE 0 + +// +// + +// I2C address +// DCMOTOR26 PCA9538A ADDRESS +// <0=> None +// <0x70=> 0x70 +// <0x71=> 0x71 +// <0x72=> 0x72 +// <0x73=> 0x73 +// Default: 0x70 +#define DCMOTOR26_PCA9538A_ADDRESS 0x70 + +// + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DCMOTOR26_CS +// $[GPIO_DCMOTOR26_CS] +#define DCMOTOR26_CS_PORT HP +#define DCMOTOR26_CS_PIN 49 +// [GPIO_DCMOTOR26_CS]$ + +// DCMOTOR26_SLEEP +// $[GPIO_DCMOTOR26_SLEEP] +#define DCMOTOR26_SLEEP_PORT HP +#define DCMOTOR26_SLEEP_PIN 46 +// [GPIO_DCMOTOR26_SLEEP]$ + +// DCMOTOR26_INT +// $[GPIO_DCMOTOR26_INT] +#define DCMOTOR26_INT_PORT HP +#define DCMOTOR26_INT_PIN 47 +// [GPIO_DCMOTOR26_INT]$ + +// DCMOTOR26_PWM +// $[GPIO_DCMOTOR26_PWM] +#define DCMOTOR26_PWM_PORT HP +#define DCMOTOR26_PWM_PIN 48 +// [GPIO_DCMOTOR26_PWM]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} + +#endif +#endif // MIKROE_DCMOTOR26_CONFIG_H_ diff --git a/driver/public/mikroe/dcmotor26_tb9053ftg/config/other/mikroe_dcmotor26_config.h b/driver/public/mikroe/dcmotor26_tb9053ftg/config/other/mikroe_dcmotor26_config.h index 0a39437e..41d5d916 100644 --- a/driver/public/mikroe/dcmotor26_tb9053ftg/config/other/mikroe_dcmotor26_config.h +++ b/driver/public/mikroe/dcmotor26_tb9053ftg/config/other/mikroe_dcmotor26_config.h @@ -40,12 +40,47 @@ #ifndef MIKROE_DCMOTOR26_CONFIG_H_ #define MIKROE_DCMOTOR26_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE DCMOTOR26 SPI Configuration +// MIKROE DCMOTOR26 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DCMOTOR26_SPI_BITRATE 10000000 + +// +// + +// MIKROE DCMOTOR26 I2C Configuration +// MIKROE DCMOTOR26 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DCMOTOR26_I2C_SPEED_MODE 0 + +// +// + // I2C address // DCMOTOR26 PCA9538A ADDRESS // <0=> None @@ -54,7 +89,7 @@ extern "C" { // <0x72=> 0x72 // <0x73=> 0x73 // Default: 0x70 -#define DCMOTOR26_PCA9538A_ADDRESS 0x70 +#define DCMOTOR26_PCA9538A_ADDRESS 0x70 // @@ -62,11 +97,17 @@ extern "C" { // <<< sl:start pin_tool >>> +// DCMOTOR26_CS +// $[GPIO_DCMOTOR26_CS] +// #define DCMOTOR26_CS_PORT 0 +// #define DCMOTOR26_CS_PIN 0 +// [GPIO_DCMOTOR26_CS]$ + // DCMOTOR26_CHANNEL_MONITOR // $[GPIO_DCMOTOR26_CHANNEL_MONITOR] #warning "GPIO_DCMOTOR26_CHANNEL_MONITOR is not configured" -// #define DCMOTOR26_CHANNEL_MONITOR_PORT gpioPortB -// #define DCMOTOR26_CHANNEL_MONITOR_PIN 0 +// #define DCMOTOR26_CHANNEL_MONITOR_PORT gpioPortB +// #define DCMOTOR26_CHANNEL_MONITOR_PIN 0 // [GPIO_DCMOTOR26_CHANNEL_MONITOR]$ // DCMOTOR26_SLEEP @@ -79,15 +120,15 @@ extern "C" { // DCMOTOR26_INT // $[GPIO_DCMOTOR26_INT] #warning "GPIO_DCMOTOR26_INT is not configured" -// #define DCMOTOR26_INT_PORT gpioPortB -// #define DCMOTOR26_INT_PIN 1 +// #define DCMOTOR26_INT_PORT gpioPortB +// #define DCMOTOR26_INT_PIN 1 // [GPIO_DCMOTOR26_INT]$ // DCMOTOR26_PWM // $[GPIO_DCMOTOR26_PWM] #warning "GPIO_DCMOTOR26_PWM is not configured" -// #define DCMOTOR26_PWM_PORT gpioPortA -// #define DCMOTOR26_PWM_PIN 0 +// #define DCMOTOR26_PWM_PORT gpioPortA +// #define DCMOTOR26_PWM_PIN 0 // [GPIO_DCMOTOR26_PWM]$ // <<< sl:end pin_tool >>> @@ -96,4 +137,4 @@ extern "C" { } #endif -#endif /* MIKROE_DCMOTOR26_CONFIG_H_ */ +#endif // MIKROE_DCMOTOR26_CONFIG_H_ diff --git a/driver/public/mikroe/dcmotor26_tb9053ftg/inc/mikroe_tb9053ftg.h b/driver/public/mikroe/dcmotor26_tb9053ftg/inc/mikroe_tb9053ftg.h index a8248dd9..1b89136a 100644 --- a/driver/public/mikroe/dcmotor26_tb9053ftg/inc/mikroe_tb9053ftg.h +++ b/driver/public/mikroe/dcmotor26_tb9053ftg/inc/mikroe_tb9053ftg.h @@ -41,16 +41,9 @@ #define _MIKROE_TB9053FTG_H_ #include "sl_status.h" -#include "spidrv.h" -#include "sl_i2cspm.h" - -#if defined(_SILICON_LABS_32B_SERIES_1) -#include "em_adc.h" -typedef ADC_TypeDef adc_t; -#elif defined(_SILICON_LABS_32B_SERIES_2) -#include "em_iadc.h" -typedef IADC_TypeDef adc_t; -#endif +#include "drv_analog_in.h" +#include "drv_i2c_master.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -235,15 +228,6 @@ extern "C" { * @{ */ -/** - * @brief DC Motor 26 configuration object setup function. - * @details This function initializes click configuration structure to initial - * values. - * @return Nothing. - * @note The all used pins will be set to unconnected state. - */ -void mikroe_tb9053ftg_cfg_setup(void); - /** * @brief DC Motor 26 initialization function. * @details This function initializes all necessary pins and peripherals used @@ -255,9 +239,9 @@ void mikroe_tb9053ftg_cfg_setup(void); * SL_STATUS_FAIL - Error. * @note None. */ -sl_status_t mikroe_tb9053ftg_init(SPIDRV_Handle_t spi_instance, - sl_i2cspm_t *i2c_instance, - adc_t *adc); +sl_status_t mikroe_tb9053ftg_init(mikroe_spi_handle_t spi_instance, + mikroe_i2c_handle_t i2c_instance, + mikroe_adc_handle_t adc); /** * @brief DC Motor 26 default configuration function. @@ -522,8 +506,8 @@ sl_status_t mikroe_tb9053ftg_set_ch1_operation_mode(uint8_t mode); * @return SL_STATUS_OK - Success, * SL_STATUS_FAIL - Error. * See #err_t definition for detailed explanation. - * @note Ineffective for Combined-Channel Mode (LARGE Mode) (OSEL1 = L and OSEL2 - * = L). + * @note Ineffective for Combined-Channel Mode (LARGE Mode) + * (OSEL1 = L and OSEL2 = L). */ sl_status_t mikroe_tb9053ftg_set_ch2_operation_mode(uint8_t mode); @@ -545,8 +529,8 @@ sl_status_t mikroe_tb9053ftg_set_ch1_drive_frequency(uint16_t drv_freq); * @return SL_STATUS_OK - Success, * SL_STATUS_FAIL - Error. * See #err_t definition for detailed explanation. - * @note Ineffective for Combined-Channel Mode (LARGE Mode) (OSEL1 = L and OSEL2 - * = L). + * @note Ineffective for Combined-Channel Mode (LARGE Mode) + * (OSEL1 = L and OSEL2 = L). */ sl_status_t mikroe_tb9053ftg_set_ch2_drive_frequency(uint16_t drv_freq); @@ -568,8 +552,8 @@ sl_status_t mikroe_tb9053ftg_set_ch1_duty_period(uint16_t duty_period); * @return SL_STATUS_OK - Success, * SL_STATUS_FAIL - Error. * See #err_t definition for detailed explanation. - * @note Ineffective for Combined-Channel Mode (LARGE Mode) (OSEL1 = L and OSEL2 - * = L). + * @note Ineffective for Combined-Channel Mode (LARGE Mode) + * (OSEL1 = L and OSEL2 = L). */ sl_status_t mikroe_tb9053ftg_set_ch2_duty_period(uint16_t duty_period); @@ -577,4 +561,4 @@ sl_status_t mikroe_tb9053ftg_set_ch2_duty_period(uint16_t duty_period); } #endif -#endif /* _MIKROE_TB9053FTG_H_ */ +#endif // _MIKROE_TB9053FTG_H_ diff --git a/driver/public/mikroe/dcmotor26_tb9053ftg/src/mikroe_tb9053ftg.c b/driver/public/mikroe/dcmotor26_tb9053ftg/src/mikroe_tb9053ftg.c index 30e0ee2c..4735371e 100644 --- a/driver/public/mikroe/dcmotor26_tb9053ftg/src/mikroe_tb9053ftg.c +++ b/driver/public/mikroe/dcmotor26_tb9053ftg/src/mikroe_tb9053ftg.c @@ -37,38 +37,31 @@ * ******************************************************************************/ -#include "sl_i2cspm.h" #include "mikroe_tb9053ftg.h" #include "mikroe_dcmotor26_config.h" #include "dcmotor26.h" -#include "third_party_hw_drivers_helpers.h" static dcmotor26_t ctx; static dcmotor26_cfg_t ctx_cfg; -void mikroe_tb9053ftg_cfg_setup(void) -{ - dcmotor26_cfg_setup(&ctx_cfg); -} - -sl_status_t mikroe_tb9053ftg_init(SPIDRV_Handle_t spi_instance, - sl_i2cspm_t *i2c_instance, - adc_t *adc) +sl_status_t mikroe_tb9053ftg_init(mikroe_spi_handle_t spi_instance, + mikroe_i2c_handle_t i2c_instance, + mikroe_adc_handle_t adc) { if ((NULL == spi_instance) || (NULL == i2c_instance) || (NULL == adc)) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - - mikroe_tb9053ftg_cfg_setup(); + dcmotor26_cfg_setup(&ctx_cfg); ctx.i2c.handle = i2c_instance; ctx.spi.handle = spi_instance; ctx.slave_address = DCMOTOR26_PCA9538A_ADDRESS; ctx.adc.handle = adc; + ctx_cfg.spi_speed = 1000000; + #if defined(DCMOTOR26_CHANNEL_MONITOR_PORT) \ && defined(DCMOTOR26_CHANNEL_MONITOR_PIN) ctx_cfg.cm = hal_gpio_pin_name(DCMOTOR26_CHANNEL_MONITOR_PORT, @@ -90,9 +83,27 @@ sl_status_t mikroe_tb9053ftg_init(SPIDRV_Handle_t spi_instance, DCMOTOR26_PWM_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(dcmotor26_init(&ctx, &ctx_cfg)); +#if (MIKROE_DCMOTOR26_SPI_UC == 1) + ctx_cfg.spi_speed = MIKROE_DCMOTOR26_SPI_BITRATE; +#endif + +#if defined(DCMOTOR26_CS_PORT) && defined(DCMOTOR26_CS_PIN) + ctx_cfg.cs = hal_gpio_pin_name(DCMOTOR26_CS_PORT, + DCMOTOR26_CS_PIN); + // CS pin need to init here since the mikroe_sdk_v2 missed this step + digital_out_t struct_cs; + digital_out_init(&struct_cs, ctx_cfg.cs); +#endif + +#if (MIKROE_DCMOTOR26_I2C_UC == 1) + ctx_cfg.i2c_speed = MIKROE_DCMOTOR26_I2C_SPEED_MODE; +#endif + + if (dcmotor26_init(&ctx, &ctx_cfg) != DCMOTOR26_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } sl_status_t mikroe_tb9053ftg_default_cfg(void) diff --git a/driver/public/mikroe/dcmotor3_tb6549fg/config/brd4338a/mikroe_tb6549fg_config.h b/driver/public/mikroe/dcmotor3_tb6549fg/config/brd4338a/mikroe_tb6549fg_config.h new file mode 100644 index 00000000..e26cd380 --- /dev/null +++ b/driver/public/mikroe/dcmotor3_tb6549fg/config/brd4338a/mikroe_tb6549fg_config.h @@ -0,0 +1,65 @@ +/***************************************************************************//** + * @file mikroe_tb6549fg_config.h + * @brief SCL TB6549FG Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_TB6549FG_CONFIG_H_ +#define MIKROE_TB6549FG_CONFIG_H_ + +// <<< sl:start pin_tool >>> + +// DCMOTOR3_IN1 +// $[GPIO_DCMOTOR3_IN1] +#define DCMOTOR3_IN1_PORT HP +#define DCMOTOR3_IN1_PIN 48 +// [GPIO_DCMOTOR3_IN1]$ + +// DCMOTOR3_IN2 +// $[GPIO_DCMOTOR3_IN2] +#define DCMOTOR3_IN2_PORT HP +#define DCMOTOR3_IN2_PIN 47 +// [GPIO_DCMOTOR3_IN2]$ + +// DCMOTOR3_SLP +// $[GPIO_DCMOTOR3_SLP] +#define DCMOTOR3_SLP_PORT HP +#define DCMOTOR3_SLP_PIN 46 +// [GPIO_DCMOTOR3_SLP]$ + +// <<< sl:end pin_tool >>> + +#endif /* MIKROE_TB6549FG_CONFIG_H_ */ diff --git a/driver/public/mikroe/dcmotor3_tb6549fg/config/other/mikroe_tb6549fg_config.h b/driver/public/mikroe/dcmotor3_tb6549fg/config/other/mikroe_tb6549fg_config.h index cfadf1dd..0b716355 100644 --- a/driver/public/mikroe/dcmotor3_tb6549fg/config/other/mikroe_tb6549fg_config.h +++ b/driver/public/mikroe/dcmotor3_tb6549fg/config/other/mikroe_tb6549fg_config.h @@ -40,7 +40,9 @@ #ifndef MIKROE_TB6549FG_CONFIG_H_ #define MIKROE_TB6549FG_CONFIG_H_ +#ifndef SLI_SI917 #include "em_gpio.h" +#endif // <<< sl:start pin_tool >>> @@ -67,4 +69,4 @@ // <<< sl:end pin_tool >>> -#endif /* MIKROE_TB6549FG_CONFIG_H_ */ +#endif // MIKROE_TB6549FG_CONFIG_H_ diff --git a/driver/public/mikroe/dcmotor3_tb6549fg/inc/mikroe_tb6549fg.h b/driver/public/mikroe/dcmotor3_tb6549fg/inc/mikroe_tb6549fg.h index fa81f689..429bfff0 100644 --- a/driver/public/mikroe/dcmotor3_tb6549fg/inc/mikroe_tb6549fg.h +++ b/driver/public/mikroe/dcmotor3_tb6549fg/inc/mikroe_tb6549fg.h @@ -41,8 +41,7 @@ #define MIKROE_TB6549FG_H_ #include "sl_status.h" -#include "sl_pwm.h" -#include "stddef.h" +#include "drv_pwm.h" #ifdef __cplusplus extern "C" { @@ -102,7 +101,7 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_tb6549fg_init(sl_pwm_instance_t *pwm_instance); +sl_status_t mikroe_tb6549fg_init(mikroe_pwm_handle_t pwm_instance); /***************************************************************************//** * @brief @@ -115,7 +114,7 @@ sl_status_t mikroe_tb6549fg_init(sl_pwm_instance_t *pwm_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if pwm_instance is null. ******************************************************************************/ -sl_status_t mikroe_tb6549fg_set_pwm_instance(sl_pwm_instance_t *pwm_instance); +sl_status_t mikroe_tb6549fg_set_pwm_instance(mikroe_pwm_handle_t pwm_instance); /***************************************************************************//** * @brief @@ -207,4 +206,4 @@ void mikroe_tb6549fg_stop(void); } #endif -#endif /* MIKROE_TB6549FG_H_ */ +#endif // MIKROE_TB6549FG_H_ diff --git a/driver/public/mikroe/dcmotor3_tb6549fg/src/mikroe_tb6549fg.c b/driver/public/mikroe/dcmotor3_tb6549fg/src/mikroe_tb6549fg.c index 0e5ead16..664a4705 100644 --- a/driver/public/mikroe/dcmotor3_tb6549fg/src/mikroe_tb6549fg.c +++ b/driver/public/mikroe/dcmotor3_tb6549fg/src/mikroe_tb6549fg.c @@ -37,21 +37,19 @@ * ******************************************************************************/ +#include #include "dcmotor3.h" -#include "em_gpio.h" #include "mikroe_tb6549fg_config.h" #include "mikroe_tb6549fg.h" -#include "third_party_hw_drivers_helpers.h" static dcmotor3_t dcmotor3; static dcmotor3_cfg_t dcmotor3_cfg; -sl_status_t mikroe_tb6549fg_init(sl_pwm_instance_t *pwm_instance) +sl_status_t mikroe_tb6549fg_init(mikroe_pwm_handle_t pwm_instance) { if (pwm_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); // Configure default i2csmp instance dcmotor3.pwm.handle = pwm_instance; @@ -71,14 +69,14 @@ sl_status_t mikroe_tb6549fg_init(sl_pwm_instance_t *pwm_instance) dcmotor3_cfg.slp = hal_gpio_pin_name(DCMOTOR3_SLP_PORT, DCMOTOR3_SLP_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(dcmotor3_init(&dcmotor3, - &dcmotor3_cfg)); + if (dcmotor3_init(&dcmotor3, &dcmotor3_cfg) != DCMOTOR3_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } -sl_status_t mikroe_tb6549fg_set_pwm_instance( - sl_pwm_instance_t *pwm_instance) +sl_status_t mikroe_tb6549fg_set_pwm_instance(mikroe_pwm_handle_t pwm_instance) { if (NULL == pwm_instance) { return SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/eink_display/config/brd2703a/mikroe_eink_display_config.h b/driver/public/mikroe/eink_display/config/brd2703a/mikroe_eink_display_config.h new file mode 100644 index 00000000..8a224cc1 --- /dev/null +++ b/driver/public/mikroe/eink_display/config/brd2703a/mikroe_eink_display_config.h @@ -0,0 +1,136 @@ +/***************************************************************************//** + * @file mikroe_eink_diplay_config.h + * @brief Mikroe eINK Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_EINK_DISPLAY_CONFIG_H_ +#define MIKROE_EINK_DISPLAY_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define EINK_DISPLAY_1_54_INCH 0 +#define EINK_DISPLAY_2_13_INCH 1 +#define EINK_DISPLAY_2_90_INCH 2 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE E-PAPER SPI Configuration + +// MIKROE E-PAPER SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_EINK_DISPLAY_SPI_UC 0 + +// Bit Rate (Bits/Second) +// Default: 10000000 +#define MIKROE_EINK_DISPLAY_SPI_UC_BITRATE 10000000 + +// +// + +// Screen + +// eINK Display Resolution +// 200x200 +// 122x250 +// 296x128 +// Default: EINK_DISPLAY_1_54_INCH +// The screen width parameter is used +// to configure display driver. +#define CONFIG_EINK_DISPLAY_RESOLUTION EINK_DISPLAY_1_54_INCH + +// + +// ESL MODE setting +// ESL_MODE> Enable Peripheral +// Macro for the ESL mode +#define ESL_MODE 0 +// +// + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// EINK_DISPLAY_CS +// $[GPIO_EINK_DISPLAY_CS] +// #define EINK_DISPLAY_CS_PORT 0 +// #define EINK_DISPLAY_CS_PIN 0 +// [GPIO_EINK_DISPLAY_CS]$ + +// EINK_DISPLAY_DC +// $[GPIO_EINK_DISPLAY_DC] +#define EINK_DISPLAY_DC_PORT gpioPortA +#define EINK_DISPLAY_DC_PIN 0 +// [GPIO_EINK_DISPLAY_DC]$ + +// EINK_DISPLAY_RST +// $[GPIO_EINK_DISPLAY_RST] +#define EINK_DISPLAY_RST_PORT gpioPortC +#define EINK_DISPLAY_RST_PIN 8 +// [GPIO_EINK_DISPLAY_RST]$ + +// EINK_DISPLAY_BSY +// $[GPIO_EINK_DISPLAY_BSY] +#define EINK_DISPLAY_BSY_PORT gpioPortB +#define EINK_DISPLAY_BSY_PIN 1 +// [GPIO_EINK_DISPLAY_BSY]$ + +// <<< sl:end pin_tool >>> + +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 200 +#define MIKROE_EINK_DISPLAY_HEIGHT 200 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_13_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 122 +#define MIKROE_EINK_DISPLAY_HEIGHT 250 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_90_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 296 +#define MIKROE_EINK_DISPLAY_HEIGHT 128 +#endif + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_EINK_DISPLAY_CONFIG_H_ diff --git a/driver/public/mikroe/eink_display/config/brd4108a/mikroe_eink_display_config.h b/driver/public/mikroe/eink_display/config/brd4108a/mikroe_eink_display_config.h new file mode 100644 index 00000000..f298caa8 --- /dev/null +++ b/driver/public/mikroe/eink_display/config/brd4108a/mikroe_eink_display_config.h @@ -0,0 +1,136 @@ +/***************************************************************************//** + * @file mikroe_eink_diplay_config.h + * @brief Mikroe eINK Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_EINK_DISPLAY_CONFIG_H_ +#define MIKROE_EINK_DISPLAY_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define EINK_DISPLAY_1_54_INCH 0 +#define EINK_DISPLAY_2_13_INCH 1 +#define EINK_DISPLAY_2_90_INCH 2 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE EINK DISPLAY SPI Configuration + +// MIKROE EINK DISPLAY SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_EINK_DISPLAY_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_EINK_DISPLAY_SPI_UC_BITRATE 10000000 + +// +// + +// Screen + +// eINK Display Resolution +// 200x200 +// 122x250 +// 296x128 +// Default: EINK_DISPLAY_1_54_INCH +// The screen width parameter is used +// to configure display driver. +#define CONFIG_EINK_DISPLAY_RESOLUTION EINK_DISPLAY_1_54_INCH + +// + +// ESL MODE setting +// ESL_MODE> Enable Peripheral +// Macro for the ESL mode +#define ESL_MODE 0 +// +// + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// EINK_DISPLAY_CS +// $[GPIO_EINK_DISPLAY_CS] +// #define EINK_DISPLAY_CS_PORT 0 +// #define EINK_DISPLAY_CS_PIN 0 +// [GPIO_EINK_DISPLAY_CS]$ + +// EINK_DISPLAY_DC +// $[GPIO_EINK_DISPLAY_DC] +#define EINK_DISPLAY_DC_PORT gpioPortB +#define EINK_DISPLAY_DC_PIN 4 +// [GPIO_EINK_DISPLAY_DC]$ + +// EINK_DISPLAY_RST +// $[GPIO_EINK_DISPLAY_RST] +#define EINK_DISPLAY_RST_PORT gpioPortC +#define EINK_DISPLAY_RST_PIN 6 +// [GPIO_EINK_DISPLAY_RST]$ + +// EINK_DISPLAY_BSY +// $[GPIO_EINK_DISPLAY_BSY] +#define EINK_DISPLAY_BSY_PORT gpioPortB +#define EINK_DISPLAY_BSY_PIN 3 +// [GPIO_EINK_DISPLAY_BSY]$ + +// <<< sl:end pin_tool >>> + +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 200 +#define MIKROE_EINK_DISPLAY_HEIGHT 200 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_13_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 122 +#define MIKROE_EINK_DISPLAY_HEIGHT 250 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_90_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 296 +#define MIKROE_EINK_DISPLAY_HEIGHT 128 +#endif + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_EINK_DISPLAY_CONFIG_H_ diff --git a/driver/public/mikroe/eink_display/config/brd4182a/mikroe_eink_display_config.h b/driver/public/mikroe/eink_display/config/brd4182a/mikroe_eink_display_config.h new file mode 100644 index 00000000..12a5d80e --- /dev/null +++ b/driver/public/mikroe/eink_display/config/brd4182a/mikroe_eink_display_config.h @@ -0,0 +1,136 @@ +/***************************************************************************//** + * @file mikroe_eink_diplay_config.h + * @brief Mikroe eINK Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_EINK_DISPLAY_CONFIG_H_ +#define MIKROE_EINK_DISPLAY_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define EINK_DISPLAY_1_54_INCH 0 +#define EINK_DISPLAY_2_13_INCH 1 +#define EINK_DISPLAY_2_90_INCH 2 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE EINK DISPLAY SPI Configuration + +// MIKROE EINK DISPLAY SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_EINK_DISPLAY_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_EINK_DISPLAY_SPI_UC_BITRATE 10000000 + +// +// + +// Screen + +// eINK Display Resolution +// 200x200 +// 122x250 +// 296x128 +// Default: EINK_DISPLAY_1_54_INCH +// The screen width parameter is used +// to configure display driver. +#define CONFIG_EINK_DISPLAY_RESOLUTION EINK_DISPLAY_1_54_INCH + +// + +// ESL MODE setting +// ESL_MODE> Enable Peripheral +// Macro for the ESL mode +#define ESL_MODE 0 +// +// + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// EINK_DISPLAY_CS +// $[GPIO_EINK_DISPLAY_CS] +// #define EINK_DISPLAY_CS_PORT 0 +// #define EINK_DISPLAY_CS_PIN 0 +// [GPIO_EINK_DISPLAY_CS]$ + +// EINK_DISPLAY_DC +// $[GPIO_EINK_DISPLAY_DC] +#define EINK_DISPLAY_DC_PORT gpioPortD +#define EINK_DISPLAY_DC_PIN 2 +// [GPIO_EINK_DISPLAY_DC]$ + +// EINK_DISPLAY_RST +// $[GPIO_EINK_DISPLAY_RST] +#define EINK_DISPLAY_RST_PORT gpioPortD +#define EINK_DISPLAY_RST_PIN 3 +// [GPIO_EINK_DISPLAY_RST]$ + +// EINK_DISPLAY_BSY +// $[GPIO_EINK_DISPLAY_BSY] +#define EINK_DISPLAY_BSY_PORT gpioPortB +#define EINK_DISPLAY_BSY_PIN 1 +// [GPIO_EINK_DISPLAY_BSY]$ + +// <<< sl:end pin_tool >>> + +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 200 +#define MIKROE_EINK_DISPLAY_HEIGHT 200 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_13_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 122 +#define MIKROE_EINK_DISPLAY_HEIGHT 250 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_90_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 296 +#define MIKROE_EINK_DISPLAY_HEIGHT 128 +#endif + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_EINK_DISPLAY_CONFIG_H_ diff --git a/driver/public/mikroe/eink_display/config/brd4314a/mikroe_eink_display_config.h b/driver/public/mikroe/eink_display/config/brd4314a/mikroe_eink_display_config.h new file mode 100644 index 00000000..2ccfd15d --- /dev/null +++ b/driver/public/mikroe/eink_display/config/brd4314a/mikroe_eink_display_config.h @@ -0,0 +1,137 @@ +/***************************************************************************//** + * @file mikroe_eink_diplay_config.h + * @brief Mikroe eINK Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_EINK_DISPLAY_CONFIG_H_ +#define MIKROE_EINK_DISPLAY_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define EINK_DISPLAY_1_54_INCH 0 +#define EINK_DISPLAY_2_13_INCH 1 +#define EINK_DISPLAY_2_90_INCH 2 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE EINK DISPLAY SPI Configuration + +// MIKROE EINK DISPLAY SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_EINK_DISPLAY_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_EINK_DISPLAY_SPI_UC_BITRATE 10000000 + +// +// + +// Screen + +// eINK Display Resolution +// 200x200 +// 122x250 +// 296x128 +// Default: EINK_DISPLAY_1_54_INCH +// The screen width parameter is used +// to configure display driver. +#define CONFIG_EINK_DISPLAY_RESOLUTION EINK_DISPLAY_1_54_INCH + +// + +// ESL MODE setting +// ESL_MODE> Enable Peripheral +// Macro for the ESL mode +#define ESL_MODE 0 +// +// + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// EINK_DISPLAY_CS +// $[GPIO_EINK_DISPLAY_CS] +// #define EINK_DISPLAY_CS_PORT 0 +// #define EINK_DISPLAY_CS_PIN 0 +// [GPIO_EINK_DISPLAY_CS]$ + +// EINK_DISPLAY_DC +// $[GPIO_EINK_DISPLAY_DC] +#define EINK_DISPLAY_DC_PORT gpioPortB +#define EINK_DISPLAY_DC_PIN 4 +// [GPIO_EINK_DISPLAY_DC]$ + +// EINK_DISPLAY_RST +// $[GPIO_EINK_DISPLAY_RST] +#define EINK_DISPLAY_RST_PORT gpioPortC +#define EINK_DISPLAY_RST_PIN 6 +// [GPIO_EINK_DISPLAY_RST]$ + +// EINK_DISPLAY_BSY +// $[GPIO_EINK_DISPLAY_BSY] +#define EINK_DISPLAY_BSY_PORT gpioPortB +#define EINK_DISPLAY_BSY_PIN 3 +// [GPIO_EINK_DISPLAY_BSY]$ + +// <<< sl:end pin_tool >>> + + +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 200 +#define MIKROE_EINK_DISPLAY_HEIGHT 200 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_13_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 122 +#define MIKROE_EINK_DISPLAY_HEIGHT 250 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_90_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 296 +#define MIKROE_EINK_DISPLAY_HEIGHT 128 +#endif + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_EINK_DISPLAY_CONFIG_H_ diff --git a/driver/public/mikroe/eink_display/config/brd4338a/mikroe_eink_display_config.h b/driver/public/mikroe/eink_display/config/brd4338a/mikroe_eink_display_config.h new file mode 100644 index 00000000..00ea961b --- /dev/null +++ b/driver/public/mikroe/eink_display/config/brd4338a/mikroe_eink_display_config.h @@ -0,0 +1,134 @@ +/***************************************************************************//** + * @file mikroe_eink_diplay_config.h + * @brief Mikroe eINK Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_EINK_DISPLAY_CONFIG_H_ +#define MIKROE_EINK_DISPLAY_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define EINK_DISPLAY_1_54_INCH 0 +#define EINK_DISPLAY_2_13_INCH 1 +#define EINK_DISPLAY_2_90_INCH 2 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE EINK DISPLAY SPI Configuration + +// MIKROE EINK DISPLAY SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_EINK_DISPLAY_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_EINK_DISPLAY_SPI_UC_BITRATE 10000000 + +// +// + +// Screen + +// eINK Display Resolution +// 200x200 +// 122x250 +// 296x128 +// Default: EINK_DISPLAY_1_54_INCH +// The screen width parameter is used +// to configure display driver. +#define CONFIG_EINK_DISPLAY_RESOLUTION EINK_DISPLAY_1_54_INCH + +// + +// ESL MODE setting +// ESL_MODE> Enable Peripheral +// Macro for the ESL mode +#define ESL_MODE 0 +// +// + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// EINK_DISPLAY_CS +// $[GPIO_EINK_DISPLAY_CS] +// #define EINK_DISPLAY_CS_PORT 0 +// #define EINK_DISPLAY_CS_PIN 0 +// [GPIO_EINK_DISPLAY_CS]$ + +// EINK_DISPLAY_DC +// $[GPIO_EINK_DISPLAY_DC] +#define EINK_DISPLAY_DC_PORT HP +#define EINK_DISPLAY_DC_PIN 48 +// [GPIO_EINK_DISPLAY_DC]$ + +// EINK_DISPLAY_RST +// $[GPIO_EINK_DISPLAY_RST] +#define EINK_DISPLAY_RST_PORT HP +#define EINK_DISPLAY_RST_PIN 46 +// [GPIO_EINK_DISPLAY_RST]$ + +// EINK_DISPLAY_BSY +// $[GPIO_EINK_DISPLAY_BSY] +#define EINK_DISPLAY_BSY_PORT HP +#define EINK_DISPLAY_BSY_PIN 47 +// [GPIO_EINK_DISPLAY_BSY]$ + +// <<< sl:end pin_tool >>> + +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 200 +#define MIKROE_EINK_DISPLAY_HEIGHT 200 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_13_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 122 +#define MIKROE_EINK_DISPLAY_HEIGHT 250 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_90_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 296 +#define MIKROE_EINK_DISPLAY_HEIGHT 128 +#endif + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_EINK_DISPLAY_CONFIG_H_ diff --git a/driver/public/mikroe/eink_display/config/other/mikroe_eink_display_config.h b/driver/public/mikroe/eink_display/config/other/mikroe_eink_display_config.h new file mode 100644 index 00000000..f253cd19 --- /dev/null +++ b/driver/public/mikroe/eink_display/config/other/mikroe_eink_display_config.h @@ -0,0 +1,141 @@ +/***************************************************************************//** + * @file mikroe_eink_display_config.h + * @brief Mikroe eINK Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_EINK_DISPLAY_CONFIG_H_ +#define MIKROE_EINK_DISPLAY_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define EINK_DISPLAY_1_54_INCH 0 +#define EINK_DISPLAY_2_13_INCH 1 +#define EINK_DISPLAY_2_90_INCH 2 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE EINK DISPLAY SPI Configuration + +// MIKROE EINK DISPLAY SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_EINK_DISPLAY_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_EINK_DISPLAY_SPI_UC_BITRATE 10000000 + +// +// + +// Screen + +// eINK Display Resolution +// 200x200 +// 122x250 +// 296x128 +// Default: EINK_DISPLAY_1_54_INCH +// The screen width parameter is used +// to configure display driver. +#define CONFIG_EINK_DISPLAY_RESOLUTION EINK_DISPLAY_1_54_INCH + +// + +// ESL MODE setting +// ESL_MODE> Enable Peripheral +// Macro for the ESL mode +#define ESL_MODE 0 +// +// + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// EINK_DISPLAY_CS +// $[GPIO_EINK_DISPLAY_CS] +// #define EINK_DISPLAY_CS_PORT 0 +// #define EINK_DISPLAY_CS_PIN 0 +// [GPIO_EINK_DISPLAY_CS]$ + +// EINK_DISPLAY_DC +// $[GPIO_EINK_DISPLAY_DC] +#warning "EINK_DISPLAY_154_INCH_DC is not configured" +// #define EINK_DISPLAY_DC_PORT gpioPortA +// #define EINK_DISPLAY_DC_PIN 0 +// [GPIO_EINK_DISPLAY_DC]$ + +// EINK_DISPLAY_RST +// $[GPIO_EINK_DISPLAY_RST] +#warning "EINK_DISPLAY_154_INCH_RST is not configured" +// #define EINK_DISPLAY_RST_PORT gpioPortC +// #define EINK_DISPLAY_RST_PIN 8 +// [GPIO_EINK_DISPLAY_RST]$ + +// EINK_DISPLAY_BSY +// $[GPIO_EINK_DISPLAY_BSY] +#warning "EINK_DISPLAY_BSY is not configured" +// #define EINK_DISPLAY_BSY_PORT gpioPortB +// #define EINK_DISPLAY_BSY_PIN 1 +// [GPIO_EINK_DISPLAY_BSY]$ + +// <<< sl:end pin_tool >>> + +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 200 +#define MIKROE_EINK_DISPLAY_HEIGHT 200 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_13_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 122 +#define MIKROE_EINK_DISPLAY_HEIGHT 250 +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_90_INCH) +#define MIKROE_EINK_DISPLAY_WIDTH 296 +#define MIKROE_EINK_DISPLAY_HEIGHT 128 +#endif + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_EINK_DISPLAY_CONFIG_H_ diff --git a/driver/public/mikroe/e_paper_154_inch/inc/mikroe_e_paper_154_inch.h b/driver/public/mikroe/eink_display/inc/mikroe_eink_display.h similarity index 52% rename from driver/public/mikroe/e_paper_154_inch/inc/mikroe_e_paper_154_inch.h rename to driver/public/mikroe/eink_display/inc/mikroe_eink_display.h index 3593bd23..1ed50523 100644 --- a/driver/public/mikroe/e_paper_154_inch/inc/mikroe_e_paper_154_inch.h +++ b/driver/public/mikroe/eink_display/inc/mikroe_eink_display.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_e_paper.c - * @brief SCL Mikroe E-Paper Header File + * @file mikroe_eink_display.h + * @brief SCL Mikroe eINK * @version 1.0.0 ******************************************************************************* * # License @@ -36,51 +36,154 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_E_PAPER_154_INCH_H_ -#define MIKROE_E_PAPER_154_INCH_H_ +#ifndef MIKROE_EINK_DISPLAY_H_ +#define MIKROE_EINK_DISPLAY_H_ // ----------------------------------------------------------------------------- // Includes // ----------------------------------------------------------------------------- -#include "sl_status.h" -#include "eink_154inch.h" -#include "spidrv.h" - #ifdef __cplusplus extern "C" { #endif +#include "sl_status.h" +#include "mikroe_eink_display_config.h" + +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#include "eink154inch.h" + +#define eink_display_cfg_setup(cfg) \ + eink154inch_cfg_setup(cfg) +#define eink_display_init(ctx, cfg) \ + eink154inch_init(ctx, cfg) +#define eink_display_send_command(ctx, command) \ + eink154inch_send_cmd(ctx, command) +#define eink_display_send_data(ctx, data) \ + eink154inch_send_data(ctx, data) +#define eink_display_reset(ctx) \ + eink154inch_reset(ctx) +#define eink_display_sleep_mode(ctx) \ + eink154inch_sleep_mode(ctx) +#define eink_display_set_lut(ctx, lut, n_bytes) \ + eink154inch_set_lut(ctx, lut, n_bytes) +#define eink_display_start_config(ctx) \ + eink154inch_start_config(ctx) +#define eink_display_set_mem_pointer(ctx, x, y) \ + eink154inch_set_mem_pointer(ctx, x, y) +#define eink_display_set_mem_area(ctx, xy) \ + eink154inch_set_mem_area(ctx, xy) +#define eink_display_update_display(ctx) \ + eink154inch_update_display(ctx) +#define eink_display_fill_screen(ctx, color) \ + eink154inch_fill_screen(ctx, color) +#define eink_display_display_image(ctx, image_buffer) \ + eink154inch_image(ctx, image_buffer) + +typedef eink154inch_t eink_display_t; +typedef eink154inch_cfg_t eink_display_cfg_t; +typedef eink154inch_xy_t eink_display_xy_t; +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_13_INCH) +#include "eink213inch.h" + +#define eink_display_cfg_setup(cfg) \ + eink213inch_cfg_setup(cfg) +#define eink_display_init(ctx, cfg) \ + eink213inch_init(ctx, cfg) +#define eink_display_send_command(ctx, command) \ + eink213inch_send_cmd(ctx, command) +#define eink_display_send_data(ctx, data) \ + eink213inch_send_data(ctx, data) +#define eink_display_reset(ctx) \ + eink213inch_reset(ctx) +#define eink_display_sleep_mode(ctx) \ + eink213inch_sleep_mode(ctx) +#define eink_display_set_lut(ctx, lut, n_bytes) \ + eink213inch_set_lut(ctx, lut, n_bytes) +#define eink_display_start_config(ctx) \ + eink213inch_start_config(ctx) +#define eink_display_set_mem_pointer(ctx, x, y) \ + eink213inch_set_mem_pointer(ctx, x, y) +#define eink_display_set_mem_area(ctx, xy) \ + eink213inch_set_mem_area(ctx, xy) +#define eink_display_update_display(ctx) \ + eink213inch_update_display(ctx) +#define eink_display_fill_screen(ctx, color) \ + eink213inch_fill_screen(ctx, color) +#define eink_display_display_image(ctx, image_buffer) \ + eink213inch_display_image(ctx, image_buffer) + +typedef eink213inch_t eink_display_t; +typedef eink213inch_cfg_t eink_display_cfg_t; +typedef eink213inch_xy_t eink_display_xy_t; +#elif (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_2_90_INCH) +#include "eink290inch.h" + +#define eink_display_cfg_setup(cfg) \ + eink290inch_cfg_setup(cfg) +#define eink_display_init(ctx, cfg) \ + eink290inch_init(ctx, cfg) +#define eink_display_send_command(ctx, command) \ + eink290inch_send_cmd(ctx, command) +#define eink_display_send_data(ctx, data) \ + eink290inch_send_data(ctx, data) +#define eink_display_reset(ctx) \ + eink290inch_reset(ctx) +#define eink_display_sleep_mode(ctx) \ + eink290inch_sleep_mode(ctx) +#define eink_display_set_lut(ctx, lut, n_bytes) \ + eink290inch_set_lut(ctx, lut, n_bytes) +#define eink_display_start_config(ctx) \ + eink290inch_start_config(ctx) +#define eink_display_set_mem_pointer(ctx, x, y) \ + eink290inch_set_mem_pointer(ctx, x, y) +#define eink_display_set_mem_area(ctx, xy) \ + eink290inch_set_mem_area(ctx, xy) +#define eink_display_update_display(ctx) \ + eink290inch_update_display(ctx) +#define eink_display_fill_screen(ctx, color) \ + eink290inch_fill_screen(ctx, color) +#define eink_display_display_image(ctx, image_buffer) \ + eink290inch_display_image(ctx, image_buffer) + +typedef eink290inch_t eink_display_t; +typedef eink290inch_cfg_t eink_display_cfg_t; +typedef eink290inch_xy_t eink_display_xy_t; +#endif + // ----------------------------------------------------------------------------- // Macros // ----------------------------------------------------------------------------- -/* E-Paper Screen color */ -#define E_PAPER_SCREEN_COLOR_WHITE 0xFF -#define E_PAPER_SCREEN_COLOR_BLACK 0x00 +#define EINK_DISPLAY_OK 0 +#define EINK_DISPLAY_ERROR -1 + +/* Screen color */ +#define EINK_DISPLAY_SCREEN_COLOR_WHITE 0xFF +#define EINK_DISPLAY_SCREEN_COLOR_BLACK 0x00 -/* E-Paper Display Command */ -#define E_PAPER_CMD_DRIVER_OUTPUT_CONTROL 0x01 -#define E_PAPER_CMD_BOOSTER_SOFT_START_CONTROL 0x0C -#define E_PAPER_CMD_GATE_SCAN_START_POSITION 0x0F -#define E_PAPER_CMD_DEEP_SLEEP_MODE 0x10 -#define E_PAPER_CMD_DATA_ENTRY_MODE_SETTING 0x11 -#define E_PAPER_CMD_SW_RESET 0x12 -#define E_PAPER_CMD_TEMPERATURE_SENSOR_CONTROL 0x1A -#define E_PAPER_CMD_MASTER_ACTIVATION 0x20 -#define E_PAPER_CMD_DISPLAY_UPDATE_CONTROL_1 0x21 -#define E_PAPER_CMD_DISPLAY_UPDATE_CONTROL_2 0x22 -#define E_PAPER_CMD_WRITE_RAM 0x24 -#define E_PAPER_CMD_WRITE_VCOM_REGISTER 0x2C -#define E_PAPER_CMD_WRITE_LUT_REGISTER 0x32 -#define E_PAPER_CMD_SET_DUMMY_LINE_PERIOD 0x3A -#define E_PAPER_CMD_SET_GATE_TIME 0x3B -#define E_PAPER_CMD_BORDER_WAVEFORM_CONTROL 0x3C -#define E_PAPER_CMD_SET_RAM_X_ADDRESS_START_END_POSITION 0x44 -#define E_PAPER_CMD_SET_RAM_Y_ADDRESS_START_END_POSITION 0x45 -#define E_PAPER_CMD_SET_RAM_X_ADDRESS_COUNTER 0x4E -#define E_PAPER_CMD_SET_RAM_Y_ADDRESS_COUNTER 0x4F -#define E_PAPER_CMD_TERMINATE_FRAME_READ_WRITE 0xFF +/* Display Command */ +#define EINK_DISPLAY_CMD_DRIVER_OUTPUT_CONTROL 0x01 +#define EINK_DISPLAY_CMD_BOOSTER_SOFT_START_CONTROL 0x0C +#define EINK_DISPLAY_CMD_GATE_SCAN_START_POSITION 0x0F +#define EINK_DISPLAY_CMD_DEEP_SLEEP_MODE 0x10 +#define EINK_DISPLAY_CMD_DATA_ENTRY_MODE_SETTING 0x11 +#define EINK_DISPLAY_CMD_SW_RESET 0x12 +#define EINK_DISPLAY_CMD_TEMPERATURE_SENSOR_CONTROL 0x1A +#define EINK_DISPLAY_CMD_MASTER_ACTIVATION 0x20 +#define EINK_DISPLAY_CMD_DISPLAY_UPDATE_CONTROL_1 0x21 +#define EINK_DISPLAY_CMD_DISPLAY_UPDATE_CONTROL_2 0x22 +#define EINK_DISPLAY_CMD_WRITE_RAM 0x24 +#define EINK_DISPLAY_CMD_WRITE_VCOM_REGISTER 0x2C +#define EINK_DISPLAY_CMD_WRITE_LUT_REGISTER 0x32 +#define EINK_DISPLAY_CMD_SET_DUMMY_LINE_PERIOD 0x3A +#define EINK_DISPLAY_CMD_SET_GATE_TIME 0x3B +#define EINK_DISPLAY_CMD_BORDER_WAVEFORM_CONTROL 0x3C +#define EINK_DISPLAY_CMD_SET_RAM_X_ADDRESS_START_END_POSITION 0x44 +#define EINK_DISPLAY_CMD_SET_RAM_Y_ADDRESS_START_END_POSITION 0x45 +#define EINK_DISPLAY_CMD_SET_RAM_X_ADDRESS_COUNTER 0x4E +#define EINK_DISPLAY_CMD_SET_RAM_Y_ADDRESS_COUNTER 0x4F +#define EINK_DISPLAY_CMD_TERMINATE_FRAME_READ_WRITE 0xFF // ----------------------------------------------------------------------------- // Public Functions @@ -97,7 +200,7 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_init(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_eink_display_init(mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief @@ -116,10 +219,10 @@ sl_status_t mikroe_e_paper_154_inch_init(SPIDRV_Handle_t spi_instance); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_generic_transfer(uint8_t *wr_buf, - uint16_t wr_len, - uint8_t *rd_buf, - uint16_t rd_len); +sl_status_t mikroe_eink_display_generic_transfer(uint8_t *wr_buf, + uint16_t wr_len, + uint8_t *rd_buf, + uint16_t rd_len); /***************************************************************************//** * @brief @@ -132,7 +235,7 @@ sl_status_t mikroe_e_paper_154_inch_generic_transfer(uint8_t *wr_buf, * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_send_command(uint8_t command); +sl_status_t mikroe_eink_display_send_command(uint8_t command); /***************************************************************************//** * @brief @@ -145,7 +248,7 @@ sl_status_t mikroe_e_paper_154_inch_send_command(uint8_t command); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_send_data(uint8_t data); +sl_status_t mikroe_eink_display_send_data(uint8_t data); /***************************************************************************//** * @brief @@ -155,7 +258,7 @@ sl_status_t mikroe_e_paper_154_inch_send_data(uint8_t data); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_reset(void); +sl_status_t mikroe_eink_display_reset(void); /***************************************************************************//** * @brief @@ -165,7 +268,7 @@ sl_status_t mikroe_e_paper_154_inch_reset(void); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_sleep_mode(void); +sl_status_t mikroe_eink_display_sleep_mode(void); /***************************************************************************//** * @brief @@ -175,7 +278,7 @@ sl_status_t mikroe_e_paper_154_inch_sleep_mode(void); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_start_config(void); +sl_status_t mikroe_eink_display_start_config(void); /***************************************************************************//** * @brief @@ -190,8 +293,8 @@ sl_status_t mikroe_e_paper_154_inch_start_config(void); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_lut(const uint8_t *lut, - uint8_t n_bytes); +sl_status_t mikroe_eink_display_set_lut(const uint8_t *lut, + uint8_t n_bytes); /***************************************************************************//** * @brief @@ -206,7 +309,7 @@ sl_status_t mikroe_e_paper_154_inch_set_lut(const uint8_t *lut, * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_memory_pointer(uint8_t x, uint8_t y); +sl_status_t mikroe_eink_display_set_memory_pointer(uint8_t x, uint8_t y); /***************************************************************************//** * @brief @@ -219,7 +322,7 @@ sl_status_t mikroe_e_paper_154_inch_set_memory_pointer(uint8_t x, uint8_t y); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_memory_area(eink_154_xy_t *xy); +sl_status_t mikroe_eink_display_set_memory_area(eink_display_xy_t *xy); /***************************************************************************//** * @brief @@ -229,7 +332,7 @@ sl_status_t mikroe_e_paper_154_inch_set_memory_area(eink_154_xy_t *xy); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_update_display(); +sl_status_t mikroe_eink_display_update_display(); /***************************************************************************//** * @brief @@ -240,14 +343,14 @@ sl_status_t mikroe_e_paper_154_inch_update_display(); * @param[in] color * The color to which the screen will be colored. * Options : - * E_PAPER_SCREEN_COLOR_WHITE - * E_PAPER_SCREEN_COLOR_BLACK + * EINK_DISPLAY_SCREEN_COLOR_WHITE + * EINK_DISPLAY_SCREEN_COLOR_BLACK * * @return * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_fill_screen(uint8_t color); +sl_status_t mikroe_eink_display_fill_screen(uint8_t color); /***************************************************************************//** * @brief @@ -260,7 +363,7 @@ sl_status_t mikroe_e_paper_154_inch_fill_screen(uint8_t color); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_display_image(const uint8_t *image_buffer); +sl_status_t mikroe_eink_display_display_image(const uint8_t *image_buffer); /***************************************************************************//** * @brief @@ -273,40 +376,10 @@ sl_status_t mikroe_e_paper_154_inch_display_image(const uint8_t *image_buffer); * SL_STATUS_OK if Succeed . * SL_STATUS_FAIL if failed. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_display_image_non_blocking( - const uint8_t image_index); - -/***************************************************************************//** - * @brief - * Displays image function. - * - * @param[in] text - * Text buffer. - * @param[in] text_set - * Struct object. - * - * @return - * SL_STATUS_OK if Succeed . - * SL_STATUS_FAIL if failed. - ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_text(char *text, - eink_154_text_set_t *text_set); - -/***************************************************************************//** - * @brief - * Displays image function. - * - * @param[in] cfg_font - * Struct object. - * - * @return - * SL_STATUS_OK if Succeed . - * SL_STATUS_FAIL if failed. - ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_font(eink_154inch_font_t *cfg_font); +sl_status_t mikroe_eink_display_image_non_blocking(const uint8_t image_index); #ifdef __cplusplus } #endif -#endif /* MIKROE_E_PAPER_H_ */ +#endif // MIKROE_EINK_DISPLAY_H_ diff --git a/driver/public/mikroe/e_paper_154_inch/inc/oled_display.h b/driver/public/mikroe/eink_display/inc/oled_display.h similarity index 98% rename from driver/public/mikroe/e_paper_154_inch/inc/oled_display.h rename to driver/public/mikroe/eink_display/inc/oled_display.h index 95c98fef..96d61a67 100644 --- a/driver/public/mikroe/e_paper_154_inch/inc/oled_display.h +++ b/driver/public/mikroe/eink_display/inc/oled_display.h @@ -38,8 +38,6 @@ #include #include "sl_status.h" -#include "mikroe_e_paper_154_inch.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/e_paper_154_inch/src/mikroe_e_paper_154_inch.c b/driver/public/mikroe/eink_display/src/mikroe_eink_display.c similarity index 52% rename from driver/public/mikroe/e_paper_154_inch/src/mikroe_e_paper_154_inch.c rename to driver/public/mikroe/eink_display/src/mikroe_eink_display.c index 95fbce76..75eb73fe 100644 --- a/driver/public/mikroe/e_paper_154_inch/src/mikroe_e_paper_154_inch.c +++ b/driver/public/mikroe/eink_display/src/mikroe_eink_display.c @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_e_paper.c - * @brief SCL Mikroe E-Paper Header File + * @file mikroe_eink_display.c + * @brief SCL Mikroe eINK display * @version 1.0.0 ******************************************************************************* * # License @@ -41,16 +41,24 @@ // Includes // ----------------------------------------------------------------------------- -#include "mikroe_e_paper_154_inch.h" -#include "third_party_hw_drivers_helpers.h" -#include "mikroe_e_paper_154_inch_config.h" +#include "mikroe_eink_display.h" +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#define EINK154_DUMMY 0 +// Macro for the ESL mode +#if ESL_MODE == 1 +// Macro for the ESL display +#define EINK154_BUFFER_SIZE 200 +#include "esl_tag_image_core.h" +#include "esl_tag_core.h" +#endif +#endif // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- -static eink_154inch_t eink_ctx; -static eink_154inch_cfg_t eink_cfg; +static eink_display_t eink_ctx; +static eink_display_cfg_t eink_cfg; static bool initialized = false; // ----------------------------------------------------------------------------- @@ -60,10 +68,8 @@ static bool initialized = false; /**************************************************************************//** * E-Paper initialization. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_init(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_eink_display_init(mikroe_spi_handle_t spi_instance) { - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - if (spi_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } @@ -73,153 +79,219 @@ sl_status_t mikroe_e_paper_154_inch_init(SPIDRV_Handle_t spi_instance) } eink_ctx.spi.handle = spi_instance; - eink_154inch_cfg_setup(&eink_cfg); + eink_display_cfg_setup(&eink_cfg); - eink_cfg.dc = hal_gpio_pin_name(E_PAPER_DC_PORT, E_PAPER_DC_PIN); - eink_cfg.bsy = hal_gpio_pin_name(E_PAPER_BSY_PORT, E_PAPER_BSY_PIN); - eink_cfg.rst = hal_gpio_pin_name(E_PAPER_RST_PORT, E_PAPER_RST_PIN); +#if defined(EINK_DISPLAY_DC_PORT) && defined(EINK_DISPLAY_DC_PIN) + eink_cfg.dc = hal_gpio_pin_name(EINK_DISPLAY_DC_PORT, EINK_DISPLAY_DC_PIN); +#endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(eink_154inch_init(&eink_ctx, &eink_cfg)); - initialized = true; +#if defined(EINK_DISPLAY_BSY_PORT) && defined(EINK_DISPLAY_BSY_PIN) + eink_cfg.bsy = hal_gpio_pin_name(EINK_DISPLAY_BSY_PORT, EINK_DISPLAY_BSY_PIN); +#endif - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; -} +#if defined(EINK_DISPLAY_RST_PORT) && defined(EINK_DISPLAY_RST_PIN) + eink_cfg.rst = hal_gpio_pin_name(EINK_DISPLAY_RST_PORT, EINK_DISPLAY_RST_PIN); +#endif + +#if defined(EINK_DISPLAY_CS_PORT) && defined(EINK_DISPLAY_CS_PIN) + eink_cfg.cs = hal_gpio_pin_name(EINK_DISPLAY_CS_PORT, EINK_DISPLAY_CS_PIN); +#endif + +#if (MIKROE_EINK_DISPLAY_SPI_UC == 1) + eink_cfg.spi_speed = MIKROE_EINK_DISPLAY_SPI_UC_BITRATE; +#endif + + if (eink_display_init(&eink_ctx, &eink_cfg) != EINK_DISPLAY_OK) { + return SL_STATUS_INITIALIZATION; + } + initialized = true; -/**************************************************************************//** -* E-Paper generic transfer. -******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_generic_transfer(uint8_t *wr_buf, - uint16_t wr_len, - uint8_t *rd_buf, - uint16_t rd_len) -{ - eink_154inch_generic_transfer(&eink_ctx, wr_buf, wr_len, rd_buf, rd_len); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper send command. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_send_command(uint8_t command) +sl_status_t mikroe_eink_display_send_command(uint8_t command) { - eink154_send_command(&eink_ctx, command); + eink_display_send_command(&eink_ctx, command); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper send data. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_send_data(uint8_t data) +sl_status_t mikroe_eink_display_send_data(uint8_t data) { - eink154_send_data(&eink_ctx, data); + eink_display_send_data(&eink_ctx, data); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper reset. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_reset(void) +sl_status_t mikroe_eink_display_reset(void) { - eink154_reset(&eink_ctx); + eink_display_reset(&eink_ctx); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper sleep mode. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_sleep_mode(void) +sl_status_t mikroe_eink_display_sleep_mode(void) { - eink154_sleep_mode(&eink_ctx); + eink_display_sleep_mode(&eink_ctx); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper start config. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_start_config(void) +sl_status_t mikroe_eink_display_start_config(void) { - eink154_start_config(&eink_ctx); + eink_display_start_config(&eink_ctx); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper set lut. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_lut(const uint8_t *lut, uint8_t n_bytes) +sl_status_t mikroe_eink_display_set_lut(const uint8_t *lut, uint8_t n_bytes) { - eink154_set_lut(&eink_ctx, lut, n_bytes); + eink_display_set_lut(&eink_ctx, lut, n_bytes); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper set memory pointer. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_memory_pointer(uint8_t x, uint8_t y) +sl_status_t mikroe_eink_display_set_memory_pointer(uint8_t x, uint8_t y) { - eink154_set_memory_pointer(&eink_ctx, x, y); + eink_display_set_mem_pointer(&eink_ctx, x, y); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper set memory area. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_memory_area(eink_154_xy_t *xy) +sl_status_t mikroe_eink_display_set_memory_area(eink_display_xy_t *xy) { - eink154_set_memory_area(&eink_ctx, xy); + eink_display_set_mem_area(&eink_ctx, xy); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper update display. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_update_display(void) +sl_status_t mikroe_eink_display_update_display(void) { - eink154_update_display(&eink_ctx); + eink_display_update_display(&eink_ctx); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper fill screen. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_fill_screen(uint8_t color) +sl_status_t mikroe_eink_display_fill_screen(uint8_t color) { - eink154_fill_screen(&eink_ctx, color); + eink_display_fill_screen(&eink_ctx, color); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper display image. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_display_image(const uint8_t *image_buffer) +sl_status_t mikroe_eink_display_display_image(const uint8_t *image_buffer) { - eink154_display_image(&eink_ctx, image_buffer); + eink_display_display_image(&eink_ctx, image_buffer); return SL_STATUS_OK; } /**************************************************************************//** * E-Paper display image for ESL. ******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_display_image_non_blocking( - const uint8_t image_index) -{ - return eink154_display_image_non_blocking(&eink_ctx, image_index); -} +#if (CONFIG_EINK_DISPLAY_RESOLUTION == EINK_DISPLAY_1_54_INCH) +#if ESL_MODE == 1 +enum eink154_states { + EINK154_READY, + EINK154_INIT, + EINK154_WRITE, + EINK154_DISPLAY +}; -/**************************************************************************//** -* E-Paper text. -******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_text(char *text, - eink_154_text_set_t *text_set) -{ - eink154_text(&eink_ctx, text, text_set); - return SL_STATUS_OK; -} +static enum eink154_states eink154_machine = EINK154_READY; -/**************************************************************************//** -* E-Paper set font. -******************************************************************************/ -sl_status_t mikroe_e_paper_154_inch_set_font(eink_154inch_font_t *cfg_font) +sl_status_t mikroe_eink_display_image_non_blocking(const uint8_t image_index) { - eink154_set_font(&eink_ctx, cfg_font); - return SL_STATUS_OK; + static uint16_t section = 0; + static uint16_t offset = 0; + static eink_display_xy_t xy; + static uint16_t last_image = ESL_IMAGE_OBJECT_BASE; + sl_status_t report_status = SL_STATUS_IN_PROGRESS; + uint8_t buffer[EINK154_BUFFER_SIZE]; + + switch (eink154_machine) { + case EINK154_READY: + // Check if image is available at requested slot + report_status = esl_image_get_data(image_index, + &offset, + 0, + buffer); + + if (report_status == SL_STATUS_OK) { + // Start actual image transfer on next call only if image exists + eink154_machine = EINK154_INIT; + last_image = (uint16_t)image_index; + report_status = SL_STATUS_IN_PROGRESS; + } + break; + + case EINK154_INIT: + xy.x_start = 0; + xy.y_start = 0; + xy.x_end = MIKROE_EINK_DISPLAY_WIDTH - 1; + xy.y_end = MIKROE_EINK_DISPLAY_HEIGHT - 1; + + mikroe_eink_display_set_memory_area(&xy); + mikroe_eink_display_set_memory_pointer(0, 0); + + mikroe_eink_display_send_command(EINK_DISPLAY_CMD_WRITE_RAM); + + offset = 0; + section = 0; + + eink154_machine = EINK154_WRITE; + break; + + case EINK154_WRITE: + report_status = esl_image_get_data(last_image, &offset, 200, buffer); + if (report_status == SL_STATUS_OK) { + for (uint8_t i = 0; i < 200; i++) { + mikroe_eink_display_send_data(buffer[i] ^ 0xFF); + } + report_status = SL_STATUS_IN_PROGRESS; + section++; + if (section >= 25) { + eink154_machine = EINK154_DISPLAY; + } + } else { + eink154_machine = EINK154_READY; + } + + break; + + case EINK154_DISPLAY: + report_status = SL_STATUS_OK; + mikroe_eink_display_update_display(); + eink154_machine = EINK154_READY; + + break; + } + + return report_status; } + +#endif +#endif +// End of the modification diff --git a/driver/public/mikroe/e_paper_154_inch/src/oled_display.c b/driver/public/mikroe/eink_display/src/oled_display.c similarity index 81% rename from driver/public/mikroe/e_paper_154_inch/src/oled_display.c rename to driver/public/mikroe/eink_display/src/oled_display.c index 18ed6900..fdbd1ec4 100644 --- a/driver/public/mikroe/e_paper_154_inch/src/oled_display.c +++ b/driver/public/mikroe/eink_display/src/oled_display.c @@ -33,13 +33,13 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ #include -#include "mikroe_e_paper_154_inch_config.h" -#include "mikroe_e_paper_154_inch.h" +#include "mikroe_eink_display_config.h" +#include "mikroe_eink_display.h" #include "oled_display.h" /* This oled_frame_buffer is large enough to store one full frame. */ -static uint8_t oled_frame_buffer[(MIKROE_E_PAPER_WIDTH - * MIKROE_E_PAPER_HEIGHT) / 8]; +static uint8_t oled_frame_buffer[(MIKROE_EINK_DISPLAY_WIDTH + * MIKROE_EINK_DISPLAY_HEIGHT) / 8]; static sl_status_t driver_init(void); static sl_status_t draw_pixel(int16_t x, int16_t y, uint16_t color); @@ -72,8 +72,8 @@ static bool initialized = false; sl_status_t oled_display_init(void) { - oled_display_instance.width = MIKROE_E_PAPER_WIDTH; - oled_display_instance.height = MIKROE_E_PAPER_HEIGHT; + oled_display_instance.width = MIKROE_EINK_DISPLAY_WIDTH; + oled_display_instance.height = MIKROE_EINK_DISPLAY_HEIGHT; oled_display_instance.driver = &sl_memlcd_driver_api; initialized = true; return SL_STATUS_OK; @@ -84,9 +84,9 @@ static sl_status_t draw_pixel(int16_t x, int16_t y, uint16_t color) uint16_t off; uint16_t pos; - if ((x >= 0) && (x < MIKROE_E_PAPER_WIDTH) && (y >= 0) - && (y < MIKROE_E_PAPER_HEIGHT)) { - pos = (y * (MIKROE_E_PAPER_WIDTH / 8)) + (x / 8); + if ((x >= 0) && (x < MIKROE_EINK_DISPLAY_WIDTH) && (y >= 0) + && (y < MIKROE_EINK_DISPLAY_HEIGHT)) { + pos = (y * (MIKROE_EINK_DISPLAY_WIDTH / 8)) + (x / 8); off = 7 - (x % 8); oled_frame_buffer[pos] &= ~(0x01 << off); oled_frame_buffer[pos] |= ((color & 0x01) << off); @@ -107,22 +107,22 @@ static sl_status_t fill_screen(uint16_t color) static sl_status_t update_display(void) { - eink_154_xy_t xy; + eink_display_xy_t xy; xy.x_start = 0; xy.y_start = 0; - xy.x_end = MIKROE_E_PAPER_WIDTH - 1; - xy.y_end = MIKROE_E_PAPER_HEIGHT - 1; + xy.x_end = MIKROE_EINK_DISPLAY_WIDTH - 1; + xy.y_end = MIKROE_EINK_DISPLAY_HEIGHT - 1; - mikroe_e_paper_154_inch_set_memory_area(&xy); - mikroe_e_paper_154_inch_set_memory_pointer(0, 0); - mikroe_e_paper_154_inch_send_command(E_PAPER_CMD_WRITE_RAM); + mikroe_eink_display_set_memory_area(&xy); + mikroe_eink_display_set_memory_pointer(0, 0); + mikroe_eink_display_send_command(EINK_DISPLAY_CMD_WRITE_RAM); for (uint16_t i = 0; i < sizeof(oled_frame_buffer); i++ ) { - mikroe_e_paper_154_inch_send_data(oled_frame_buffer[i]); + mikroe_eink_display_send_data(oled_frame_buffer[i]); } - return mikroe_e_paper_154_inch_update_display(); + return mikroe_eink_display_update_display(); } const oled_display_t *oled_display_get(void) diff --git a/driver/public/mikroe/emg/config/brd2703a/mikroe_emg_config.h b/driver/public/mikroe/emg/config/brd2703a/mikroe_emg_config.h index 912b8f8c..86d4993b 100644 --- a/driver/public/mikroe/emg/config/brd2703a/mikroe_emg_config.h +++ b/driver/public/mikroe/emg/config/brd2703a/mikroe_emg_config.h @@ -40,6 +40,8 @@ #ifndef MIKORE_EMG_CONFIG_H_ #define MIKORE_EMG_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/emg/config/brd4108a/mikroe_emg_config.h b/driver/public/mikroe/emg/config/brd4108a/mikroe_emg_config.h index 912b8f8c..86d4993b 100644 --- a/driver/public/mikroe/emg/config/brd4108a/mikroe_emg_config.h +++ b/driver/public/mikroe/emg/config/brd4108a/mikroe_emg_config.h @@ -40,6 +40,8 @@ #ifndef MIKORE_EMG_CONFIG_H_ #define MIKORE_EMG_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/emg/config/brd4314a/mikroe_emg_config.h b/driver/public/mikroe/emg/config/brd4314a/mikroe_emg_config.h index 912b8f8c..86d4993b 100644 --- a/driver/public/mikroe/emg/config/brd4314a/mikroe_emg_config.h +++ b/driver/public/mikroe/emg/config/brd4314a/mikroe_emg_config.h @@ -40,6 +40,8 @@ #ifndef MIKORE_EMG_CONFIG_H_ #define MIKORE_EMG_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/emg/config/brd4338a/mikroe_emg_config.h b/driver/public/mikroe/emg/config/brd4338a/mikroe_emg_config.h new file mode 100644 index 00000000..916e3067 --- /dev/null +++ b/driver/public/mikroe/emg/config/brd4338a/mikroe_emg_config.h @@ -0,0 +1,43 @@ +/***************************************************************************//** + * @file mikroe_emg_config.h + * @brief Mikroe EMG Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKORE_EMG_CONFIG_H_ +#define MIKORE_EMG_CONFIG_H_ + +#endif /* MIKORE_EMG_CONFIG_H_ */ diff --git a/driver/public/mikroe/emg/config/other/mikroe_emg_config.h b/driver/public/mikroe/emg/config/other/mikroe_emg_config.h index c17ef160..3be131bb 100644 --- a/driver/public/mikroe/emg/config/other/mikroe_emg_config.h +++ b/driver/public/mikroe/emg/config/other/mikroe_emg_config.h @@ -40,6 +40,10 @@ #ifndef MIKORE_EMG_CONFIG_H_ #define MIKORE_EMG_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/emg/inc/mikroe_emg.h b/driver/public/mikroe/emg/inc/mikroe_emg.h index a1281525..be0ff596 100644 --- a/driver/public/mikroe/emg/inc/mikroe_emg.h +++ b/driver/public/mikroe/emg/inc/mikroe_emg.h @@ -40,49 +40,13 @@ #ifndef MIKROE_EMG_H_ #define MIKROE_EMG_H_ -#include "em_cmu.h" #include "sl_status.h" - -#if defined(_SILICON_LABS_32B_SERIES_1) -#include "em_adc.h" -typedef ADC_TypeDef adc_t; -#elif defined(_SILICON_LABS_32B_SERIES_2) -#include "em_iadc.h" -typedef IADC_TypeDef adc_t; -#endif +#include "drv_analog_in.h" #ifdef __cplusplus extern "C" { #endif -/***************************************************************************//** - * @addtogroup EMG - * @brief Driver for the Mikroe EMG Click - * - * - * @n @section emg_example EMG example - * - * Basic example for performing EMG measurement: @n @n - * @code{.c} - * - * #include "app_log.h" - * #include "mikroe_emg.h" - * - * int main(void) - * { - * uint16_t adc_value; - * ... - * - * mikroe_emg_init(IADC0); - * mikroe_emg_read_an_pin_value(&adc_value); - * - * ... - * - * } @endverbatim - * - * @{ - ******************************************************************************/ - /**************************************************************************//** * @brief EMG initialization function. * @details This function initializes all necessary pins and peripherals used @@ -94,7 +58,7 @@ extern "C" { * @return SL_STATUS_OK on Success, otherwise on failure. * ******************************************************************************/ -sl_status_t mikroe_emg_init(adc_t *adc); +sl_status_t mikroe_emg_init(mikroe_adc_handle_t handle); /**************************************************************************//** * @brief EMG read AN pin value function. diff --git a/driver/public/mikroe/emg/src/mikroe_emg.c b/driver/public/mikroe/emg/src/mikroe_emg.c index bbe0fcfd..5693be13 100644 --- a/driver/public/mikroe/emg/src/mikroe_emg.c +++ b/driver/public/mikroe/emg/src/mikroe_emg.c @@ -41,21 +41,17 @@ #include "emg.h" #include "mikroe_emg.h" #include "mikroe_emg_config.h" -#include "third_party_hw_drivers_helpers.h" static emg_t emg; static emg_cfg_t emg_cfg; -sl_status_t mikroe_emg_init(adc_t *adc) +sl_status_t mikroe_emg_init(mikroe_adc_handle_t handle) { - if (NULL == adc) { + if (NULL == handle) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - - emg.adc.handle = adc; - + emg.adc.handle = handle; emg_cfg_setup(&emg_cfg); #if defined(EMG_ANALOG_OUTPUT_PORT) && defined(EMG_ANALOG_OUTPUT_PIN) @@ -63,9 +59,11 @@ sl_status_t mikroe_emg_init(adc_t *adc) EMG_ANALOG_OUTPUT_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(emg_init(&emg, &emg_cfg)); + if (emg_init(&emg, &emg_cfg) != EMG_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } sl_status_t mikroe_emg_read_an_pin_value(uint16_t *data_out) diff --git a/driver/public/mikroe/environment2_sht40_sgp40/config/mikroe_sht40_sgp40_config.h b/driver/public/mikroe/environment2_sht40_sgp40/config/mikroe_sht40_sgp40_config.h new file mode 100644 index 00000000..80ffad47 --- /dev/null +++ b/driver/public/mikroe/environment2_sht40_sgp40/config/mikroe_sht40_sgp40_config.h @@ -0,0 +1,70 @@ +/***************************************************************************/ /** + * @file mikroe_sht40_sgp40_config.h + * @brief Mikroe SHT40 and SGP40 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SHT40_SGP40_CONFIG_H +#define MIKROE_SHT40_SGP40_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE I2C SHT40_SGP40 Configuration + +// MIKROE I2C SHT40_SGP40 UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_I2C_SHT40_SGP40_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_I2C_SHT40_SGP40_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_SHT40_SGP40_CONFIG_H diff --git a/driver/public/mikroe/environment2_sht40_sgp40/inc/mikroe_sht40_sgp40.h b/driver/public/mikroe/environment2_sht40_sgp40/inc/mikroe_sht40_sgp40.h index 8e499bd6..cb02b59f 100644 --- a/driver/public/mikroe/environment2_sht40_sgp40/inc/mikroe_sht40_sgp40.h +++ b/driver/public/mikroe/environment2_sht40_sgp40/inc/mikroe_sht40_sgp40.h @@ -44,9 +44,9 @@ extern "C" { #endif -#include "environment2.h" #include "sl_status.h" -#include "sl_i2cspm.h" +#include "environment2.h" +#include "drv_i2c_master.h" /*! * @addtogroup environment2 Environment 2 Click Driver @@ -220,7 +220,7 @@ typedef environment2_voc_algorithm_params * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_environment2_init (sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_environment2_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/environment2_sht40_sgp40/src/mikroe_sht40_sgp40.c b/driver/public/mikroe/environment2_sht40_sgp40/src/mikroe_sht40_sgp40.c index 36824eb1..7fece5b4 100644 --- a/driver/public/mikroe/environment2_sht40_sgp40/src/mikroe_sht40_sgp40.c +++ b/driver/public/mikroe/environment2_sht40_sgp40/src/mikroe_sht40_sgp40.c @@ -38,12 +38,12 @@ ******************************************************************************/ #include "mikroe_sht40_sgp40.h" -#include "drv_i2c_master.h" +#include "mikroe_sht40_sgp40_config.h" static environment2_t environment2; // ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS -sl_status_t mikroe_environment2_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_environment2_init(mikroe_i2c_handle_t i2cspm_instance) { environment2_cfg_t environment2_cfg; @@ -56,13 +56,18 @@ sl_status_t mikroe_environment2_init(sl_i2cspm_t *i2cspm_instance) // Call basic setup functions environment2_cfg_setup(&environment2_cfg); + +#if (MIKROE_I2C_SHT40_SGP40_UC == 1) + environment2_cfg.i2c_speed = MIKROE_I2C_SHT40_SGP40_SPEED_MODE; +#endif + if (I2C_MASTER_SUCCESS != environment2_init(&environment2, &environment2_cfg)) { - return SL_STATUS_FAIL; - } else { - return (ENVIRONMENT2_OK == environment2_config_sensors()) - ? SL_STATUS_OK : SL_STATUS_FAIL; + return SL_STATUS_INITIALIZATION; } + + return (ENVIRONMENT2_OK == environment2_config_sensors()) + ? SL_STATUS_OK : SL_STATUS_FAIL; } sl_status_t mikroe_environment2_generic_write( diff --git a/driver/public/mikroe/eth_wiz_w5500/config/brd2703a/mikroe_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/brd2703a/mikroe_w5500_config.h index 3d7d355d..1eb155ac 100644 --- a/driver/public/mikroe/eth_wiz_w5500/config/brd2703a/mikroe_w5500_config.h +++ b/driver/public/mikroe/eth_wiz_w5500/config/brd2703a/mikroe_w5500_config.h @@ -39,11 +39,27 @@ #ifndef Wx500_CONFIG_H_ #define Wx500_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_W5500 SPI Configuration + +// MIKROE_W5500 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_W5500_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_W5500_SPI_BITRATE 10000000 + +// +// // Use ethernet large buffer // @@ -71,10 +87,24 @@ extern "C" { // W5500_RESET // $[GPIO_W5500_RESET] -#define W5500_RESET_PORT gpioPortC -#define W5500_RESET_PIN 8 +#ifndef W5500_RESET_PORT +#define W5500_RESET_PORT gpioPortC +#endif +#ifndef W5500_RESET_PIN +#define W5500_RESET_PIN 8 +#endif // [GPIO_W5500_RESET]$ +// MIKROE_W5500_CS +// $[GPIO_MIKROE_W5500_CS] +#ifndef MIKROE_W5500_CS_PORT +#define MIKROE_W5500_CS_PORT gpioPortC +#endif +#ifndef MIKROE_W5500_CS_PIN +#define MIKROE_W5500_CS_PIN 0 +#endif +// [GPIO_MIKROE_W5500_CS]$ + // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/mikroe/eth_wiz_w5500/config/brd2703a/sl_spidrv_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/brd2703a/sl_spidrv_w5500_config.h deleted file mode 100644 index 0184416d..00000000 --- a/driver/public/mikroe/eth_wiz_w5500/config/brd2703a/sl_spidrv_w5500_config.h +++ /dev/null @@ -1,88 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_W5500_CONFIG_H -#define SL_SPIDRV_W5500_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_W5500_BITRATE 10000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_W5500_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_W5500_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_W5500_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_W5500_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_W5500_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_W5500_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_W5500 -// $[USART_SL_SPIDRV_W5500] -#define SL_SPIDRV_W5500_PERIPHERAL USART0 -#define SL_SPIDRV_W5500_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_W5500_TX_PORT gpioPortC -#define SL_SPIDRV_W5500_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_W5500_RX_PORT gpioPortC -#define SL_SPIDRV_W5500_RX_PIN 2 - -// USART0 CLK on PC02 -#define SL_SPIDRV_W5500_CLK_PORT gpioPortC -#define SL_SPIDRV_W5500_CLK_PIN 1 - -// USART0 CS on PC03 -#define SL_SPIDRV_W5500_CS_PORT gpioPortC -#define SL_SPIDRV_W5500_CS_PIN 0 -// [USART_SL_SPIDRV_W5500]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_W5500_CONFIG_H diff --git a/driver/public/mikroe/eth_wiz_w5500/config/brd4108a/mikroe_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/brd4108a/mikroe_w5500_config.h index c1c9358e..af6cc9a3 100644 --- a/driver/public/mikroe/eth_wiz_w5500/config/brd4108a/mikroe_w5500_config.h +++ b/driver/public/mikroe/eth_wiz_w5500/config/brd4108a/mikroe_w5500_config.h @@ -39,11 +39,27 @@ #ifndef Wx500_CONFIG_H_ #define Wx500_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_W5500 SPI Configuration + +// MIKROE_W5500 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_W5500_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_W5500_SPI_BITRATE 10000000 + +// +// // Use ethernet large buffer // @@ -71,10 +87,24 @@ extern "C" { // W5500_RESET // $[GPIO_W5500_RESET] -#define W5500_RESET_PORT gpioPortC -#define W5500_RESET_PIN 6 +#ifndef W5500_RESET_PORT +#define W5500_RESET_PORT gpioPortC +#endif +#ifndef W5500_RESET_PIN +#define W5500_RESET_PIN 6 +#endif // [GPIO_W5500_RESET]$ +// MIKROE_W5500_CS +// $[GPIO_MIKROE_W5500_CS] +#ifndef MIKROE_W5500_CS_PORT +#define MIKROE_W5500_CS_PORT gpioPortC +#endif +#ifndef MIKROE_W5500_CS_PIN +#define MIKROE_W5500_CS_PIN 3 +#endif +// [GPIO_MIKROE_W5500_CS]$ + // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/mikroe/eth_wiz_w5500/config/brd4108a/sl_spidrv_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/brd4108a/sl_spidrv_w5500_config.h deleted file mode 100644 index 9effb602..00000000 --- a/driver/public/mikroe/eth_wiz_w5500/config/brd4108a/sl_spidrv_w5500_config.h +++ /dev/null @@ -1,88 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_W5500_CONFIG_H -#define SL_SPIDRV_W5500_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_W5500_BITRATE 10000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_W5500_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_W5500_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_W5500_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_W5500_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_W5500_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_W5500_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_W5500 -// $[USART_SL_SPIDRV_W5500] -#define SL_SPIDRV_W5500_PERIPHERAL USART0 -#define SL_SPIDRV_W5500_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_W5500_TX_PORT gpioPortC -#define SL_SPIDRV_W5500_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_W5500_RX_PORT gpioPortC -#define SL_SPIDRV_W5500_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_W5500_CLK_PORT gpioPortC -#define SL_SPIDRV_W5500_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_W5500_CS_PORT gpioPortC -#define SL_SPIDRV_W5500_CS_PIN 3 -// [USART_SL_SPIDRV_W5500]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_W5500_CONFIG_H diff --git a/driver/public/mikroe/eth_wiz_w5500/config/brd4314a/mikroe_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/brd4314a/mikroe_w5500_config.h index c1c9358e..af6cc9a3 100644 --- a/driver/public/mikroe/eth_wiz_w5500/config/brd4314a/mikroe_w5500_config.h +++ b/driver/public/mikroe/eth_wiz_w5500/config/brd4314a/mikroe_w5500_config.h @@ -39,11 +39,27 @@ #ifndef Wx500_CONFIG_H_ #define Wx500_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_W5500 SPI Configuration + +// MIKROE_W5500 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_W5500_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_W5500_SPI_BITRATE 10000000 + +// +// // Use ethernet large buffer // @@ -71,10 +87,24 @@ extern "C" { // W5500_RESET // $[GPIO_W5500_RESET] -#define W5500_RESET_PORT gpioPortC -#define W5500_RESET_PIN 6 +#ifndef W5500_RESET_PORT +#define W5500_RESET_PORT gpioPortC +#endif +#ifndef W5500_RESET_PIN +#define W5500_RESET_PIN 6 +#endif // [GPIO_W5500_RESET]$ +// MIKROE_W5500_CS +// $[GPIO_MIKROE_W5500_CS] +#ifndef MIKROE_W5500_CS_PORT +#define MIKROE_W5500_CS_PORT gpioPortC +#endif +#ifndef MIKROE_W5500_CS_PIN +#define MIKROE_W5500_CS_PIN 3 +#endif +// [GPIO_MIKROE_W5500_CS]$ + // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/mikroe/eth_wiz_w5500/config/brd4314a/sl_spidrv_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/brd4314a/sl_spidrv_w5500_config.h deleted file mode 100644 index 9effb602..00000000 --- a/driver/public/mikroe/eth_wiz_w5500/config/brd4314a/sl_spidrv_w5500_config.h +++ /dev/null @@ -1,88 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_W5500_CONFIG_H -#define SL_SPIDRV_W5500_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_W5500_BITRATE 10000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_W5500_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_W5500_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_W5500_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_W5500_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_W5500_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_W5500_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_W5500 -// $[USART_SL_SPIDRV_W5500] -#define SL_SPIDRV_W5500_PERIPHERAL USART0 -#define SL_SPIDRV_W5500_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_W5500_TX_PORT gpioPortC -#define SL_SPIDRV_W5500_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_W5500_RX_PORT gpioPortC -#define SL_SPIDRV_W5500_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_W5500_CLK_PORT gpioPortC -#define SL_SPIDRV_W5500_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_W5500_CS_PORT gpioPortC -#define SL_SPIDRV_W5500_CS_PIN 3 -// [USART_SL_SPIDRV_W5500]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_W5500_CONFIG_H diff --git a/driver/public/mikroe/eth_wiz_w5500/config/brd4338a/mikroe_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/brd4338a/mikroe_w5500_config.h new file mode 100644 index 00000000..4d2211a4 --- /dev/null +++ b/driver/public/mikroe/eth_wiz_w5500/config/brd4338a/mikroe_w5500_config.h @@ -0,0 +1,111 @@ +/***************************************************************************//** + * @file w5x00_config.h + * @brief Wiznet w5x00 config. + * @version 0.0.1 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef Wx500_CONFIG_H_ +#define Wx500_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_W5500 SPI Configuration + +// MIKROE_W5500 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_W5500_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_W5500_SPI_BITRATE 10000000 + +// +// + +// Use ethernet large buffer +// +// By default, each socket uses 2K buffers inside the Wiznet chip. +// If W5x00_MAX_SOCK_NUM is set to fewer than the chip's maximum, uncommenting +// this will use larger buffers within the Wiznet chip. Large buffers +// can really help with UDP protocols like Artnet. In theory larger +// buffers should allow faster TCP over high-latency links, but this +// does not always seem to work in practice (maybe Wiznet bugs?) +// Default: 0 +#define W5x00_ETHERNET_LARGE_BUFFERS_ENABLE 0 + +// HTTP Server debug message enable +// +// Default: 0 +#define W5x00_HTTP_SERVER_DEBUG_ENABLE 0 + +// HTTP server buffer size configuration <1024-10240> +// Default: 1024 +#define W5x00_HTTP_SERVER_BUFFER_SIZE 1024 + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// W5500_RESET +// $[GPIO_W5500_RESET] +#ifndef W5500_RESET_PORT +#define W5500_RESET_PORT HP +#endif +#ifndef W5500_RESET_PIN +#define W5500_RESET_PIN 46 +#endif +// [GPIO_W5500_RESET]$ + +// MIKROE_W5500_CS +// $[GPIO_MIKROE_W5500_CS] +#ifndef MIKROE_W5500_CS_PORT +#define MIKROE_W5500_CS_PORT HP +#endif +#ifndef MIKROE_W5500_CS_PIN +#define MIKROE_W5500_CS_PIN 47 +#endif +// [GPIO_MIKROE_W5500_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif /* Wx500_CONFIG_H_ */ diff --git a/driver/public/mikroe/eth_wiz_w5500/config/other/mikroe_w5500_config.h b/driver/public/mikroe/eth_wiz_w5500/config/other/mikroe_w5500_config.h index f5cd6adf..43f286ea 100644 --- a/driver/public/mikroe/eth_wiz_w5500/config/other/mikroe_w5500_config.h +++ b/driver/public/mikroe/eth_wiz_w5500/config/other/mikroe_w5500_config.h @@ -39,11 +39,29 @@ #ifndef Wx500_CONFIG_H_ #define Wx500_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_W5500 SPI Configuration + +// MIKROE_W5500 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_W5500_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_W5500_SPI_BITRATE 10000000 + +// +// // Use ethernet large buffer // @@ -72,10 +90,25 @@ extern "C" { // W5500_RESET // $[GPIO_W5500_RESET] #warning "GPIO_W5500_RESET is not configured" -// #define W5500_RESET_PORT gpioPortC -// #define W5500_RESET_PIN 8 +//fndef W5500_RESET_PORT +//#define W5500_RESET_PORT 0 +//#endif +//#ifndef W5500_RESET_PIN +//#define W5500_RESET_PIN 46 +//#endif // [GPIO_W5500_RESET]$ +// MIKROE_W5500_CS +// $[GPIO_MIKROE_W5500_CS] +#warning "GPIO_MIKROE_W5500_CS is not configured" +//#ifndef MIKROE_W5500_CS_PORT +//#define MIKROE_W5500_CS_PORT 0 +//#endif +//#ifndef MIKROE_W5500_CS_PIN +//#define MIKROE_W5500_CS_PIN 47 +//#endif +// [GPIO_MIKROE_W5500_CS]$ + // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/mikroe/eth_wiz_w5500/inc/w5x00.h b/driver/public/mikroe/eth_wiz_w5500/inc/w5x00.h index 79dd233e..5c53f529 100644 --- a/driver/public/mikroe/eth_wiz_w5500/inc/w5x00.h +++ b/driver/public/mikroe/eth_wiz_w5500/inc/w5x00.h @@ -321,7 +321,7 @@ static inline uint16_t w5x00_writeSn_buf(w5x00_socket_t s, } #define w5x00_get_socket_tx_max_size(sn) \ - (((uint16_t)w5x00_readSnTX_SIZE(sn)) << 10) + (((uint16_t)w5x00_readSnTX_SIZE(sn)) << 10) /***************************************************************************//** * @brief @@ -443,7 +443,7 @@ void w5x00_exec_cmd_socket(w5x00_socket_t s, uint8_t cmd); * @return * true on success, false on failure ******************************************************************************/ -bool w5x00_init(SPIDRV_Handle_t handle); +bool w5x00_init(mikroe_spi_handle_t handle); /***************************************************************************//** * @brief @@ -456,35 +456,35 @@ uint8_t w5x00_soft_reset(void); /** @cond hidden */ // ----------------------------------------------------------------------------- // Common Registers IOMAP -#define __GP_REGISTER8(name, address) \ - static inline uint16_t w5x00_write##name(uint8_t data) { \ - uint8_t bw = data; \ - return w5x00_write(address, &bw, 1); \ - } \ - static inline uint8_t w5x00_read##name() { \ - uint8_t br; \ - w5x00_read(address, &br, 1); \ - return br; \ - } -#define __GP_REGISTER16(name, address) \ - static inline void w5x00_write##name(uint16_t _data) { \ - uint8_t buf[2]; \ - buf[0] = _data >> 8; \ - buf[1] = _data & 0xFF; \ - w5x00_write(address, buf, 2); \ - } \ - static inline uint16_t w5x00_read##name() { \ - uint8_t buf[2]; \ - w5x00_read(address, buf, 2); \ - return (buf[0] << 8) | buf[1]; \ - } +#define __GP_REGISTER8(name, address) \ + static inline uint16_t w5x00_write ## name(uint8_t data) { \ + uint8_t bw = data; \ + return w5x00_write(address, &bw, 1); \ + } \ + static inline uint8_t w5x00_read ## name() { \ + uint8_t br; \ + w5x00_read(address, &br, 1); \ + return br; \ + } +#define __GP_REGISTER16(name, address) \ + static inline void w5x00_write ## name(uint16_t _data) { \ + uint8_t buf[2]; \ + buf[0] = _data >> 8; \ + buf[1] = _data & 0xFF; \ + w5x00_write(address, buf, 2); \ + } \ + static inline uint16_t w5x00_read ## name() { \ + uint8_t buf[2]; \ + w5x00_read(address, buf, 2); \ + return (buf[0] << 8) | buf[1]; \ + } #define __GP_REGISTER_N(name, address, size) \ - static inline uint16_t w5x00_write##name(const uint8_t *_buff) { \ - return w5x00_write(address, _buff, size); \ - } \ - static inline uint16_t w5x00_read##name(uint8_t *_buff) { \ - return w5x00_read(address, _buff, size); \ - } + static inline uint16_t w5x00_write ## name(const uint8_t * _buff) { \ + return w5x00_write(address, _buff, size); \ + } \ + static inline uint16_t w5x00_read ## name(uint8_t * _buff) { \ + return w5x00_read(address, _buff, size); \ + } __GP_REGISTER8(MR, 0x0000); // Mode __GP_REGISTER_N(GAR, 0x0001, 4); // Gateway IP address @@ -526,36 +526,36 @@ __GP_REGISTER16(PMRU, 0x0026); // PPP Maximum Segment Size // ----------------------------------------------------------------------------- // Socket Registers IOMAP -#define __SOCKET_REGISTER8(name, address) \ - static inline void w5x00_write ## name(w5x00_socket_t _s, \ - uint8_t _data) { \ - w5x00_writeSn(_s, address, _data); \ - } \ - static inline uint8_t w5x00_read ## name(w5x00_socket_t _s) { \ - return w5x00_readSn(_s, address); \ - } -#define __SOCKET_REGISTER16(name, address) \ - static inline void w5x00_write ## name(w5x00_socket_t _s, \ - uint16_t _data) { \ - uint8_t buf[2]; \ - buf[0] = _data >> 8; \ - buf[1] = _data & 0xFF; \ - w5x00_writeSn_buf(_s, address, buf, 2); \ - } \ - static inline uint16_t w5x00_read ## name(w5x00_socket_t _s) { \ - uint8_t buf[2]; \ - w5x00_readSn_buf(_s, address, buf, 2); \ - return (buf[0] << 8) | buf[1]; \ - } -#define __SOCKET_REGISTER_N(name, address, size) \ - static inline uint16_t w5x00_write ## name(w5x00_socket_t _s, \ - uint8_t * _buff) { \ - return w5x00_writeSn_buf(_s, address, _buff, size); \ - } \ - static inline uint16_t w5x00_read ## name(w5x00_socket_t _s, \ - uint8_t * _buff) { \ - return w5x00_readSn_buf(_s, address, _buff, size); \ - } +#define __SOCKET_REGISTER8(name, address) \ + static inline void w5x00_write ## name(w5x00_socket_t _s, \ + uint8_t _data) { \ + w5x00_writeSn(_s, address, _data); \ + } \ + static inline uint8_t w5x00_read ## name(w5x00_socket_t _s) { \ + return w5x00_readSn(_s, address); \ + } +#define __SOCKET_REGISTER16(name, address) \ + static inline void w5x00_write ## name(w5x00_socket_t _s, \ + uint16_t _data) { \ + uint8_t buf[2]; \ + buf[0] = _data >> 8; \ + buf[1] = _data & 0xFF; \ + w5x00_writeSn_buf(_s, address, buf, 2); \ + } \ + static inline uint16_t w5x00_read ## name(w5x00_socket_t _s) { \ + uint8_t buf[2]; \ + w5x00_readSn_buf(_s, address, buf, 2); \ + return (buf[0] << 8) | buf[1]; \ + } +#define __SOCKET_REGISTER_N(name, address, size) \ + static inline uint16_t w5x00_write ## name(w5x00_socket_t _s, \ + uint8_t * _buff) { \ + return w5x00_writeSn_buf(_s, address, _buff, size); \ + } \ + static inline uint16_t w5x00_read ## name(w5x00_socket_t _s, \ + uint8_t * _buff) { \ + return w5x00_readSn_buf(_s, address, _buff, size); \ + } __SOCKET_REGISTER8(SnMR, 0x0000) // Mode __SOCKET_REGISTER8(SnCR, 0x0001) // Command diff --git a/driver/public/mikroe/eth_wiz_w5500/inc/w5x00_platform.h b/driver/public/mikroe/eth_wiz_w5500/inc/w5x00_platform.h index 802264c9..899c219a 100644 --- a/driver/public/mikroe/eth_wiz_w5500/inc/w5x00_platform.h +++ b/driver/public/mikroe/eth_wiz_w5500/inc/w5x00_platform.h @@ -41,11 +41,10 @@ #define W5x00_PLATFORM_H_ #include "sl_status.h" -#include "sl_udelay.h" -#include "spidrv.h" #include "sl_sleeptimer.h" #include "mikroe_w5500_config.h" #include "w5x00_common.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -71,14 +70,14 @@ extern "C" { ******************************************************************************/ #ifdef W5x00_LOG_ENABLE #define w5x00_log_info(tag, fmt, ...) \ - w5x00_log_printf("[ I: %s ] " fmt, tag, ## __VA_ARGS__) + w5x00_log_printf("[ I: %s ] " fmt, tag, ## __VA_ARGS__) #define w5x00_log_error(tag, fmt, ...) \ - w5x00_log_printf("[ E: %s ] " fmt, tag, ## __VA_ARGS__) -#define w5x00_log_print_ip(ip) \ - w5x00_log_printf("%d.%d.%d.%d", w5x00_ip4_addr_get_byte(ip, 0), \ - w5x00_ip4_addr_get_byte(ip, 1), \ - w5x00_ip4_addr_get_byte(ip, 2), \ - w5x00_ip4_addr_get_byte(ip, 3)) + w5x00_log_printf("[ E: %s ] " fmt, tag, ## __VA_ARGS__) +#define w5x00_log_print_ip(ip) \ + w5x00_log_printf("%d.%d.%d.%d", w5x00_ip4_addr_get_byte(ip, 0), \ + w5x00_ip4_addr_get_byte(ip, 1), \ + w5x00_ip4_addr_get_byte(ip, 2), \ + w5x00_ip4_addr_get_byte(ip, 3)) #else #define w5x00_log_printf(...) #define w5x00_log_info(...) @@ -86,15 +85,6 @@ extern "C" { #define w5x00_log_print_ip(ip) #endif // #ifdef W5x00_LOG_ENABLE -/***************************************************************************//** - * @brief - * Delay microseconds - * @param[in] us - * Microseconds - ******************************************************************************/ -#define w5x00_delay_us(us) \ - sl_udelay_wait(us) - /***************************************************************************//** * @brief * Delay milliseconds @@ -102,7 +92,7 @@ extern "C" { * Milliseconds ******************************************************************************/ #define w5x00_delay_ms(ms) \ - sl_sleeptimer_delay_millisecond(ms) + sl_sleeptimer_delay_millisecond(ms) /***************************************************************************//** * @brief @@ -111,7 +101,7 @@ extern "C" { * Current tick count ******************************************************************************/ #define w5x00_get_tick_count() \ - sl_sleeptimer_get_tick_count() + sl_sleeptimer_get_tick_count() /***************************************************************************//** * @brief @@ -120,7 +110,7 @@ extern "C" { * Current tick count in milliseconds ******************************************************************************/ #define w5x00_get_tick_ms() \ - sl_sleeptimer_tick_to_ms(sl_sleeptimer_get_tick_count()) + sl_sleeptimer_tick_to_ms(sl_sleeptimer_get_tick_count()) /***************************************************************************//** * @brief @@ -151,7 +141,7 @@ long w5x00_random(long howbig); * @brief * Init platform bus ******************************************************************************/ -void w5x00_bus_init(SPIDRV_Handle_t handle); +void w5x00_bus_init(mikroe_spi_handle_t handle); /***************************************************************************//** * @brief @@ -167,16 +157,23 @@ void w5x00_bus_deselect(void); /***************************************************************************//** * @brief - * Read from SPI bus - * @param[out] buf - * Pointer to the read buffer - * @param len + * Write data then Read data from SPI bus + * @param[in] write_data_buffer + * Pointer to the write data buffer + * @param length_write_data + * Number of byte to be write + * @param[out] read_data_buffer + * Pointer to the read data buffer + * @param length_read_data * Number of byte to be read * @return * 0 on success * non-zero on failure ******************************************************************************/ -uint32_t w5x00_bus_read(uint8_t *buf, uint16_t len); +uint32_t w5x00_bus_write_then_read(uint8_t *write_data_buffer, + size_t length_write_data, + uint8_t *read_data_buffer, + size_t length_read_data); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/eth_wiz_w5500/src/ethernet.c b/driver/public/mikroe/eth_wiz_w5500/src/ethernet.c index 5d566172..e2ba493e 100644 --- a/driver/public/mikroe/eth_wiz_w5500/src/ethernet.c +++ b/driver/public/mikroe/eth_wiz_w5500/src/ethernet.c @@ -128,17 +128,18 @@ sl_status_t w5x00_ethernet_set_dns_server(w5x00_ethernet_t *eth, ******************************************************************************/ enum EthernetLinkStatus w5x00_ethernet_link_status(w5x00_ethernet_t *eth) { + enum EthernetLinkStatus stt = EthernetLinkUnknown; if (eth == NULL) { - return EthernetLinkUnknown; + stt = EthernetLinkUnknown; } switch (w5x00_get_link_status()) { - case UNKNOWN: return EthernetLinkUnknown; - case LINK_ON: return EthernetLinkON; - case LINK_OFF: return EthernetLinkOFF; - default: return EthernetLinkUnknown; + case UNKNOWN: stt = EthernetLinkUnknown; break; + case LINK_ON: stt = EthernetLinkON; break; + case LINK_OFF: stt = EthernetLinkOFF; break; + default: stt = EthernetLinkUnknown; break; } - return EthernetLinkUnknown; + return stt; } /***************************************************************************//** @@ -177,7 +178,6 @@ sl_status_t w5x00_ethernet_maintain(w5x00_ethernet_t *eth) default: // this is actually an error, it will retry though return SL_STATUS_FAIL; - break; } return SL_STATUS_OK; } diff --git a/driver/public/mikroe/eth_wiz_w5500/src/socket.c b/driver/public/mikroe/eth_wiz_w5500/src/socket.c index 7de24f25..5183dd23 100644 --- a/driver/public/mikroe/eth_wiz_w5500/src/socket.c +++ b/driver/public/mikroe/eth_wiz_w5500/src/socket.c @@ -99,7 +99,7 @@ w5x00_socket_t w5x00_socket_init(w5x00_socket_t s, return W5x00_MAX_SOCK_NUM; } // EthernetServer::server_port[s] = 0; - w5x00_delay_us(250); // TODO: is this needed?? + w5x00_delay_ms(1); // TODO: is this needed?? w5x00_writeSnMR(s, protocol); w5x00_writeSnIR(s, 0xFF); if (port > 0) { @@ -140,7 +140,7 @@ w5x00_socket_t w5x00_socket_init_multicast(w5x00_socket_t s, } // w5x00_log_info("W5000socket %d\n", s); - w5x00_delay_us(250); + w5x00_delay_ms(1); w5x00_writeSnMR(s, protocol); w5x00_writeSnIR(s, 0xFF); if (port > 0) { diff --git a/driver/public/mikroe/eth_wiz_w5500/src/w5x00.c b/driver/public/mikroe/eth_wiz_w5500/src/w5x00.c index 0db25ff2..7245ffc5 100644 --- a/driver/public/mikroe/eth_wiz_w5500/src/w5x00.c +++ b/driver/public/mikroe/eth_wiz_w5500/src/w5x00.c @@ -41,7 +41,6 @@ #include #include #include - #include "w5x00.h" #if W5x00_ETHERNET_LARGE_BUFFERS_ENABLE @@ -52,10 +51,12 @@ static const uint16_t SSIZE = 2048; static const uint16_t SMASK = 0x07FF; #endif -#define SBASE(socknum) \ - ((chip) == W5x00_W5100 ? ((socknum) * SSIZE + 0x4000) : ((socknum) * SSIZE + 0x8000)) -#define RBASE(socknum) \ - ((chip) == W5x00_W5100 ? ((socknum) * SSIZE + 0x6000) : ((socknum) * SSIZE + 0xC000)) +#define SBASE(socknum) \ + ((chip) \ + == W5x00_W5100 ? ((socknum) * SSIZE + 0x4000) : ((socknum) * SSIZE + 0x8000)) +#define RBASE(socknum) \ + ((chip) \ + == W5x00_W5100 ? ((socknum) * SSIZE + 0x6000) : ((socknum) * SSIZE + 0xC000)) static bool initialized = false; @@ -159,7 +160,7 @@ static uint8_t w5x00_is_w5500(void) /***************************************************************************//** * W5x00 Init. ******************************************************************************/ -bool w5x00_init(SPIDRV_Handle_t handle) +bool w5x00_init(mikroe_spi_handle_t handle) { uint8_t i; @@ -434,11 +435,11 @@ uint16_t w5x00_read(uint16_t addr, uint8_t *buf, uint16_t len) if (chip == W5x00_W5100) { for (uint16_t i = 0; i < len; i++) { w5x00_bus_select(); - ret += w5x00_bus_writebyte(0x0F); - ret += w5x00_bus_writebyte(addr >> 8); - ret += w5x00_bus_writebyte(addr & 0xFF); + cmd[0] = (0x0F); + cmd[1] = (addr >> 8); + cmd[2] = (addr & 0xFF); + ret += w5x00_bus_write_then_read(cmd, 3, &buf[i], 1); addr++; - ret += w5x00_bus_read(&buf[i], 1); w5x00_bus_deselect(); } } else if (chip == W5x00_W5200) { @@ -447,9 +448,8 @@ uint16_t w5x00_read(uint16_t addr, uint8_t *buf, uint16_t len) cmd[1] = addr & 0xFF; cmd[2] = (len >> 8) & 0x7F; cmd[3] = len & 0xFF; - ret += w5x00_bus_write(cmd, 4); memset(buf, 0, len); - ret += w5x00_bus_read(buf, len); + ret += w5x00_bus_write_then_read(cmd, 4, buf, len); w5x00_bus_deselect(); } else { // chip == W5x00_W5500 w5x00_bus_select(); @@ -491,9 +491,8 @@ uint16_t w5x00_read(uint16_t addr, uint8_t *buf, uint16_t len) cmd[2] = ((addr >> 6) & 0xE0) | 0x18; // 2K buffers #endif } - ret += w5x00_bus_write(cmd, 3); memset(buf, 0, len); - ret += w5x00_bus_read(buf, len); + ret += w5x00_bus_write_then_read(cmd, 3, buf, len); w5x00_bus_deselect(); } if (ret) { diff --git a/driver/public/mikroe/eth_wiz_w5500/src/w5x00_platform.c b/driver/public/mikroe/eth_wiz_w5500/src/w5x00_platform.c index 83df45b6..10035fdd 100644 --- a/driver/public/mikroe/eth_wiz_w5500/src/w5x00_platform.c +++ b/driver/public/mikroe/eth_wiz_w5500/src/w5x00_platform.c @@ -38,34 +38,51 @@ ******************************************************************************/ #include #include - #include "w5x00_platform.h" +#include "drv_digital_out.h" + +typedef struct { + spi_master_t spi; + digital_out_t rst_pin; + digital_out_t cs_pin; +} w5x00_handle_t; -static SPIDRV_Handle_t spi_handle = NULL; +static w5x00_handle_t w5x00; /***************************************************************************//** * Reset Chip. ******************************************************************************/ void w5x00_reset(void) { - GPIO_PinOutClear(W5500_RESET_PORT, W5500_RESET_PIN); + digital_out_low(&w5x00.rst_pin); w5x00_delay_ms(100); - GPIO_PinOutSet(W5500_RESET_PORT, W5500_RESET_PIN); + digital_out_high(&w5x00.rst_pin); } /***************************************************************************//** * Initialize Bus IO. ******************************************************************************/ -void w5x00_bus_init(SPIDRV_Handle_t handle) +void w5x00_bus_init(mikroe_spi_handle_t handle) { - spi_handle = handle; - GPIO_PinModeSet(W5500_RESET_PORT, - W5500_RESET_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet((GPIO_Port_TypeDef)spi_handle->portCs, - spi_handle->pinCs, - gpioModePushPull, 1); + w5x00.spi.handle = handle; + + spi_master_config_t spi_cfg; + spi_master_configure_default(&spi_cfg); + +#if (MIKROE_W5500_SPI_UC == 1) + spi_cfg.speed = MIKROE_W5500_SPI_BITRATE; +#endif + + spi_master_open(&w5x00.spi, &spi_cfg); + + pin_name_t reset = hal_gpio_pin_name(W5500_RESET_PORT, + W5500_RESET_PIN); + digital_out_init(&w5x00.rst_pin, reset); + + pin_name_t cs = hal_gpio_pin_name(MIKROE_W5500_CS_PORT, + MIKROE_W5500_CS_PIN); + digital_out_init(&w5x00.cs_pin, cs); + digital_out_high(&w5x00.cs_pin); } /***************************************************************************//** @@ -73,11 +90,10 @@ void w5x00_bus_init(SPIDRV_Handle_t handle) ******************************************************************************/ void w5x00_bus_select(void) { - if (spi_handle == NULL) { + if (w5x00.spi.handle == NULL) { return; } - GPIO_PinOutClear((GPIO_Port_TypeDef)spi_handle->portCs, - spi_handle->pinCs); + digital_out_low(&w5x00.cs_pin); } /***************************************************************************//** @@ -85,24 +101,32 @@ void w5x00_bus_select(void) ******************************************************************************/ void w5x00_bus_deselect(void) { - if (spi_handle == NULL) { + if (w5x00.spi.handle == NULL) { return; } - GPIO_PinOutSet((GPIO_Port_TypeDef)spi_handle->portCs, - spi_handle->pinCs); + digital_out_high(&w5x00.cs_pin); } /***************************************************************************//** * Read Chip Data From SPI Interface. ******************************************************************************/ -uint32_t w5x00_bus_read(uint8_t *buf, uint16_t len) +uint32_t w5x00_bus_write_then_read(uint8_t *write_data_buffer, + size_t length_write_data, + uint8_t *read_data_buffer, + size_t length_read_data) { - if (spi_handle == NULL) { + if (w5x00.spi.handle == NULL) { return SL_STATUS_NULL_POINTER; } - if (SPIDRV_MReceiveB(spi_handle, buf, len)) { + + if (spi_master_write_then_read(&w5x00.spi, + write_data_buffer, + length_write_data, + read_data_buffer, + length_read_data) != SPI_MASTER_SUCCESS) { return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } @@ -111,12 +135,15 @@ uint32_t w5x00_bus_read(uint8_t *buf, uint16_t len) ******************************************************************************/ uint32_t w5x00_bus_write(const uint8_t *buf, uint16_t len) { - if (spi_handle == NULL) { + if (w5x00.spi.handle == NULL) { return SL_STATUS_NULL_POINTER; } - if (SPIDRV_MTransmitB(spi_handle, buf, len)) { + + if (spi_master_write(&w5x00.spi, (uint8_t *)buf, + len) != SPI_MASTER_SUCCESS) { return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } diff --git a/driver/public/mikroe/fingerprint2_a172mrq/config/brd2703a/mikroe_a172mrq_config.h b/driver/public/mikroe/fingerprint2_a172mrq/config/brd2703a/mikroe_a172mrq_config.h index 62f9d34d..2ae6ad21 100644 --- a/driver/public/mikroe/fingerprint2_a172mrq/config/brd2703a/mikroe_a172mrq_config.h +++ b/driver/public/mikroe/fingerprint2_a172mrq/config/brd2703a/mikroe_a172mrq_config.h @@ -1,6 +1,46 @@ +/***************************************************************************//** + * @file mikroe_a172mrq_config.h + * @brief SCL A172MRQ Configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + #ifndef SCL_A172MRQ_CONFIG_H_ #define SCL_A172MRQ_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { @@ -44,4 +84,4 @@ extern "C" } #endif -#endif /* SCL_A172MRQ_CONFIG_H_ */ +#endif // SCL_A172MRQ_CONFIG_H_ diff --git a/driver/public/mikroe/fingerprint2_a172mrq/config/brd4108a/mikroe_a172mrq_config.h b/driver/public/mikroe/fingerprint2_a172mrq/config/brd4108a/mikroe_a172mrq_config.h index 9e192f5b..81757b0c 100644 --- a/driver/public/mikroe/fingerprint2_a172mrq/config/brd4108a/mikroe_a172mrq_config.h +++ b/driver/public/mikroe/fingerprint2_a172mrq/config/brd4108a/mikroe_a172mrq_config.h @@ -1,6 +1,46 @@ +/***************************************************************************//** + * @file mikroe_a172mrq_config.h + * @brief SCL A172MRQ Configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + #ifndef SCL_A172MRQ_CONFIG_H_ #define SCL_A172MRQ_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { @@ -44,4 +84,4 @@ extern "C" } #endif -#endif /* SCL_A172MRQ_CONFIG_H_ */ +#endif // SCL_A172MRQ_CONFIG_H_ diff --git a/driver/public/mikroe/fingerprint2_a172mrq/config/brd4314a/mikroe_a172mrq_config.h b/driver/public/mikroe/fingerprint2_a172mrq/config/brd4314a/mikroe_a172mrq_config.h index 9e192f5b..81757b0c 100644 --- a/driver/public/mikroe/fingerprint2_a172mrq/config/brd4314a/mikroe_a172mrq_config.h +++ b/driver/public/mikroe/fingerprint2_a172mrq/config/brd4314a/mikroe_a172mrq_config.h @@ -1,6 +1,46 @@ +/***************************************************************************//** + * @file mikroe_a172mrq_config.h + * @brief SCL A172MRQ Configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + #ifndef SCL_A172MRQ_CONFIG_H_ #define SCL_A172MRQ_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { @@ -44,4 +84,4 @@ extern "C" } #endif -#endif /* SCL_A172MRQ_CONFIG_H_ */ +#endif // SCL_A172MRQ_CONFIG_H_ diff --git a/driver/public/mikroe/fingerprint2_a172mrq/config/brd4338a/mikroe_a172mrq_config.h b/driver/public/mikroe/fingerprint2_a172mrq/config/brd4338a/mikroe_a172mrq_config.h new file mode 100644 index 00000000..4032cc75 --- /dev/null +++ b/driver/public/mikroe/fingerprint2_a172mrq/config/brd4338a/mikroe_a172mrq_config.h @@ -0,0 +1,85 @@ +/***************************************************************************//** + * @file mikroe_a172mrq_config.h + * @brief SCL A172MRQ Configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SCL_A172MRQ_CONFIG_H_ +#define SCL_A172MRQ_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< sl:start pin_tool >>> + +// A172MRQ_RESET +// $[GPIO_A172MRQ_RESET] +#define A172MRQ_RESET_PORT HP +#define A172MRQ_RESET_PIN 46 +// [GPIO_A172MRQ_RESET]$ + +// A172MRQ_LD1 +// $[GPIO_A172MRQ_LD1] +#define A172MRQ_LD1_PORT HP +#define A172MRQ_LD1_PIN 47 +// [GPIO_A172MRQ_LD1]$ + +// A172MRQ_LD2 +// $[GPIO_A172MRQ_LD2] +#define A172MRQ_LD2_PORT HP +#define A172MRQ_LD2_PIN 48 +// [GPIO_A172MRQ_LD2]$ + +// A172MRQ_GP1 +// $[GPIO_A172MRQ_GP1] +#define A172MRQ_GP1_PORT HP +#define A172MRQ_GP1_PIN 49 +// [GPIO_A172MRQ_GP1]$ + +// A172MRQ_GP2 +// $[GPIO_A172MRQ_GP2] +#define A172MRQ_GP2_PORT HP +#define A172MRQ_GP2_PIN 50 +// [GPIO_A172MRQ_GP2]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // SCL_A172MRQ_CONFIG_H_ diff --git a/driver/public/mikroe/fingerprint2_a172mrq/config/other/mikroe_a172mrq_config.h b/driver/public/mikroe/fingerprint2_a172mrq/config/other/mikroe_a172mrq_config.h index 97bf4904..be104ef9 100644 --- a/driver/public/mikroe/fingerprint2_a172mrq/config/other/mikroe_a172mrq_config.h +++ b/driver/public/mikroe/fingerprint2_a172mrq/config/other/mikroe_a172mrq_config.h @@ -1,6 +1,48 @@ +/***************************************************************************//** + * @file mikroe_a172mrq_config.h + * @brief SCL A172MRQ Configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + #ifndef SCL_A172MRQ_CONFIG_H_ #define SCL_A172MRQ_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { @@ -11,36 +53,36 @@ extern "C" // A172MRQ_RESET // $[GPIO_A172MRQ_RESET] #warning "RESET pin for A172MRQ is not configured" -// #define A172MRQ_RESET_PORT gpioPortC -// #define A172MRQ_RESET_PIN 6 +// #define A172MRQ_RESET_PORT 0 +// #define A172MRQ_RESET_PIN 0 // [GPIO_A172MRQ_RESET]$ // A172MRQ_LD1 // $[GPIO_A172MRQ_LD1] #warning "LD1 pin for A172MRQ is not configured" -// #define A172MRQ_LD1_PORT gpioPortB +// #define A172MRQ_LD1_PORT 0 // #define A172MRQ_LD1_PIN 0 // [GPIO_A172MRQ_LD1]$ // A172MRQ_LD2 // $[GPIO_A172MRQ_LD2] #warning "LD2 pin for A172MRQ is not configured" -// #define A172MRQ_LD2_PORT gpioPortB -// #define A172MRQ_LD2_PIN 3 +// #define A172MRQ_LD2_PORT 0 +// #define A172MRQ_LD2_PIN 0 // [GPIO_A172MRQ_LD2]$ // A172MRQ_GP1 // $[GPIO_A172MRQ_GP1] #warning "GP1 pin for A172MRQ is not configured" -// #define A172MRQ_GP1_PORT gpioPortC -// #define A172MRQ_GP1_PIN 3 +// #define A172MRQ_GP1_PORT 0 +// #define A172MRQ_GP1_PIN 0 // [GPIO_A172MRQ_GP1]$ // A172MRQ_GP2 // $[GPIO_A172MRQ_GP2] #warning "GP2 pin for A172MRQ is not configured" -// #define A172MRQ_GP2_PORT gpioPortB -// #define A172MRQ_GP2_PIN 4 +// #define A172MRQ_GP2_PORT 0 +// #define A172MRQ_GP2_PIN 0 // [GPIO_A172MRQ_GP2]$ // <<< sl:end pin_tool >>> @@ -49,4 +91,4 @@ extern "C" } #endif -#endif /* SCL_A172MRQ_CONFIG_H_ */ +#endif // SCL_A172MRQ_CONFIG_H_ diff --git a/driver/public/mikroe/fingerprint2_a172mrq/inc/mikroe_a172mrq.h b/driver/public/mikroe/fingerprint2_a172mrq/inc/mikroe_a172mrq.h index 9facfa2f..e3ca058d 100644 --- a/driver/public/mikroe/fingerprint2_a172mrq/inc/mikroe_a172mrq.h +++ b/driver/public/mikroe/fingerprint2_a172mrq/inc/mikroe_a172mrq.h @@ -89,38 +89,40 @@ void mikroe_a172mrq_cfg_setup(void); /** * @brief Initialization function. - * - * @description This function initializes all necessary pins and peripherals - * used for this click. + * @details This function initializes all necessary pins and peripherals + * used for this click. + * @param[in] handle : Click context object. + * @return + * SL_STATUS_OK if there are no errors + * SL_STATUS_INVALID_PARAMETER if spi_instance is null */ -sl_status_t mikroe_a172mrq_init(sl_iostream_uart_t *handle); +sl_status_t mikroe_a172mrq_init(mikroe_uart_handle_t handle); /** * @brief Set uart instance function. - * - * @description This function sets the uart used for this click. + * @details This function sets the uart used for this click. + * @param[in] handle : Click context object. + * @return + * SL_STATUS_OK if there are no errors + * SL_STATUS_INVALID_PARAMETER if spi_instance is null */ -sl_status_t mikroe_a172mrq_set_uart_instance(sl_iostream_uart_t *handle); +sl_status_t mikroe_a172mrq_set_uart_instance(mikroe_uart_handle_t handle); /** * @brief Generic write function. - * + * @details This function write specific number of bytes * @param data_buf Data buffer for sends. * @param len Number of bytes for sends. - * - * @description This function write specific number of bytes */ sl_status_t mikroe_a172mrq_generic_write(char *data_buf, uint16_t len); /** * @brief Generic read function. - * + * @details This function read maximum length of data. * @param data_buf Data buffer for read data. * @param max_len The maximum length of data that can be read. * @param rsp_size Size of data that read. * @returns Status of function. - * - * @description This function read maximum length of data. */ sl_status_t mikroe_a172mrq_generic_read(char *data_buf, uint16_t max_len, @@ -128,71 +130,56 @@ sl_status_t mikroe_a172mrq_generic_read(char *data_buf, /** * @brief Generic function for reading ld1 pin status - * + * @details This function read ld1 pin status. * @returns Pin status. - * - * @description This function read ld1 pin status. */ uint8_t mikroe_a172mrq_get_ld1_status(void); /** * @brief Generic function for reading ld2 pin status - * + * @details This function read ld2 pin status * @returns Pin status - * - * @description This function read ld2 pin status */ uint8_t mikroe_a172mrq_get_ld2_status(void); /** * @brief Generic function for setting rst pin status - * + * @details This function sets rst pin status. * @param status State of the pin - * - * @description This function sets rst pin status. */ void mikroe_a172mrq_set_rst_status(uint8_t status); /** * @brief Generic function for setting gp1 pin status - * + * @details This function sets gp1 pin status. * @param status State of the pin. - * - * @description This function sets gp1 pin status. */ void mikroe_a172mrq_set_gp1_status(uint8_t status); /** * @brief Generic function for setting gp2 pin status - * - * @param status State of the pin - * * @description This function sets gp2 pin status. + * @param status State of the pin */ void mikroe_a172mrq_set_gp2_status(uint8_t status); /** * @brief Function for restarting device - * * @description This function restarts device. */ void mikroe_a172mrq_reset(void); /** * @brief Function for fingerprint registration on index - * - * @param fp_index Fingerprint index - * * @description This function registrates fingerprint on index. + * @param fp_index Fingerprint index */ void mikroe_a172mrq_reg_one_fp(uint8_t fp_index); /** * @brief Function for deleting fingerprint on index - * + * @details This function deletes fingerprint on index * @param fp_index Fingerprint index - * - * @description This function deletes fingerprint on index */ void mikroe_a172mrq_delete_one_fp(uint8_t fp_index); @@ -202,4 +189,4 @@ void mikroe_a172mrq_delete_one_fp(uint8_t fp_index); /** @} (end addtogroup a172mrq) */ -#endif /* MIKROE_FINGERPRINT2_H_ */ +#endif // MIKROE_FINGERPRINT2_H_ diff --git a/driver/public/mikroe/fingerprint2_a172mrq/src/mikroe_a172mrq.c b/driver/public/mikroe/fingerprint2_a172mrq/src/mikroe_a172mrq.c index b69018db..a1056f57 100644 --- a/driver/public/mikroe/fingerprint2_a172mrq/src/mikroe_a172mrq.c +++ b/driver/public/mikroe/fingerprint2_a172mrq/src/mikroe_a172mrq.c @@ -40,24 +40,23 @@ #include "fingerprint2.h" #include "mikroe_a172mrq.h" #include "mikroe_a172mrq_config.h" -#include "third_party_hw_drivers_helpers.h" #include "drv_digital_out.h" #include "drv_digital_in.h" static fingerprint2_t fingerprint2; static fingerprint2_cfg_t fingerprint2_cfg; +static bool initialized = false; void mikroe_a172mrq_cfg_setup(void) { fingerprint2_cfg_setup(&fingerprint2_cfg); } -sl_status_t mikroe_a172mrq_init(sl_iostream_uart_t *handle) +sl_status_t mikroe_a172mrq_init(mikroe_uart_handle_t handle) { if (NULL == handle) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); fingerprint2.uart.handle = handle; fingerprint2_cfg_setup(&fingerprint2_cfg); @@ -87,14 +86,20 @@ sl_status_t mikroe_a172mrq_init(sl_iostream_uart_t *handle) A172MRQ_GP2_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(fingerprint2_init(&fingerprint2, - &fingerprint2_cfg)); + if (fingerprint2_init(&fingerprint2, &fingerprint2_cfg) != FINGERPRINT2_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + initialized = true; + return SL_STATUS_OK; } -sl_status_t mikroe_a172mrq_set_uart_instance(sl_iostream_uart_t *handle) +sl_status_t mikroe_a172mrq_set_uart_instance(mikroe_uart_handle_t handle) { + if (!initialized) { + return SL_STATUS_NOT_INITIALIZED; + } + if (NULL == handle) { return SL_STATUS_INVALID_PARAMETER; } diff --git a/driver/public/mikroe/force3_fsr400/config/mikroe_fsr400_config.h b/driver/public/mikroe/force3_fsr400/config/mikroe_fsr400_config.h new file mode 100644 index 00000000..bc798548 --- /dev/null +++ b/driver/public/mikroe/force3_fsr400/config/mikroe_fsr400_config.h @@ -0,0 +1,70 @@ +/***************************************************************************/ /** + * @file mikroe_fsr400_config.h + * @brief Mikroe FSR400 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_FSR400_CONFIG_H +#define MIKROE_FSR400_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE I2C FSR400 Configuration + +// MIKROE I2C FSR400 UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_I2C_FSR400_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_I2C_FSR400_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_FSR400_CONFIG_H diff --git a/driver/public/mikroe/force3_fsr400/inc/mikroe_fsr400.h b/driver/public/mikroe/force3_fsr400/inc/mikroe_fsr400.h index 35057615..03df49e4 100644 --- a/driver/public/mikroe/force3_fsr400/inc/mikroe_fsr400.h +++ b/driver/public/mikroe/force3_fsr400/inc/mikroe_fsr400.h @@ -36,11 +36,12 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_FORCE3_FSR400_INC_MIKROE_FORCE3_H_ -#define MIKROE_FORCE3_FSR400_INC_MIKROE_FORCE3_H_ +#ifndef MIKROE_FORCE3_FSR400_H_ +#define MIKROE_FORCE3_FSR400_H_ + #include "sl_status.h" -#include "sl_i2cspm.h" #include "force3.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -60,7 +61,7 @@ extern "C" { * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_fsr400_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_fsr400_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -73,7 +74,8 @@ sl_status_t mikroe_fsr400_init(sl_i2cspm_t *i2cspm_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_fsr400_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_fsr400_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -124,4 +126,4 @@ sl_status_t mikroe_fsr400_get_raw_data (uint16_t *data); } #endif -#endif /* MIKROE_FORCE3_FSR400_INC_MIKROE_FORCE3_H_ */ +#endif // MIKROE_FORCE3_FSR400_H_ diff --git a/driver/public/mikroe/force3_fsr400/src/mikroe_fsr400.c b/driver/public/mikroe/force3_fsr400/src/mikroe_fsr400.c index e53cf982..aaf5873f 100644 --- a/driver/public/mikroe/force3_fsr400/src/mikroe_fsr400.c +++ b/driver/public/mikroe/force3_fsr400/src/mikroe_fsr400.c @@ -37,29 +37,34 @@ * ******************************************************************************/ #include "mikroe_fsr400.h" +#include "mikroe_fsr400_config.h" #include "force3.h" static force3_t force3; static force3_cfg_t force3_cfg; -sl_status_t mikroe_fsr400_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_fsr400_init(mikroe_i2c_handle_t i2cspm_instance) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; + if (NULL == i2cspm_instance) { + return SL_STATUS_INVALID_PARAMETER; + } - if (NULL != i2cspm_instance) { - force3.i2c.handle = i2cspm_instance; - force3_cfg_setup(&force3_cfg); + force3.i2c.handle = i2cspm_instance; + force3_cfg_setup(&force3_cfg); - if (I2C_MASTER_SUCCESS == force3_init(&force3, &force3_cfg)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } +#if (MIKROE_I2C_FSR400_UC == 1) + force3_cfg.i2c_speed = MIKROE_I2C_FSR400_SPEED_MODE; +#endif + + if (FORCE3_OK != force3_init(&force3, &force3_cfg)) { + return SL_STATUS_INITIALIZATION; } - return stt; + + return SL_STATUS_OK; } -sl_status_t mikroe_fsr400_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_fsr400_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance) { sl_status_t stt = SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/gps_lea6s/config/brd2703a/mikroe_gps_lea6s_config.h b/driver/public/mikroe/gps_lea6s/config/brd2703a/mikroe_gps_lea6s_config.h index 9721f04b..b226c81c 100644 --- a/driver/public/mikroe/gps_lea6s/config/brd2703a/mikroe_gps_lea6s_config.h +++ b/driver/public/mikroe/gps_lea6s/config/brd2703a/mikroe_gps_lea6s_config.h @@ -39,10 +39,11 @@ #ifndef MIKROE_GPS_LEA6S_CONFIG_H_ #define MIKROE_GPS_LEA6S_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif -#include "em_gpio.h" // <<< sl:start pin_tool >>> @@ -64,4 +65,4 @@ extern "C" { } #endif -#endif /* MIKROE_GPS_LEA6S_CONFIG_H_ */ +#endif // MIKROE_GPS_LEA6S_CONFIG_H_ diff --git a/driver/public/mikroe/gps_lea6s/config/brd4108a/mikroe_gps_lea6s_config.h b/driver/public/mikroe/gps_lea6s/config/brd4108a/mikroe_gps_lea6s_config.h index 6b4867d8..641bb8e6 100644 --- a/driver/public/mikroe/gps_lea6s/config/brd4108a/mikroe_gps_lea6s_config.h +++ b/driver/public/mikroe/gps_lea6s/config/brd4108a/mikroe_gps_lea6s_config.h @@ -39,10 +39,11 @@ #ifndef MIKROE_GPS_LEA6S_CONFIG_H_ #define MIKROE_GPS_LEA6S_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif -#include "em_gpio.h" // <<< sl:start pin_tool >>> @@ -64,4 +65,4 @@ extern "C" { } #endif -#endif /* MIKROE_GPS_LEA6S_CONFIG_H_ */ +#endif // MIKROE_GPS_LEA6S_CONFIG_H_ diff --git a/driver/public/mikroe/gps_lea6s/config/brd4314a/mikroe_gps_lea6s_config.h b/driver/public/mikroe/gps_lea6s/config/brd4314a/mikroe_gps_lea6s_config.h index 6b4867d8..641bb8e6 100644 --- a/driver/public/mikroe/gps_lea6s/config/brd4314a/mikroe_gps_lea6s_config.h +++ b/driver/public/mikroe/gps_lea6s/config/brd4314a/mikroe_gps_lea6s_config.h @@ -39,10 +39,11 @@ #ifndef MIKROE_GPS_LEA6S_CONFIG_H_ #define MIKROE_GPS_LEA6S_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif -#include "em_gpio.h" // <<< sl:start pin_tool >>> @@ -64,4 +65,4 @@ extern "C" { } #endif -#endif /* MIKROE_GPS_LEA6S_CONFIG_H_ */ +#endif // MIKROE_GPS_LEA6S_CONFIG_H_ diff --git a/driver/public/mikroe/gps_lea6s/config/brd4338a/mikroe_gps_lea6s_config.h b/driver/public/mikroe/gps_lea6s/config/brd4338a/mikroe_gps_lea6s_config.h new file mode 100644 index 00000000..7927f457 --- /dev/null +++ b/driver/public/mikroe/gps_lea6s/config/brd4338a/mikroe_gps_lea6s_config.h @@ -0,0 +1,66 @@ +/***************************************************************************//** + * @file mikroe_gps_lea6s_config.h + * @brief mikroe_gps_lea6s_config.h + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_GPS_LEA6S_CONFIG_H_ +#define MIKROE_GPS_LEA6S_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< sl:start pin_tool >>> + +// MIKROE_LEAS6_RESET +// $[GPIO_MIKROE_LEAS6_RESET] +#define MIKROE_LEAS6_RESET_PORT HP +#define MIKROE_LEAS6_RESET_PIN 46 +// [GPIO_MIKROE_LEAS6_RESET]$ + +// MIKROE_LEAS6_TIMEPULSE +// $[GPIO_MIKROE_LEAS6_TIMEPULSE] +#define MIKROE_LEAS6_TIMEPULSE_PORT HP +#define MIKROE_LEAS6_TIMEPULSE_PIN 47 +// [GPIO_MIKROE_LEAS6_TIMEPULSE]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_GPS_LEA6S_CONFIG_H_ diff --git a/driver/public/mikroe/gps_lea6s/config/other/mikroe_gps_lea6s_config.h b/driver/public/mikroe/gps_lea6s/config/other/mikroe_gps_lea6s_config.h index 7ba60ed3..20aed50f 100644 --- a/driver/public/mikroe/gps_lea6s/config/other/mikroe_gps_lea6s_config.h +++ b/driver/public/mikroe/gps_lea6s/config/other/mikroe_gps_lea6s_config.h @@ -39,10 +39,13 @@ #ifndef MIKROE_GPS_LEA6S_CONFIG_H_ #define MIKROE_GPS_LEA6S_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif -#include "em_gpio.h" // <<< sl:start pin_tool >>> @@ -66,4 +69,4 @@ extern "C" { } #endif -#endif /* MIKROE_GPS_LEA6S_CONFIG_H_ */ +#endif // MIKROE_GPS_LEA6S_CONFIG_H_ diff --git a/driver/public/mikroe/gps_lea6s/inc/mikroe_lea6s.h b/driver/public/mikroe/gps_lea6s/inc/mikroe_lea6s.h index f24982aa..f90a798e 100644 --- a/driver/public/mikroe/gps_lea6s/inc/mikroe_lea6s.h +++ b/driver/public/mikroe/gps_lea6s/inc/mikroe_lea6s.h @@ -262,7 +262,7 @@ typedef enum { gpgga_element_time_since_last_dgps_e = GPS_GPGGA_TIME_SINCE_LAST_DGPS, gpgga_element_dgps_reference_station_id_e = GPS_GPGGA_DGPS_REFERENCE_STATION_ID, -}mikroe_leas6_gpgga_command_elements_t; +} mikroe_leas6_gpgga_command_elements_t; /***************************************************************************//** * @brief @@ -271,7 +271,7 @@ typedef enum { typedef enum { gps_command_nema_gpgga_e = GPS_NEMA_GPGGA, gps_command_nema_gpgll_e = GPS_NEMA_GPGLL, -}mikroe_leas6_gps_command_t; +} mikroe_leas6_gps_command_t; /***************************************************************************//** * @brief @@ -284,7 +284,7 @@ typedef enum { gps_parser_error_next_element_e = GPS_ERROR_NEXT_ELEMENT, gps_parser_error_current_element_e = GPS_ERROR_CURRENT_ELEMENT, gps_parser_invalid_input_parameter_e = 0x01, -}mikroe_leas6_parser_result_t; +} mikroe_leas6_parser_result_t; /***************************************************************************//** * @brief @@ -293,11 +293,14 @@ typedef enum { * @param[in] uart_handle * IO Stream UART Instance * + * @param[in] blocking + * Uart functioning mode + * * @return * SL_STATUS_OK: Successful initialization. * SL_STATUS_INVALID_PARAMETER: if (uart_handle == NULL) ******************************************************************************/ -sl_status_t mikroe_lea6s_init(sl_iostream_uart_t *uart_handle); +sl_status_t mikroe_lea6s_init(mikroe_uart_handle_t uart_handle, bool blocking); /***************************************************************************//** * @brief @@ -403,4 +406,4 @@ mikroe_lea6s_generic_parser(uint8_t *raw_data_buffer, } #endif -#endif /* MIKROE_LEA6S_H_ */ +#endif // MIKROE_LEA6S_H_ diff --git a/driver/public/mikroe/gps_lea6s/src/mikroe_lea6s.c b/driver/public/mikroe/gps_lea6s/src/mikroe_lea6s.c index 3b817de7..0912b7ae 100644 --- a/driver/public/mikroe/gps_lea6s/src/mikroe_lea6s.c +++ b/driver/public/mikroe/gps_lea6s/src/mikroe_lea6s.c @@ -42,26 +42,27 @@ static gps_t mikroe_lea6s; static gps_cfg_t mikroe_lea6s_cfg; -sl_status_t mikroe_lea6s_init(sl_iostream_uart_t *uart_handle) +sl_status_t mikroe_lea6s_init(mikroe_uart_handle_t uart_handle, bool blocking) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if (NULL != uart_handle) { - gps_cfg_setup(&mikroe_lea6s_cfg); + if (NULL == uart_handle) { + return SL_STATUS_INVALID_PARAMETER; + } - mikroe_lea6s_cfg.reset = hal_gpio_pin_name(MIKROE_LEAS6_RESET_PORT, - MIKROE_LEAS6_RESET_PIN); + gps_cfg_setup(&mikroe_lea6s_cfg); - mikroe_lea6s_cfg.tmpls = hal_gpio_pin_name(MIKROE_LEAS6_TIMEPULSE_PORT, - MIKROE_LEAS6_TIMEPULSE_PIN); + mikroe_lea6s_cfg.reset = hal_gpio_pin_name(MIKROE_LEAS6_RESET_PORT, + MIKROE_LEAS6_RESET_PIN); - mikroe_lea6s.uart.handle = uart_handle; - gps_init(&mikroe_lea6s, &mikroe_lea6s_cfg); + mikroe_lea6s_cfg.tmpls = hal_gpio_pin_name(MIKROE_LEAS6_TIMEPULSE_PORT, + MIKROE_LEAS6_TIMEPULSE_PIN); - stt = SL_STATUS_OK; + mikroe_lea6s_cfg.uart_blocking = blocking; + mikroe_lea6s.uart.handle = uart_handle; + if (gps_init(&mikroe_lea6s, &mikroe_lea6s_cfg) != GPS_OK) { + return SL_STATUS_INITIALIZATION; } - return stt; + return SL_STATUS_OK; } void mikroe_lea6s_wakeup(void) diff --git a/driver/public/mikroe/heartrate2_maxm86161/config/brd2703a/mikroe_maxm86161_config.h b/driver/public/mikroe/heartrate2_maxm86161/config/brd2703a/mikroe_maxm86161_config.h index 5f663c71..702bd0fe 100644 --- a/driver/public/mikroe/heartrate2_maxm86161/config/brd2703a/mikroe_maxm86161_config.h +++ b/driver/public/mikroe/heartrate2_maxm86161/config/brd2703a/mikroe_maxm86161_config.h @@ -40,6 +40,8 @@ #ifndef SCL_MAXM86161_CONFIG_H_ #define SCL_MAXM86161_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -70,4 +72,4 @@ extern "C" { } #endif -#endif /* SCL_MAXM86161_CONFIG_H_ */ +#endif // SCL_MAXM86161_CONFIG_H_ diff --git a/driver/public/mikroe/heartrate2_maxm86161/config/brd4108a/mikroe_maxm86161_config.h b/driver/public/mikroe/heartrate2_maxm86161/config/brd4108a/mikroe_maxm86161_config.h index ea697be2..7675095e 100644 --- a/driver/public/mikroe/heartrate2_maxm86161/config/brd4108a/mikroe_maxm86161_config.h +++ b/driver/public/mikroe/heartrate2_maxm86161/config/brd4108a/mikroe_maxm86161_config.h @@ -40,6 +40,8 @@ #ifndef SCL_MAXM86161_CONFIG_H_ #define SCL_MAXM86161_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -70,4 +72,4 @@ extern "C" { } #endif -#endif /* SCL_MAXM86161_CONFIG_H_ */ +#endif // SCL_MAXM86161_CONFIG_H_ diff --git a/driver/public/mikroe/heartrate2_maxm86161/config/brd4314a/mikroe_maxm86161_config.h b/driver/public/mikroe/heartrate2_maxm86161/config/brd4314a/mikroe_maxm86161_config.h index ea697be2..7675095e 100644 --- a/driver/public/mikroe/heartrate2_maxm86161/config/brd4314a/mikroe_maxm86161_config.h +++ b/driver/public/mikroe/heartrate2_maxm86161/config/brd4314a/mikroe_maxm86161_config.h @@ -40,6 +40,8 @@ #ifndef SCL_MAXM86161_CONFIG_H_ #define SCL_MAXM86161_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -70,4 +72,4 @@ extern "C" { } #endif -#endif /* SCL_MAXM86161_CONFIG_H_ */ +#endif // SCL_MAXM86161_CONFIG_H_ diff --git a/driver/public/mikroe/heartrate2_maxm86161/config/brd4338a/mikroe_maxm86161_config.h b/driver/public/mikroe/heartrate2_maxm86161/config/brd4338a/mikroe_maxm86161_config.h new file mode 100644 index 00000000..2bdcf59a --- /dev/null +++ b/driver/public/mikroe/heartrate2_maxm86161/config/brd4338a/mikroe_maxm86161_config.h @@ -0,0 +1,73 @@ +/***************************************************************************//** + * @file mikroe_maxm86161_config.h + * @brief SCL MAXM86161 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SCL_MAXM86161_CONFIG_H_ +#define SCL_MAXM86161_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< sl:start pin_tool >>> + +// MAXM86161_GP +// $[GPIO_MAXM86161_GP] +#define MAXM86161_GP_PORT HP +#define MAXM86161_GP_PIN 46 +// [GPIO_MAXM86161_GP]$ + +// MAXM86161_EN +// $[GPIO_MAXM86161_EN] +#define MAXM86161_EN_PORT HP +#define MAXM86161_EN_PIN 47 +// [GPIO_MAXM86161_EN]$ + +// MAXM86161_INT +// $[GPIO_MAXM86161_INT] +#define MAXM86161_INT_PORT HP +#define MAXM86161_INT_PIN 48 +// [GPIO_MAXM86161_INT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // SCL_MAXM86161_CONFIG_H_ diff --git a/driver/public/mikroe/heartrate2_maxm86161/config/other/mikroe_maxm86161_config.h b/driver/public/mikroe/heartrate2_maxm86161/config/other/mikroe_maxm86161_config.h index 47d72d41..8fa0237c 100644 --- a/driver/public/mikroe/heartrate2_maxm86161/config/other/mikroe_maxm86161_config.h +++ b/driver/public/mikroe/heartrate2_maxm86161/config/other/mikroe_maxm86161_config.h @@ -73,4 +73,4 @@ extern "C" { } #endif -#endif /* SCL_MAXM86161_CONFIG_H_ */ +#endif // SCL_MAXM86161_CONFIG_H_ diff --git a/driver/public/mikroe/heartrate2_maxm86161/inc/mikroe_maxm86161.h b/driver/public/mikroe/heartrate2_maxm86161/inc/mikroe_maxm86161.h index 04985bf8..6f3664ec 100644 --- a/driver/public/mikroe/heartrate2_maxm86161/inc/mikroe_maxm86161.h +++ b/driver/public/mikroe/heartrate2_maxm86161/inc/mikroe_maxm86161.h @@ -41,7 +41,7 @@ #define MIKROE_MAXM86161_H_ #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -550,7 +550,7 @@ typedef struct * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_maxm86161_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_maxm86161_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -563,7 +563,8 @@ sl_status_t mikroe_maxm86161_init(sl_i2cspm_t *i2cspm_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_maxm86161_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_maxm86161_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -591,7 +592,7 @@ sl_status_t mikroe_maxm86161_default_cfg(mikroe_maxm86161_config_led_t cfg_led); * @return * None ******************************************************************************/ -void mikroe_maxm86161_generic_write ( +void mikroe_maxm86161_generic_write( uint8_t register_address, uint8_t write_data); @@ -605,7 +606,7 @@ void mikroe_maxm86161_generic_write ( * @return * Data is read from register ******************************************************************************/ -uint8_t mikroe_maxm86161_generic_read (uint8_t register_address); +uint8_t mikroe_maxm86161_generic_read(uint8_t register_address); /***************************************************************************//** * @brief @@ -624,7 +625,7 @@ uint8_t mikroe_maxm86161_generic_read (uint8_t register_address); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if data_buf is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_read_buf ( +sl_status_t mikroe_maxm86161_read_buf( uint8_t reg, uint8_t *data_buf, uint8_t len); @@ -640,7 +641,7 @@ sl_status_t mikroe_maxm86161_read_buf ( * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if mikroe_fifo is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_read_fifo ( +sl_status_t mikroe_maxm86161_read_fifo( mikroe_maxm86161_fifo_data_t *mikroe_fifo); /***************************************************************************//** @@ -654,7 +655,7 @@ sl_status_t mikroe_maxm86161_read_fifo ( * You should enable die temperature interrupt status, * and you should turn off leds to get right temperature. ******************************************************************************/ -float mikroe_maxm86161_read_temp (void); +float mikroe_maxm86161_read_temp(void); /***************************************************************************//** * @brief @@ -663,7 +664,7 @@ float mikroe_maxm86161_read_temp (void); * @return * None ******************************************************************************/ -void mikroe_maxm86161_soft_reset (void); +void mikroe_maxm86161_soft_reset(void); /***************************************************************************//** * @brief @@ -676,7 +677,7 @@ void mikroe_maxm86161_soft_reset (void); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if mikroe_ppg_cfg is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_ppg_config ( +sl_status_t mikroe_maxm86161_ppg_config( mikroe_maxm86161_ppg_cfg_t *mikroe_ppg_cfg); /***************************************************************************//** @@ -690,7 +691,7 @@ sl_status_t mikroe_maxm86161_ppg_config ( * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if mikroe_ledpa is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_ledpa_config ( +sl_status_t mikroe_maxm86161_ledpa_config( mikroe_maxm86161_ledpa_t *mikroe_ledpa); /***************************************************************************//** @@ -704,7 +705,7 @@ sl_status_t mikroe_maxm86161_ledpa_config ( * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if mikroe_led_range is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_led_range_curr_config ( +sl_status_t mikroe_maxm86161_led_range_curr_config( mikroe_maxm86161_led_range_curr_t *mikroe_led_range); /***************************************************************************//** @@ -718,7 +719,7 @@ sl_status_t mikroe_maxm86161_led_range_curr_config ( * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if mikroe_ledsq is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_led_sequence_config ( +sl_status_t mikroe_maxm86161_led_sequence_config( mikroe_maxm86161_ledsq_cfg_t *mikroe_ledsq); /***************************************************************************//** @@ -732,7 +733,7 @@ sl_status_t mikroe_maxm86161_led_sequence_config ( * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if mikroe_int_ctrl is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_int_control ( +sl_status_t mikroe_maxm86161_int_control( mikroe_maxm86161_int_t *mikroe_int_ctrl); /***************************************************************************//** @@ -746,7 +747,7 @@ sl_status_t mikroe_maxm86161_int_control ( * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if mikroe_int_status is NULL ******************************************************************************/ -sl_status_t mikroe_maxm86161_int_status ( +sl_status_t mikroe_maxm86161_int_status( mikroe_maxm86161_int_t *mikroe_int_status); /***************************************************************************//** @@ -756,7 +757,7 @@ sl_status_t mikroe_maxm86161_int_status ( * @return * uint8_t int pin status. ******************************************************************************/ -uint8_t mikroe_maxm86161_get_int (void); +uint8_t mikroe_maxm86161_get_int(void); /***************************************************************************//** * @brief @@ -765,7 +766,7 @@ uint8_t mikroe_maxm86161_get_int (void); * @return * gp pin status. ******************************************************************************/ -uint8_t mikroe_maxm86161_get_gp (void); +uint8_t mikroe_maxm86161_get_gp(void); /***************************************************************************//** * @brief @@ -778,11 +779,11 @@ uint8_t mikroe_maxm86161_get_gp (void); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER ******************************************************************************/ -sl_status_t mikroe_maxm86161_set_en (mikroe_state_pin_t state); +sl_status_t mikroe_maxm86161_set_en(mikroe_state_pin_t state); #ifdef __cplusplus } #endif /** @} */ -#endif /* MIKROE_MAXM86161_H_ */ +#endif // MIKROE_MAXM86161_H_ diff --git a/driver/public/mikroe/heartrate2_maxm86161/src/mikroe_maxm86161.c b/driver/public/mikroe/heartrate2_maxm86161/src/mikroe_maxm86161.c index 28907e7a..d064f939 100644 --- a/driver/public/mikroe/heartrate2_maxm86161/src/mikroe_maxm86161.c +++ b/driver/public/mikroe/heartrate2_maxm86161/src/mikroe_maxm86161.c @@ -40,23 +40,22 @@ #include "heartrate2.h" #include "mikroe_maxm86161.h" #include "mikroe_maxm86161_config.h" -#include "third_party_hw_drivers_helpers.h" static heartrate2_t heartrate2; static heartrate2_cfg_t heartrate2_cfg; -sl_status_t mikroe_maxm86161_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_maxm86161_init(mikroe_i2c_handle_t i2cspm_instance) { if (i2cspm_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); // Configure default i2csmp instance heartrate2.i2c.handle = i2cspm_instance; // Call basic setup functions heartrate2_cfg_setup(&heartrate2_cfg); + #if defined(MAXM86161_EN_PORT) && defined(MAXM86161_EN_PIN) heartrate2_cfg.cs = hal_gpio_pin_name(MAXM86161_EN_PORT, MAXM86161_EN_PIN); #endif @@ -70,13 +69,15 @@ sl_status_t mikroe_maxm86161_init(sl_i2cspm_t *i2cspm_instance) MAXM86161_INT_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(heartrate2_init(&heartrate2, - &heartrate2_cfg)); + if (heartrate2_init(&heartrate2, &heartrate2_cfg) != HEARTRATE2_OK_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } -sl_status_t mikroe_maxm86161_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_maxm86161_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance) { if (NULL == i2cspm_instance) { return SL_STATUS_INVALID_PARAMETER; @@ -146,7 +147,7 @@ sl_status_t mikroe_maxm86161_read_fifo( return SL_STATUS_INVALID_PARAMETER; } - heartrate2_read_fifo(&heartrate2, mikroe_fifo); + heartrate2_read_fifo(&heartrate2, (heartrate2_fifo_data_t *)mikroe_fifo); return SL_STATUS_OK; } @@ -167,7 +168,9 @@ sl_status_t mikroe_maxm86161_ppg_config( return SL_STATUS_INVALID_PARAMETER; } - if (HEARTRATE2_ERROR == heartrate2_ppg_config(&heartrate2, mikroe_ppg_cfg)) { + if (HEARTRATE2_ERROR + == heartrate2_ppg_config(&heartrate2, + (heartrate2_ppg_cfg_t *)mikroe_ppg_cfg)) { return SL_STATUS_FAIL; } @@ -181,7 +184,7 @@ sl_status_t mikroe_maxm86161_ledpa_config( return SL_STATUS_INVALID_PARAMETER; } - heartrate2_ledpa_config(&heartrate2, mikroe_ledpa); + heartrate2_ledpa_config(&heartrate2, (heartrate2_ledpa_t *)mikroe_ledpa); return SL_STATUS_OK; } @@ -192,8 +195,9 @@ sl_status_t mikroe_maxm86161_led_range_curr_config( return SL_STATUS_INVALID_PARAMETER; } - if (HEARTRATE2_ERROR == heartrate2_led_range_curr_config(&heartrate2, - mikroe_led_range)) { + if (HEARTRATE2_ERROR == heartrate2_led_range_curr_config( + &heartrate2, + (heartrate2_led_range_curr_t *)mikroe_led_range)) { return SL_STATUS_FAIL; } @@ -208,7 +212,8 @@ sl_status_t mikroe_maxm86161_led_sequence_config( } if (HEARTRATE2_ERROR == heartrate2_led_sequence_config(&heartrate2, - mikroe_ledsq)) { + (heartrate2_ledsq_cfg_t + *)mikroe_ledsq)) { return SL_STATUS_FAIL; } @@ -223,6 +228,7 @@ sl_status_t mikroe_maxm86161_int_control( } if (HEARTRATE2_ERROR == heartrate2_int_control(&heartrate2, + (heartrate2_int_t *) mikroe_int_ctrl)) { return SL_STATUS_FAIL; } @@ -236,7 +242,7 @@ sl_status_t mikroe_maxm86161_int_status( return SL_STATUS_INVALID_PARAMETER; } - heartrate2_int_status(&heartrate2, mikroe_int_status); + heartrate2_int_status(&heartrate2, (heartrate2_int_t *)mikroe_int_status); return SL_STATUS_OK; } diff --git a/driver/public/mikroe/heartrate4_max30101/config/brd2703a/mikroe_max30101_config.h b/driver/public/mikroe/heartrate4_max30101/config/brd2703a/mikroe_max30101_config.h index b0164141..2abc8963 100644 --- a/driver/public/mikroe/heartrate4_max30101/config/brd2703a/mikroe_max30101_config.h +++ b/driver/public/mikroe/heartrate4_max30101/config/brd2703a/mikroe_max30101_config.h @@ -40,6 +40,8 @@ #ifndef MIKROE_MAX30101_CONFIG_H_ #define MIKROE_MAX30101_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/heartrate4_max30101/config/brd4108a/mikroe_max30101_config.h b/driver/public/mikroe/heartrate4_max30101/config/brd4108a/mikroe_max30101_config.h index 965accbf..1a1d7a22 100644 --- a/driver/public/mikroe/heartrate4_max30101/config/brd4108a/mikroe_max30101_config.h +++ b/driver/public/mikroe/heartrate4_max30101/config/brd4108a/mikroe_max30101_config.h @@ -40,6 +40,8 @@ #ifndef MIKROE_MAX30101_CONFIG_H_ #define MIKROE_MAX30101_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/heartrate4_max30101/config/brd4314a/mikroe_max30101_config.h b/driver/public/mikroe/heartrate4_max30101/config/brd4314a/mikroe_max30101_config.h index 965accbf..1a1d7a22 100644 --- a/driver/public/mikroe/heartrate4_max30101/config/brd4314a/mikroe_max30101_config.h +++ b/driver/public/mikroe/heartrate4_max30101/config/brd4314a/mikroe_max30101_config.h @@ -40,6 +40,8 @@ #ifndef MIKROE_MAX30101_CONFIG_H_ #define MIKROE_MAX30101_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_config.h b/driver/public/mikroe/heartrate4_max30101/config/brd4338a/mikroe_max30101_config.h similarity index 78% rename from driver/public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_config.h rename to driver/public/mikroe/heartrate4_max30101/config/brd4338a/mikroe_max30101_config.h index 641556cf..6b7c1698 100644 --- a/driver/public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_config.h +++ b/driver/public/mikroe/heartrate4_max30101/config/brd4338a/mikroe_max30101_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_smoke2_adpd188bi_config.h - * @brief Smoke2 Click Configuration + * @file mikroe_max30101_config.h + * @brief SCL MAX30101 Configuration * @version 1.0.0 ******************************************************************************* * # License @@ -37,19 +37,25 @@ * ******************************************************************************/ -#ifndef MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ -#define MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ +#ifndef MIKROE_MAX30101_CONFIG_H_ +#define MIKROE_MAX30101_CONFIG_H_ -#include "em_gpio.h" +#ifdef __cplusplus +extern "C" { +#endif // <<< sl:start pin_tool >>> -// MIKROE_SMOKE2_ADPD188BI_INT -// $[GPIO_MIKROE_SMOKE2_ADPD188BI_INT] -#define MIKROE_SMOKE2_ADPD188BI_INT_PORT gpioPortB -#define MIKROE_SMOKE2_ADPD188BI_INT_PIN 1 -// [GPIO_MIKROE_SMOKE2_ADPD188BI_INT]$ +// MAX30101_INT +// $[GPIO_MAX30101_INT] +#define MAX30101_INT_PORT HP +#define MAX30101_INT_PIN 48 +// [GPIO_MAX30101_INT]$ // <<< sl:end pin_tool >>> -#endif /* MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ */ +#ifdef __cplusplus +} +#endif + +#endif /* MIKROE_MAX30101_CONFIG_H_ */ diff --git a/driver/public/mikroe/heartrate4_max30101/config/other/mikroe_max30101_config.h b/driver/public/mikroe/heartrate4_max30101/config/other/mikroe_max30101_config.h index 345eb78a..6e677110 100644 --- a/driver/public/mikroe/heartrate4_max30101/config/other/mikroe_max30101_config.h +++ b/driver/public/mikroe/heartrate4_max30101/config/other/mikroe_max30101_config.h @@ -40,6 +40,10 @@ #ifndef MIKROE_MAX30101_CONFIG_H_ #define MIKROE_MAX30101_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/heartrate4_max30101/inc/mikroe_max30101.h b/driver/public/mikroe/heartrate4_max30101/inc/mikroe_max30101.h index 01b4fcc2..7903b7ba 100644 --- a/driver/public/mikroe/heartrate4_max30101/inc/mikroe_max30101.h +++ b/driver/public/mikroe/heartrate4_max30101/inc/mikroe_max30101.h @@ -39,8 +39,9 @@ #ifndef MIKROE_MAX30101_H_ #define MIKROE_MAX30101_H_ + #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -148,7 +149,7 @@ typedef struct * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_max30101_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_max30101_init(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief @@ -161,7 +162,7 @@ sl_status_t mikroe_max30101_init(sl_i2cspm_t *i2cspm_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_max30101_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_max30101_set_i2c_instance(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/heartrate4_max30101/src/mikroe_max30101.c b/driver/public/mikroe/heartrate4_max30101/src/mikroe_max30101.c index 9c27210e..c5aa2aea 100644 --- a/driver/public/mikroe/heartrate4_max30101/src/mikroe_max30101.c +++ b/driver/public/mikroe/heartrate4_max30101/src/mikroe_max30101.c @@ -40,37 +40,38 @@ #include "heartrate4.h" #include "mikroe_max30101.h" #include "mikroe_max30101_config.h" -#include "third_party_hw_drivers_helpers.h" static heartrate4_t heartrate4; static heartrate4_cfg_t heartrate4_cfg; -sl_status_t mikroe_max30101_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_max30101_init(mikroe_i2c_handle_t i2c_instance) { - if (i2cspm_instance == NULL) { + if (i2c_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); // Configure default i2csmp instance - heartrate4.i2c.handle = i2cspm_instance; + heartrate4.i2c.handle = i2c_instance; + + // Call basic setup functions + heartrate4_cfg_setup(&heartrate4_cfg); #if defined(MAX30101_INT_PORT) && defined(MAX30101_INT_PIN) heartrate4_cfg.int1 = hal_gpio_pin_name(MAX30101_INT_PORT, MAX30101_INT_PIN); #endif - // Call basic setup functions - heartrate4_cfg_setup(&heartrate4_cfg); - - THIRD_PARTY_HW_DRV_RETCODE_TEST(heartrate4_init(&heartrate4, - &heartrate4_cfg)); + if (heartrate4_init(&heartrate4, &heartrate4_cfg) != HEARTRATE4_OK) { + return SL_STATUS_INITIALIZATION; + } mikroe_max30101_default_cfg(); - THIRD_PARTY_HW_DRV_RETCODE_TEST(mikroe_max30101_present()); + if (mikroe_max30101_present() != HEARTRATE4_OK) { + return SL_STATUS_NOT_AVAILABLE; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } /***************************************************************************//** @@ -88,13 +89,13 @@ sl_status_t mikroe_max30101_present(void) return SL_STATUS_OK; } -sl_status_t mikroe_max30101_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_max30101_set_i2c_instance(mikroe_i2c_handle_t i2c_instance) { - if (NULL == i2cspm_instance) { + if (NULL == i2c_instance) { return SL_STATUS_INVALID_PARAMETER; } - heartrate4.i2c.handle = i2cspm_instance; + heartrate4.i2c.handle = i2c_instance; return SL_STATUS_OK; } diff --git a/driver/public/mikroe/hvac_scd41/config/mikroe_scd41_config.h b/driver/public/mikroe/hvac_scd41/config/mikroe_scd41_config.h new file mode 100644 index 00000000..d49510c2 --- /dev/null +++ b/driver/public/mikroe/hvac_scd41/config/mikroe_scd41_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file mikroe_scd41_config.h + * @brief mikroe scd41 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SCD41_CONFIG_H +#define MIKROE_SCD41_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SCD41 I2C Configuration + +// MIKROE SCD41 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SCD41_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SCD41_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_SCD41_CONFIG_H \ No newline at end of file diff --git a/driver/public/mikroe/hvac_scd41/inc/mikroe_scd41.h b/driver/public/mikroe/hvac_scd41/inc/mikroe_scd41.h index 354684ec..1a47cf1b 100644 --- a/driver/public/mikroe/hvac_scd41/inc/mikroe_scd41.h +++ b/driver/public/mikroe/hvac_scd41/inc/mikroe_scd41.h @@ -38,9 +38,10 @@ ******************************************************************************/ #ifndef MIKROE_HVAC_SCD41_INC_H_ #define MIKROE_HVAC_SCD41_INC_H_ + #include "sl_status.h" -#include "sl_i2cspm.h" #include "hvac.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -95,7 +96,7 @@ typedef mass_and_num_cnt_data_t mikroe_scd41_mass_and_num_cnt_data_t; * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_scd41_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_scd41_init(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief @@ -108,7 +109,7 @@ sl_status_t mikroe_scd41_init(sl_i2cspm_t *i2cspm_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_scd41_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_scd41_set_i2csmp_instance(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/hvac_scd41/src/mikroe_scd41.c b/driver/public/mikroe/hvac_scd41/src/mikroe_scd41.c index 9f32411d..2b832a88 100644 --- a/driver/public/mikroe/hvac_scd41/src/mikroe_scd41.c +++ b/driver/public/mikroe/hvac_scd41/src/mikroe_scd41.c @@ -37,19 +37,24 @@ * ******************************************************************************/ #include "mikroe_scd41.h" +#include "mikroe_scd41_config.h" #include "hvac.h" static hvac_t scd41; static hvac_cfg_t scd41_cfg; -sl_status_t mikroe_scd41_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_scd41_init(mikroe_i2c_handle_t i2c_instance) { sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - if (NULL != i2cspm_instance) { - scd41.i2c.handle = i2cspm_instance; + if (NULL != i2c_instance) { + scd41.i2c.handle = i2c_instance; hvac_cfg_setup(&scd41_cfg); +#if (MIKROE_SCD41_I2C_UC == 1) + scd41_cfg.i2c_speed = MIKROE_SCD41_I2C_SPEED_MODE; +#endif + if (I2C_MASTER_SUCCESS == hvac_init(&scd41, &scd41_cfg)) { stt = SL_STATUS_OK; } else { @@ -59,12 +64,12 @@ sl_status_t mikroe_scd41_init(sl_i2cspm_t *i2cspm_instance) return stt; } -sl_status_t mikroe_scd41_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_scd41_set_i2csmp_instance(mikroe_i2c_handle_t i2c_instance) { sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - if (NULL != i2cspm_instance) { - scd41.i2c.handle = i2cspm_instance; + if (NULL != i2c_instance) { + scd41.i2c.handle = i2c_instance; stt = SL_STATUS_OK; } return stt; diff --git a/driver/public/mikroe/irthermo3_mlx90632/config/mikroe_mlx90632_config.h b/driver/public/mikroe/irthermo3_mlx90632/config/mikroe_mlx90632_config.h index 02032e2f..81834e95 100644 --- a/driver/public/mikroe/irthermo3_mlx90632/config/mikroe_mlx90632_config.h +++ b/driver/public/mikroe/irthermo3_mlx90632/config/mikroe_mlx90632_config.h @@ -46,6 +46,24 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> +//MIKROE I2C MLX90632 Configuration + +// MIKROE I2C MLX90632 UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_I2C_MLX90632_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_I2C_MLX90632_SPEED_MODE 0 + +// +// + // Address setting // MLX90632 I2C ADDRESS // <0x3A=> 0x3A @@ -60,4 +78,4 @@ extern "C" { } #endif -#endif /* SCL_MLX90632_CONFIG_H_ */ +#endif // SCL_MLX90632_CONFIG_H_ diff --git a/driver/public/mikroe/irthermo3_mlx90632/inc/mikroe_mlx90632.h b/driver/public/mikroe/irthermo3_mlx90632/inc/mikroe_mlx90632.h index e160ed03..3c5cd5c5 100644 --- a/driver/public/mikroe/irthermo3_mlx90632/inc/mikroe_mlx90632.h +++ b/driver/public/mikroe/irthermo3_mlx90632/inc/mikroe_mlx90632.h @@ -39,8 +39,9 @@ #ifndef MIKROE_MLX90632_H_ #define MIKROE_MLX90632_H_ + #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -208,7 +209,7 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_mlx90632_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_mlx90632_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -239,7 +240,8 @@ void mikroe_mlx90632_default_config(void); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_mlx90632_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_mlx90632_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -387,4 +389,5 @@ float mikroe_mlx90632_get_object_temperature(void); #ifdef __cplusplus } #endif -#endif /* MIKROE_MLX90632_H_ */ + +#endif // MIKROE_MLX90632_H_ diff --git a/driver/public/mikroe/irthermo3_mlx90632/src/mikroe_mlx90632.c b/driver/public/mikroe/irthermo3_mlx90632/src/mikroe_mlx90632.c index 62edd628..430ab595 100644 --- a/driver/public/mikroe/irthermo3_mlx90632/src/mikroe_mlx90632.c +++ b/driver/public/mikroe/irthermo3_mlx90632/src/mikroe_mlx90632.c @@ -40,18 +40,16 @@ #include "irthermo3.h" #include "mikroe_mlx90632.h" #include "mikroe_mlx90632_config.h" -#include "third_party_hw_drivers_helpers.h" static irthermo3_t irthermo3; static irthermo3_cfg_t irthermo3_cfg; static uint8_t adr_rst[4] = { 0x30, 0x05, 0x00, 0x06 }; -sl_status_t mikroe_mlx90632_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_mlx90632_init(mikroe_i2c_handle_t i2cspm_instance) { if (i2cspm_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); // Configure default i2csmp instance irthermo3.i2c.handle = i2cspm_instance; @@ -61,12 +59,19 @@ sl_status_t mikroe_mlx90632_init(sl_i2cspm_t *i2cspm_instance) irthermo3_cfg.i2c_address = MLX90632_I2C_ADDR; - THIRD_PARTY_HW_DRV_RETCODE_TEST(irthermo3_init(&irthermo3, - &irthermo3_cfg)); +#if (MIKROE_I2C_MLX90632_UC == 1) + irthermo3_cfg.i2c_speed = MIKROE_I2C_MLX90632_SPEED_MODE; +#endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(mikroe_mlx90632_present()); + if (irthermo3_init(&irthermo3, &irthermo3_cfg) != IRTHERMO3_OK) { + return SL_STATUS_INITIALIZATION; + } + + if (mikroe_mlx90632_present() != SL_STATUS_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } sl_status_t mikroe_mlx90632_present(void) @@ -85,7 +90,8 @@ void mikroe_mlx90632_default_config(void) mikroe_mlx90632_cal(); } -sl_status_t mikroe_mlx90632_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_mlx90632_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance) { if (NULL == i2cspm_instance) { return SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_config.h b/driver/public/mikroe/lr9_ra_08/config/brd2703a/mikroe_ra_08_config.h similarity index 77% rename from driver/public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_config.h rename to driver/public/mikroe/lr9_ra_08/config/brd2703a/mikroe_ra_08_config.h index 2c5c73e9..869e1447 100644 --- a/driver/public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_config.h +++ b/driver/public/mikroe/lr9_ra_08/config/brd2703a/mikroe_ra_08_config.h @@ -1,7 +1,7 @@ /***************************************************************************//** - * @file mikroe_smoke2_adpd188bi_config.h - * @brief Smoke2 Click Configuration - * @version 1.0.0 + * @file mikroe_ra_08_config.h + * @brief Mikroe LR 9 Click Configuration + * @version 1.2.0 ******************************************************************************* * # License * Copyright 2022 Silicon Laboratories Inc. www.silabs.com @@ -37,19 +37,34 @@ * ******************************************************************************/ -#ifndef MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ -#define MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ +#ifndef MIKROE_RA_08_CONFIG_H_ +#define MIKROE_RA_08_CONFIG_H_ #include "em_gpio.h" +#ifdef __cplusplus +extern "C" +{ +#endif + // <<< sl:start pin_tool >>> -// MIKROE_SMOKE2_ADPD188BI_INT -// $[GPIO_MIKROE_SMOKE2_ADPD188BI_INT] -#define MIKROE_SMOKE2_ADPD188BI_INT_PORT gpioPortB -#define MIKROE_SMOKE2_ADPD188BI_INT_PIN 3 -// [GPIO_MIKROE_SMOKE2_ADPD188BI_INT]$ +// LR9_RESET +// $[GPIO_LR9_RESET] +#define LR9_RESET_PORT gpioPortC +#define LR9_RESET_PIN 8 +// [GPIO_LR9_RESET]$ + +// LR9_BT +// $[GPIO_LR9_BT] +#define LR9_BT_PORT gpioPortB +#define LR9_BT_PIN 0 +// [GPIO_LR9_BT]$ // <<< sl:end pin_tool >>> -#endif /* MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_RA_08_CONFIG_H_ diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_config.h b/driver/public/mikroe/lr9_ra_08/config/brd4108a/mikroe_ra_08_config.h similarity index 77% rename from driver/public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_config.h rename to driver/public/mikroe/lr9_ra_08/config/brd4108a/mikroe_ra_08_config.h index 2c5c73e9..0f538739 100644 --- a/driver/public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_config.h +++ b/driver/public/mikroe/lr9_ra_08/config/brd4108a/mikroe_ra_08_config.h @@ -1,7 +1,7 @@ /***************************************************************************//** - * @file mikroe_smoke2_adpd188bi_config.h - * @brief Smoke2 Click Configuration - * @version 1.0.0 + * @file mikroe_ra_08_config.h + * @brief Mikroe LR 9 Click Configuration + * @version 1.2.0 ******************************************************************************* * # License * Copyright 2022 Silicon Laboratories Inc. www.silabs.com @@ -37,19 +37,34 @@ * ******************************************************************************/ -#ifndef MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ -#define MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ +#ifndef MIKROE_RA_08_CONFIG_H_ +#define MIKROE_RA_08_CONFIG_H_ #include "em_gpio.h" +#ifdef __cplusplus +extern "C" +{ +#endif + // <<< sl:start pin_tool >>> -// MIKROE_SMOKE2_ADPD188BI_INT -// $[GPIO_MIKROE_SMOKE2_ADPD188BI_INT] -#define MIKROE_SMOKE2_ADPD188BI_INT_PORT gpioPortB -#define MIKROE_SMOKE2_ADPD188BI_INT_PIN 3 -// [GPIO_MIKROE_SMOKE2_ADPD188BI_INT]$ +// LR9_RESET +// $[GPIO_LR9_RESET] +#define LR9_RESET_PORT gpioPortC +#define LR9_RESET_PIN 6 +// [GPIO_LR9_RESET]$ + +// LR9_BT +// $[GPIO_LR9_BT] +#define LR9_BT_PORT gpioPortB +#define LR9_BT_PIN 0 +// [GPIO_LR9_BT]$ // <<< sl:end pin_tool >>> -#endif /* MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_RA_08_CONFIG_H_ diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_config.h b/driver/public/mikroe/lr9_ra_08/config/brd4314a/mikroe_ra_08_config.h similarity index 76% rename from driver/public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_config.h rename to driver/public/mikroe/lr9_ra_08/config/brd4314a/mikroe_ra_08_config.h index 6a7e7537..0f538739 100644 --- a/driver/public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_config.h +++ b/driver/public/mikroe/lr9_ra_08/config/brd4314a/mikroe_ra_08_config.h @@ -1,7 +1,7 @@ /***************************************************************************//** - * @file mikroe_smoke2_adpd188bi_config.h - * @brief Smoke2 Click Configuration - * @version 1.0.0 + * @file mikroe_ra_08_config.h + * @brief Mikroe LR 9 Click Configuration + * @version 1.2.0 ******************************************************************************* * # License * Copyright 2022 Silicon Laboratories Inc. www.silabs.com @@ -37,20 +37,34 @@ * ******************************************************************************/ -#ifndef MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ -#define MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ +#ifndef MIKROE_RA_08_CONFIG_H_ +#define MIKROE_RA_08_CONFIG_H_ #include "em_gpio.h" +#ifdef __cplusplus +extern "C" +{ +#endif + // <<< sl:start pin_tool >>> -// MIKROE_SMOKE2_ADPD188BI_INT -// $[GPIO_MIKROE_SMOKE2_ADPD188BI_INT] -#warning "MIKROE_SMOKE2_ADPD188BI_INT is not configured" -// #define MIKROE_SMOKE2_ADPD188BI_INT_PORT gpioPortB -// #define MIKROE_SMOKE2_ADPD188BI_INT_PIN 3 -// [GPIO_MIKROE_SMOKE2_ADPD188BI_INT]$ +// LR9_RESET +// $[GPIO_LR9_RESET] +#define LR9_RESET_PORT gpioPortC +#define LR9_RESET_PIN 6 +// [GPIO_LR9_RESET]$ + +// LR9_BT +// $[GPIO_LR9_BT] +#define LR9_BT_PORT gpioPortB +#define LR9_BT_PIN 0 +// [GPIO_LR9_BT]$ // <<< sl:end pin_tool >>> -#endif /* MIKROE_SMOKE2_ADPD188BI_CONFIG_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_RA_08_CONFIG_H_ diff --git a/driver/public/mikroe/lr9_ra_08/config/other/mikroe_ra_08_config.h b/driver/public/mikroe/lr9_ra_08/config/other/mikroe_ra_08_config.h new file mode 100644 index 00000000..01370451 --- /dev/null +++ b/driver/public/mikroe/lr9_ra_08/config/other/mikroe_ra_08_config.h @@ -0,0 +1,35 @@ +#ifndef MIKROE_RA_08_CONFIG_H_ +#define MIKROE_RA_08_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< sl:start pin_tool >>> + +// LR9_RESET +// $[GPIO_LR9_RESET] +#warning "RESET pin for RA 08 is not configured" +// #define LR9_RESET_PORT gpioPortC +// #define LR9_RESET_PIN 8 +// [GPIO_LR9_RESET]$ + +// LR9_BT +// $[GPIO_LR9_BT] +#warning "BT pin for RA 08 is not configured" +// #define LR9_BT_PORT gpioPortB +// #define LR9_BT_PIN 0 +// [GPIO_LR9_BT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_RA_08_CONFIG_H_ diff --git a/driver/public/mikroe/lr9_ra_08/inc/mikroe_ra_08.h b/driver/public/mikroe/lr9_ra_08/inc/mikroe_ra_08.h new file mode 100644 index 00000000..4a7f67d0 --- /dev/null +++ b/driver/public/mikroe/lr9_ra_08/inc/mikroe_ra_08.h @@ -0,0 +1,330 @@ +/***************************************************************************//** + * @file mikroe_ra_08.h + * @brief SCL Mikroe LR RA-08 header file + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_RA_08_H_ +#define MIKROE_RA_08_H_ + +#include "sl_status.h" +#include "drv_uart.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * @addtogroup lr9 LR 9 Click Driver + * @brief API for configuring and manipulating LR 9 Click driver. + * @{ + */ + +/** + * @defgroup mikroe_ra_08_cmd LR 9 Device Settings + * @brief Settings for registers of LR 9 Click driver. + */ + +/** + * @addtogroup mikroe_ra_08_cmd + * @{ + */ + +/** + * @brief LR 9 AT Command. + * @details Specified setting for AT Command of LR 9 Click driver. + */ +#define MIKROE_RA_08_CMD_AT "AT" + +/** + * @brief LR 9 LoRaWAN General Command Sets commands. + * @details Specified setting for LoRaWAN General Command Sets Commands of LR 9 + * Click driver. + */ +#define MIKROE_RA_08_CMD_CGMI "CGMI" +#define MIKROE_RA_08_CMD_CGMM "CGMM" +#define MIKROE_RA_08_CMD_CGMR "CGMR" +#define MIKROE_RA_08_CMD_CGSN "CGSN" +#define MIKROE_RA_08_CMD_CGBR "CGBR" + +/** + * @brief LR 9 LoRaWAN Network Related Parameter Setup Command Sets commands. + * @details Specified setting for LoRaWAN Network Related Parameter Setup + * Command Sets Commands of LR 9 Click driver. + */ +#define MIKROE_RA_08_CMD_CJOINMODE "CJOINMODE" +#define MIKROE_RA_08_CMD_CDEVEUI "CDEVEUI" +#define MIKROE_RA_08_CMD_CAPPEUI "CAPPEUI" +#define MIKROE_RA_08_CMD_CAPPKEY "CAPPKEY" +#define MIKROE_RA_08_CMD_CDEVADDR "CDEVADDR" +#define MIKROE_RA_08_CMD_CAPPSKEY "CAPPSKEY" +#define MIKROE_RA_08_CMD_CNWKSKEY "CNWKSKEY" +#define MIKROE_RA_08_CMD_CFREQBANDMASK "CFREQBANDMASK" +#define MIKROE_RA_08_CMD_CULDLMODE "CULDLMODE" +#define MIKROE_RA_08_CMD_CADDMUTICAST "CADDMUTICAST" +#define MIKROE_RA_08_CMD_CDELMUTICAST "CDELMUTICAST" +#define MIKROE_RA_08_CMD_CNUMMUTICAST "CNUMMUTICAST" +#define MIKROE_RA_08_CMD_CWORKMODE "CWORKMODE" +#define MIKROE_RA_08_CMD_CCLASS "CCLASS" +#define MIKROE_RA_08_CMD_CBL "CBL" +#define MIKROE_RA_08_CMD_CSTATUS "CSTATUS" +#define MIKROE_RA_08_CMD_CJOIN "CJOIN" +#define MIKROE_RA_08_CMD_CPINGSLOTINFOREQ "CPINGSLOTINFOREQ" +#define MIKROE_RA_08_CMD_DTRX "DTRX" +#define MIKROE_RA_08_CMD_DRX "DRX" + +/** + * @brief LR 9 LoRaWAN MAC Setup Command Sets. + * @details Specified setting for LoRaWAN MAC Setup Command Sets of LR 9 Click + * driver. + */ +#define MIKROE_RA_08_CMD_CCONFIRM "CCONFIRM" +#define MIKROE_RA_08_CMD_CAPPPORT "CAPPPORT" +#define MIKROE_RA_08_CMD_CDATARATE "CDATARATE" +#define MIKROE_RA_08_CMD_CRSSI "CRSSI" +#define MIKROE_RA_08_CMD_CNBTRIALS "CNBTRIALS" +#define MIKROE_RA_08_CMD_CRM "CRM" +#define MIKROE_RA_08_CMD_CTXP "CTXP" +#define MIKROE_RA_08_CMD_CLINKCHECK "CLINKCHECK" +#define MIKROE_RA_08_CMD_CADR "CADR" +#define MIKROE_RA_08_CMD_CRXP "CRXP" +#define MIKROE_RA_08_CMD_CRX1DELAY "CRX1DELAY" +#define MIKROE_RA_08_CMD_CSAVE "CSAVE" +#define MIKROE_RA_08_CMD_CRESTORE "CRESTORE" + +/** + * @brief LR 9 Other Command Sets. + * @details Specified setting for Other Command Sets of LR 9 Click driver. + */ +#define MIKROE_RA_08_CMD_IREBOOT "IREBOOT" +#define MIKROE_RA_08_CMD_ILOGLVL "ILOGLVL" + +/** + * @brief LR 9 Private Command Sets. + * @details Specified setting for Private Command Sets of LR 9 Click driver. + */ +#define MIKROE_RA_08_CMD_CKEYSPROTECT "CKEYSPROTECT" + +/** + * @brief LR 9 LoRa Test Commands. + * @details Specified setting for LoRa Test Commands of LR 9 Click driver. + */ +#define MIKROE_RA_08_CMD_CTXADDRSET "CTXADDRSET" +#define MIKROE_RA_08_CMD_CADDRSET "CADDRSET" +#define MIKROE_RA_08_CMD_CTX "CTX" +#define MIKROE_RA_08_CMD_CRX "CRX" +#define MIKROE_RA_08_CMD_CRXS "CRXS" + +/** + * @brief LR 9 Data Receive Configuration Commands. + * @details Specified setting for Data Receive Configuration Commands of LR 9 + * Click driver. + */ +#define MIKROE_RA_08_DTRX_CONFIG "0" +#define MIKROE_RA_08_DTRX_UNCONFIG "1" + +/** + * @brief LR 9 configuration and limits data values. + * @details Specified setting for configuration data values of LR 9 Click + * driver. + */ +#define MIKROE_RA_08_DTRX_CONFIG_DATA 0 +#define MIKROE_RA_08_DTRX_UNCONFIG_DATA 1 +#define MIKROE_RA_08_NB_TRIALS_MIN 1 +#define MIKROE_RA_08_NB_TRIALS_2 2 +#define MIKROE_RA_08_NB_TRIALS_MAX 15 +#define MIKROE_RA_08_DATA_FRAME_MAX 10 +#define MIKROE_RA_08_MSG_START_POS 16 + +/** + * @brief LR 9 control symbols. + * @details Specified setting for control symbols of LR 9 Click driver. + */ +#define MIKROE_RA_08_SYMBOL_END_CMD "\r\n" +#define MIKROE_RA_08_SYMBOL_QUERY "?" +#define MIKROE_RA_08_SYMBOL_SET_VAL_CMD "=" +#define MIKROE_RA_08_SYMBOL_PREFIX_CMD "+" +#define MIKROE_RA_08_SYMBOL_SEPARATOR "," +#define MIKROE_RA_08_SYMBOL_SPACE " " +#define MIKROE_RA_08_SYMBOL_NULL "" +#define MIKROE_RA_08_SYMBOL_QUOTE "\"" +#define MIKROE_RA_08_ASCII_SPACE 0x20 +#define MIKROE_RA_08_ASCII_QUOTE 0x22 + +/** + * @brief LR 9 driver buffer size. + * @details Specified size of driver ring buffer. + * @note Increase buffer size if needed. + */ +#define LR9_TX_DRV_BUFFER_SIZE 100 +#define LR9_RX_DRV_BUFFER_SIZE 300 + +/*! @} */ // mikroe_ra_08_cmd + +/** + * @defgroup mikroe_ra_08_map LR 9 MikroBUS Map + * @brief MikroBUS pin mapping of LR 9 Click driver. + */ + +/** + * @addtogroup mikroe_ra_08_map + * @{ + */ + +/** + * @brief LR 9 Click enable equal to data symbol. + * @details Predefined enum values for driver enable equal to data symbol. + */ +typedef enum +{ + MIKROE_RA_08_EQUAL_DISABLE = 0, + MIKROE_RA_08_EQUAL_ENABLE +} mikroe_ra_08_en_set_t; + +/** + * @brief LR 9 configuration object setup function. + * @details This function initializes click configuration structure to initial + * values. + * @return Nothing. + * @note The all used pins will be set to unconnected state. + */ +void mikroe_ra_08_cfg_setup(void); + +/** + * @brief LR 9 initialization function. + * @details This function initializes all necessary pins and peripherals used + * for this click board. + * @param[in] instance : UART handler + * @return @li @c SL_STATUS_OK - Success, + * @li @c SL_SATATUS_FAIL - Error. + * See #err_t definition for detailed explanation. + * @note None. + */ +sl_status_t mikroe_ra_08_init(mikroe_uart_handle_t instance); + +/** + * @brief LR 9 HW reset function. + * @details This function performs a hardware reset of the device. + * @return Nothing. + * @note None. + */ +void mikroe_ra_08_hw_reset(void); + +/** + * @brief LR 9 set BOOT pin state function. + * @details This function sets a desired logic state of the BT pin. + * @param[in] state : Pin logic state. + * @return Nothing. + * @note None. + */ +void mikroe_ra_08_set_boot_pin(uint8_t state); + +/** + * @brief LR 9 data writing function. + * @details This function writes a desired number of data bytes by using UART + * serial interface. + * @param[in] data_in : Data buffer for sending. + * @param[in] len : Number of bytes for sending. + * @return @li @c SL_STATUS_OK - Success, + * @li @c SL_STATUS_FAIL - Error. + * @note None. + */ +sl_status_t mikroe_ra_08_generic_write(uint8_t *data_in, uint16_t len); + +/** + * @brief LR 9 data reading function. + * @details This function reads a desired number of data bytes by using UART + * serial interface. + * @param[in] ctx : Click context object. + * See #lr9_t object definition for detailed explanation. + * @param[out] data_out : Output read data. + * @param[out] rx_size : Number of bytes is read. + * @param[in] len : Number of bytes to be read. + * @return @li @c SL_STATUS_OK - Success, + * @li @c SL_STATUS_FAIL - Error. + * See #err_t definition for detailed explanation. + * @note None. + */ +sl_status_t mikroe_ra_08_generic_read(uint8_t *data_out, + uint16_t len, + int32_t *rx_size); + +/** + * @brief LR 9 command writing function. + * @details This function writes a desired command and parameter by using UART + * serial interface. + * @param[in] ctx : Click context object. + * See #lr9_t object definition for detailed explanation. + * @param[in] command : Command buffer for sending. + * @param[in] param : Parameter buffer for sending. + * @return @li @c SL_STATUS_OK - Success, + * @li @c SL_STATUS_FAIL - Error. + * @note None. + */ +sl_status_t mikroe_ra_08_write_command(uint8_t *command, uint8_t *param); + +/** + * @brief LR 9 inquire writing function. + * @details Using the UART serial interface, this function writes the desired + * query command + * with or without the included equals symbol. + * @param[in] command : Command buffer for sending. + * @param[in] en_set : en_set. + * @return @li @c SL_STATUS_OK - Success, + * @li @c SL_STATUS_FAIL - Error. + * @note None. + */ +sl_status_t mikroe_ra_08_inquire_command(uint8_t *command, + mikroe_ra_08_en_set_t en_set); + +/** + * @brief LR 9 send data frame function. + * @details This function sends the desired data frame by using the UART serial + * interface. + * @param[out] data_frame : data_frame. + * @param[in] confirm : confirm. + * @param[in] nbtrials : nbtrials. + * @return @li @c SL_STATUS_OK - Success, + * @li @c SL_STATUS_FAIL - Error. + * @note None. + */ +sl_status_t mikroe_ra_08_send_data_frame(uint8_t confirm, + uint8_t nbtrials, + uint8_t *data_frame); + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_RA_08_H_ diff --git a/driver/public/mikroe/lr9_ra_08/src/mikroe_ra_08.c b/driver/public/mikroe/lr9_ra_08/src/mikroe_ra_08.c new file mode 100644 index 00000000..10cae865 --- /dev/null +++ b/driver/public/mikroe/lr9_ra_08/src/mikroe_ra_08.c @@ -0,0 +1,138 @@ +/***************************************************************************//** + * @file mikroe_pl_n823_01.h + * @brief SCL Mikroe PIR PL_N823_01 header file + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#include "drv_digital_out.h" +#include "drv_digital_in.h" +#include "mikroe_ra_08.h" +#include "mikroe_ra_08_config.h" +#include "lr9.h" + +static lr9_t lr; +static lr9_cfg_t lr_cfg; + +sl_status_t mikroe_ra_08_init(mikroe_uart_handle_t instance) +{ + if (instance == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + + lr.uart.handle = instance; + lr9_cfg_setup(&lr_cfg); + +#if defined (LR9_RESET_PORT) && defined(LR9_RESET_PIN) + lr_cfg.rst = hal_gpio_pin_name(LR9_RESET_PORT, + LR9_RESET_PIN); +#endif + +#if defined (LR9_BT_PORT) && defined(LR9_BT_PIN) + lr_cfg.bt = hal_gpio_pin_name(LR9_BT_PORT, + LR9_BT_PIN); +#endif + + if (LR9_OK != lr9_init(&lr, &lr_cfg)) { + return SL_STATUS_INITIALIZATION; + } + + return SL_STATUS_OK; +} + +void mikroe_ra_08_hw_reset(void) +{ + lr9_hw_reset(&lr); +} + +void mikroe_ra_08_set_boot_pin(uint8_t state) +{ + lr9_set_boot_pin(&lr, state); +} + +sl_status_t mikroe_ra_08_generic_write(uint8_t *data_in, uint16_t len) +{ + if (data_in == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (lr9_generic_write(&lr, data_in, len) == LR9_OK) ? SL_STATUS_OK + : SL_STATUS_FAIL; +} + +sl_status_t mikroe_ra_08_generic_read(uint8_t *data_out, + uint16_t len, + int32_t *rx_size) +{ + if (data_out == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + + *rx_size = lr9_generic_read(&lr, data_out, len); + return (*rx_size > 0) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t mikroe_ra_08_write_command(uint8_t *command, uint8_t *param) +{ + if ((command == NULL) || (param == NULL)) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (lr9_write_command(&lr, command, param) >= 0) ? SL_STATUS_OK + : SL_STATUS_FAIL; +} + +sl_status_t mikroe_ra_08_inquire_command(uint8_t *command, + mikroe_ra_08_en_set_t en_set) +{ + if (command == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (lr9_inquire_command(&lr, command, + (lr9_en_set_t)en_set) >= 0) ? SL_STATUS_OK + : SL_STATUS_FAIL; +} + +sl_status_t mikroe_ra_08_send_data_frame(uint8_t confirm, uint8_t nbtrials, + uint8_t *data_frame) +{ + if (data_frame == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (lr9_send_data_frame(&lr, confirm, nbtrials, data_frame) == LR9_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} diff --git a/driver/public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_lte_iot2_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_bg96_config.h similarity index 89% rename from driver/public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_lte_iot2_bg96_config.h rename to driver/public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_bg96_config.h index 655eb951..380c2c74 100644 --- a/driver/public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_lte_iot2_bg96_config.h +++ b/driver/public/mikroe/lte_iot2_bg96/config/brd2703a/mikroe_bg96_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_lte_iot2_bg96_config.h - * @brief mikroe_lte_iot2_bg96_config.h + * @file mikroe_bg96_config.h + * @brief mikroe_bg96_config.h * @version 1.0.0 ******************************************************************************* * # License @@ -36,26 +36,26 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_LTE_IOT2_BG96_CONFIG_H_ -#define MIKROE_LTE_IOT2_BG96_CONFIG_H_ +#ifndef MIKROE_BG96_CONFIG_H_ +#define MIKROE_BG96_CONFIG_H_ + +#include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif -#include "em_gpio.h" // <<< Use Configuration Wizard in Context Menu // LTE IOT2 BG96 Settings // Maximum AT Command Length -// Default: 300 -#define CMD_MAX_SIZE 300 +// Default: 256 +#define CMD_MAX_SIZE 256 // Size of buffer to receive AT Command response -// Default: 300 -#define IN_BUFFER_SIZE 300 +// Default: 256 +#define IN_BUFFER_SIZE 256 // Size of queue to store at_cmd_desc_t // Default: 20 @@ -84,4 +84,4 @@ extern "C" } #endif -#endif /* MIKROE_LTE_IOT2_BG96_CONFIG_H_ */ +#endif // MIKROE_BG96_CONFIG_H_ diff --git a/driver/public/mikroe/lte_iot2_bg96/config/brd2703a/sl_iostream_usart_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/brd2703a/sl_iostream_usart_bg96_config.h deleted file mode 100644 index ee6881cf..00000000 --- a/driver/public/mikroe/lte_iot2_bg96/config/brd2703a/sl_iostream_usart_bg96_config.h +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_BG96_CONFIG_H -#define SL_IOSTREAM_USART_BG96_CONFIG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_BG96_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_BG96_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_BG96_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_BG96_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_BG96_RX_BUFFER_SIZE 300 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_BG96_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict -// the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep -// the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_BG96_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_BG96 -// $[USART_SL_IOSTREAM_USART_BG96] -#define SL_IOSTREAM_USART_BG96_PERIPHERAL USART0 -#define SL_IOSTREAM_USART_BG96_PERIPHERAL_NO 0 - -// USART0 TX on PB01 -#define SL_IOSTREAM_USART_BG96_TX_PORT gpioPortD -#define SL_IOSTREAM_USART_BG96_TX_PIN 4 - -// USART0 RX on PB02 -#define SL_IOSTREAM_USART_BG96_RX_PORT gpioPortD -#define SL_IOSTREAM_USART_BG96_RX_PIN 5 - -// [USART_SL_IOSTREAM_USART_BG96]$ -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/driver/public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_lte_iot2_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_bg96_config.h similarity index 89% rename from driver/public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_lte_iot2_bg96_config.h rename to driver/public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_bg96_config.h index b3d53e17..190d8b38 100644 --- a/driver/public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_lte_iot2_bg96_config.h +++ b/driver/public/mikroe/lte_iot2_bg96/config/brd4108a/mikroe_bg96_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_lte_iot2_bg96_config.h - * @brief mikroe_lte_iot2_bg96_config.h + * @file mikroe_bg96_config.h + * @brief mikroe_bg96_config.h * @version 1.0.0 ******************************************************************************* * # License @@ -36,26 +36,26 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_LTE_IOT2_BG96_CONFIG_H_ -#define MIKROE_LTE_IOT2_BG96_CONFIG_H_ +#ifndef MIKROE_BG96_CONFIG_H_ +#define MIKROE_BG96_CONFIG_H_ + +#include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif -#include "em_gpio.h" // <<< Use Configuration Wizard in Context Menu // LTE IOT2 BG96 Settings // Maximum AT Command Length -// Default: 300 -#define CMD_MAX_SIZE 300 +// Default: 256 +#define CMD_MAX_SIZE 256 // Size of buffer to receive AT Command response -// Default: 300 -#define IN_BUFFER_SIZE 300 +// Default: 256 +#define IN_BUFFER_SIZE 256 // Size of queue to store at_cmd_desc_t // Default: 20 @@ -84,4 +84,4 @@ extern "C" } #endif -#endif /* MIKROE_LTE_IOT2_BG96_CONFIG_H_ */ +#endif // MIKROE_BG96_CONFIG_H_ diff --git a/driver/public/mikroe/lte_iot2_bg96/config/brd4108a/sl_iostream_usart_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/brd4108a/sl_iostream_usart_bg96_config.h deleted file mode 100644 index c49ee600..00000000 --- a/driver/public/mikroe/lte_iot2_bg96/config/brd4108a/sl_iostream_usart_bg96_config.h +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_BG96_CONFIG_H -#define SL_IOSTREAM_USART_BG96_CONFIG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_BG96_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_BG96_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_BG96_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_BG96_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_BG96_RX_BUFFER_SIZE 300 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_BG96_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict -// the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep -// the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_BG96_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_BG96 -// $[USART_SL_IOSTREAM_USART_BG96] -#define SL_IOSTREAM_USART_BG96_PERIPHERAL USART1 -#define SL_IOSTREAM_USART_BG96_PERIPHERAL_NO 1 - -// USART0 TX on PB01 -#define SL_IOSTREAM_USART_BG96_TX_PORT gpioPortB -#define SL_IOSTREAM_USART_BG96_TX_PIN 1 - -// USART0 RX on PB02 -#define SL_IOSTREAM_USART_BG96_RX_PORT gpioPortB -#define SL_IOSTREAM_USART_BG96_RX_PIN 2 - -// [USART_SL_IOSTREAM_USART_BG96]$ -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/driver/public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_lte_iot2_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_bg96_config.h similarity index 89% rename from driver/public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_lte_iot2_bg96_config.h rename to driver/public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_bg96_config.h index b3d53e17..190d8b38 100644 --- a/driver/public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_lte_iot2_bg96_config.h +++ b/driver/public/mikroe/lte_iot2_bg96/config/brd4314a/mikroe_bg96_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_lte_iot2_bg96_config.h - * @brief mikroe_lte_iot2_bg96_config.h + * @file mikroe_bg96_config.h + * @brief mikroe_bg96_config.h * @version 1.0.0 ******************************************************************************* * # License @@ -36,26 +36,26 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_LTE_IOT2_BG96_CONFIG_H_ -#define MIKROE_LTE_IOT2_BG96_CONFIG_H_ +#ifndef MIKROE_BG96_CONFIG_H_ +#define MIKROE_BG96_CONFIG_H_ + +#include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif -#include "em_gpio.h" // <<< Use Configuration Wizard in Context Menu // LTE IOT2 BG96 Settings // Maximum AT Command Length -// Default: 300 -#define CMD_MAX_SIZE 300 +// Default: 256 +#define CMD_MAX_SIZE 256 // Size of buffer to receive AT Command response -// Default: 300 -#define IN_BUFFER_SIZE 300 +// Default: 256 +#define IN_BUFFER_SIZE 256 // Size of queue to store at_cmd_desc_t // Default: 20 @@ -84,4 +84,4 @@ extern "C" } #endif -#endif /* MIKROE_LTE_IOT2_BG96_CONFIG_H_ */ +#endif // MIKROE_BG96_CONFIG_H_ diff --git a/driver/public/mikroe/lte_iot2_bg96/config/brd4314a/sl_iostream_usart_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/brd4314a/sl_iostream_usart_bg96_config.h deleted file mode 100644 index c49ee600..00000000 --- a/driver/public/mikroe/lte_iot2_bg96/config/brd4314a/sl_iostream_usart_bg96_config.h +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_BG96_CONFIG_H -#define SL_IOSTREAM_USART_BG96_CONFIG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_BG96_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_BG96_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_BG96_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_BG96_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_BG96_RX_BUFFER_SIZE 300 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_BG96_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict -// the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep -// the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_BG96_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_BG96 -// $[USART_SL_IOSTREAM_USART_BG96] -#define SL_IOSTREAM_USART_BG96_PERIPHERAL USART1 -#define SL_IOSTREAM_USART_BG96_PERIPHERAL_NO 1 - -// USART0 TX on PB01 -#define SL_IOSTREAM_USART_BG96_TX_PORT gpioPortB -#define SL_IOSTREAM_USART_BG96_TX_PIN 1 - -// USART0 RX on PB02 -#define SL_IOSTREAM_USART_BG96_RX_PORT gpioPortB -#define SL_IOSTREAM_USART_BG96_RX_PIN 2 - -// [USART_SL_IOSTREAM_USART_BG96]$ -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/driver/public/mikroe/lte_iot2_bg96/config/brd4338a/mikroe_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/brd4338a/mikroe_bg96_config.h new file mode 100644 index 00000000..2a093d30 --- /dev/null +++ b/driver/public/mikroe/lte_iot2_bg96/config/brd4338a/mikroe_bg96_config.h @@ -0,0 +1,85 @@ +/***************************************************************************//** + * @file mikroe_bg96_config.h + * @brief mikroe_bg96_config.h + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_BG96_CONFIG_H_ +#define MIKROE_BG96_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu + +// LTE IOT2 BG96 Settings + +// Maximum AT Command Length +// Default: 256 +#define CMD_MAX_SIZE 256 + +// Size of buffer to receive AT Command response +// Default: 256 +#define IN_BUFFER_SIZE 256 + +// Size of queue to store at_cmd_desc_t +// Default: 20 +#define CMD_Q_SIZE 20 +// end LTE IOT2 BG96 config + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// BG96_STA +// $[GPIO_BG96_STA] +#define BG96_STA_PORT 0 +#define BG96_STA_PIN 46 +// [GPIO_BG96_STA]$ + +// BG96_PWK +// $[GPIO_BG96_PWK] +#define BG96_PWK_PORT 0 +#define BG96_PWK_PIN 47 +// [GPIO_BG96_PWK]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_BG96_CONFIG_H_ diff --git a/driver/public/mikroe/lte_iot2_bg96/config/other/mikroe_lte_iot2_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/other/mikroe_bg96_config.h similarity index 89% rename from driver/public/mikroe/lte_iot2_bg96/config/other/mikroe_lte_iot2_bg96_config.h rename to driver/public/mikroe/lte_iot2_bg96/config/other/mikroe_bg96_config.h index e5e9c57c..96d3bd72 100644 --- a/driver/public/mikroe/lte_iot2_bg96/config/other/mikroe_lte_iot2_bg96_config.h +++ b/driver/public/mikroe/lte_iot2_bg96/config/other/mikroe_bg96_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_lte_iot2_bg96_config.h - * @brief mikroe_lte_iot2_bg96_config.h + * @file mikroe_bg96_config.h + * @brief mikroe_bg96_config.h * @version 1.0.0 ******************************************************************************* * # License @@ -36,26 +36,28 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_LTE_IOT2_BG96_CONFIG_H_ -#define MIKROE_LTE_IOT2_BG96_CONFIG_H_ +#ifndef MIKROE_BG96_CONFIG_H_ +#define MIKROE_BG96_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif -#include "em_gpio.h" // <<< Use Configuration Wizard in Context Menu // LTE IOT2 BG96 Settings // Maximum AT Command Length -// Default: 300 -#define CMD_MAX_SIZE 300 +// Default: 256 +#define CMD_MAX_SIZE 256 // Size of buffer to receive AT Command response -// Default: 300 -#define IN_BUFFER_SIZE 300 +// Default: 256 +#define IN_BUFFER_SIZE 256 // Size of queue to store at_cmd_desc_t // Default: 20 @@ -86,4 +88,4 @@ extern "C" } #endif -#endif /* MIKROE_LTE_IOT2_BG96_CONFIG_H_ */ +#endif // MIKROE_BG96_CONFIG_H_ diff --git a/driver/public/mikroe/lte_iot2_bg96/config/other/sl_iostream_usart_bg96_config.h b/driver/public/mikroe/lte_iot2_bg96/config/other/sl_iostream_usart_bg96_config.h deleted file mode 100644 index 110ea6b0..00000000 --- a/driver/public/mikroe/lte_iot2_bg96/config/other/sl_iostream_usart_bg96_config.h +++ /dev/null @@ -1,114 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_BG96_CONFIG_H -#define SL_IOSTREAM_USART_BG96_CONFIG_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_BG96_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_BG96_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_BG96_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_BG96_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_BG96_RX_BUFFER_SIZE 300 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_BG96_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict -// the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep -// the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_BG96_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_BG96 -// $[USART_SL_IOSTREAM_USART_BG96] -#define SL_IOSTREAM_USART_BG96_PERIPHERAL USART1 -#define SL_IOSTREAM_USART_BG96_PERIPHERAL_NO 1 - -// USART0 TX -#warning "USART_BG96_TX is not configured" -// #define SL_IOSTREAM_USART_BG96_TX_PORT gpioPortB -// #define SL_IOSTREAM_USART_BG96_TX_PIN 1 - -// USART0 RX -#warning "USART_BG96_RX is not configured" -// #define SL_IOSTREAM_USART_BG96_RX_PORT gpioPortB -// #define SL_IOSTREAM_USART_BG96_RX_PIN 2 - -// [USART_SL_IOSTREAM_USART_BG96]$ -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_core.h b/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_core.h index 25991cde..301dde48 100644 --- a/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_core.h +++ b/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_core.h @@ -63,7 +63,7 @@ typedef struct { * @brief * AT parser core initialization *****************************************************************************/ -void at_parser_init(sl_iostream_t *iostream_handle); +void at_parser_init(mikroe_uart_handle_t handle); /**************************************************************************//** * @brief diff --git a/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_platform.h b/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_platform.h index 1f4ee21c..42346657 100644 --- a/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_platform.h +++ b/driver/public/mikroe/lte_iot2_bg96/inc/at_parser_platform.h @@ -36,11 +36,9 @@ #ifndef AT_PARSER_PLATFORM_H_ #define AT_PARSER_PLATFORM_H_ -#include "em_cmu.h" -#include "em_eusart.h" #include "sl_status.h" -#include "sl_iostream_handles.h" -#include "mikroe_lte_iot2_bg96_config.h" +#include "drv_uart.h" +#include "mikroe_bg96_config.h" /******************************************************************************* ******************************** MACROS *********************************** @@ -61,27 +59,18 @@ typedef struct { uint32_t timeout_ms; } at_cmd_desc_t; -/**************************************************************************//** - * @brief - * CMU initialization. - *****************************************************************************/ -void initCMU(void); - -/**************************************************************************//** - * @brief - * GPIO initialization. - *****************************************************************************/ -void initGPIO(void); - /**************************************************************************//** * @brief * Initialization of platform driver. * + * @param[in] handle + * Mikroe UART handle instance. * @param[in] line_callback * Callback function for new line (and ">" character for special commands). * *****************************************************************************/ -void at_platform_init(sl_iostream_t *iostream_handle, ln_cb_t line_callback); +sl_status_t at_platform_init(mikroe_uart_handle_t handle, + ln_cb_t line_callback); /**************************************************************************//** * @brief @@ -107,8 +96,7 @@ sl_status_t at_platform_check_device_ready(void); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if cmd == NULL. ******************************************************************************/ -sl_status_t at_platform_send_cmd(volatile uint8_t *cmd, - volatile uint16_t timeout_ms); +sl_status_t at_platform_send_cmd(uint8_t *cmd, uint16_t timeout_ms); /**************************************************************************//** * @brief diff --git a/driver/public/mikroe/lte_iot2_bg96/inc/mikroe_bg96.h b/driver/public/mikroe/lte_iot2_bg96/inc/mikroe_bg96.h index fe076934..12597b27 100644 --- a/driver/public/mikroe/lte_iot2_bg96/inc/mikroe_bg96.h +++ b/driver/public/mikroe/lte_iot2_bg96/inc/mikroe_bg96.h @@ -46,11 +46,12 @@ extern "C" { #include #include #include -#include "em_cmu.h" -#include "em_usart.h" -#include "sl_iostream_handles.h" #include "sl_status.h" +#include "drv_digital_in.h" +#include "drv_digital_out.h" #include "at_parser_core.h" +#include "drv_uart.h" +#include "mikroe_bg96_config.h" /******************************************************************************* ******************************** MACROS *********************************** @@ -95,7 +96,7 @@ typedef struct { * BG96 module initialize function. * *****************************************************************************/ -void bg96_init(sl_iostream_t *iostream_handle); +void bg96_init(mikroe_uart_handle_t handle); /**************************************************************************//** * @brief @@ -183,7 +184,7 @@ sl_status_t bg96_gnss_stop(at_scheduler_status_t *output_object); * BG96 NB IoT initialization. * *****************************************************************************/ -void bg96_nb_init(sl_iostream_t *iostream_handle); +void bg96_nb_init(mikroe_uart_handle_t handle); /**************************************************************************//** * @brief diff --git a/driver/public/mikroe/lte_iot2_bg96/src/at_parser_core.c b/driver/public/mikroe/lte_iot2_bg96/src/at_parser_core.c index 784055fb..26798f07 100644 --- a/driver/public/mikroe/lte_iot2_bg96/src/at_parser_core.c +++ b/driver/public/mikroe/lte_iot2_bg96/src/at_parser_core.c @@ -36,7 +36,7 @@ #include #include #include -#include "app_queue.h" +#include "circular_queue.h" #include "at_parser_core.h" #include "at_parser_platform.h" @@ -46,7 +46,7 @@ #define has_substring(container, substr) \ (NULL != strstr((const char *) new_line, (const char *)substr)) -APP_QUEUE(cmd_q, at_cmd_desc_t, CMD_Q_SIZE); +static Queue_t cmd_q; static at_cmd_scheduler_state_t sch_state = SCH_READY; static at_scheduler_status_t *global_status; @@ -60,10 +60,10 @@ static void at_parser_get_ip(uint8_t *response, uint8_t *ip_output); * @brief * AT parser core initialization *****************************************************************************/ -void at_parser_init(sl_iostream_t *iostream_handle) +void at_parser_init(mikroe_uart_handle_t handle) { - APP_QUEUE_INIT(&cmd_q, at_cmd_desc_t, CMD_Q_SIZE); - at_platform_init(iostream_handle, general_platform_cb); + queueInit(&cmd_q, CMD_Q_SIZE); + at_platform_init(handle, general_platform_cb); } /**************************************************************************//** @@ -141,14 +141,14 @@ sl_status_t at_parser_start_scheduler(at_scheduler_status_t *output_object) if (SCH_READY != sch_state) { return SL_STATUS_BUSY; } - if (app_queue_is_empty(&cmd_q)) { + if (queueIsEmpty(&cmd_q)) { return SL_STATUS_OK; } sch_state = SCH_SENDING; global_status = output_object; at_parser_init_output_object(global_status); - app_queue_peek(&cmd_q, (uint8_t *)&at_cmd_descriptor); + at_cmd_descriptor = *((at_cmd_desc_t *)queuePeek(&cmd_q)); return at_platform_send_cmd(at_cmd_descriptor.cms_string, at_cmd_descriptor.timeout_ms); } @@ -185,7 +185,7 @@ at_cmd_scheduler_state_t at_parser_get_scheduler_state() *****************************************************************************/ sl_status_t at_parser_add_cmd_to_q(const at_cmd_desc_t *at_cmd_descriptor) { - if (app_queue_is_full(&cmd_q)) { + if (queueIsFull(&cmd_q)) { return SL_STATUS_ALLOCATION_FAILED; } @@ -193,7 +193,11 @@ sl_status_t at_parser_add_cmd_to_q(const at_cmd_desc_t *at_cmd_descriptor) return SL_STATUS_INVALID_PARAMETER; } - return app_queue_add(&cmd_q, (uint8_t *)at_cmd_descriptor); + if (queueAdd(&cmd_q, (at_cmd_desc_t *)at_cmd_descriptor) == true) { + return SL_STATUS_OK; + } else { + return SL_STATUS_ALLOCATION_FAILED; + } } /**************************************************************************//** @@ -228,10 +232,10 @@ void at_parser_process(void) switch (sch_state) { case SCH_PROCESSED: // remove previous command - app_queue_remove(&cmd_q, (uint8_t *)&at_cmd_descriptor); + at_cmd_descriptor = *((at_cmd_desc_t *)queueRemove(&cmd_q)); at_platform_finish_cmd(); - if (!app_queue_is_empty(&cmd_q)) { - app_queue_peek(&cmd_q, (uint8_t *)&at_cmd_descriptor); + if (!queueIsEmpty(&cmd_q)) { + at_cmd_descriptor = *((at_cmd_desc_t *)queuePeek(&cmd_q)); at_platform_send_cmd(at_cmd_descriptor.cms_string, at_cmd_descriptor.timeout_ms); sch_state = SCH_SENDING; @@ -242,8 +246,8 @@ void at_parser_process(void) break; case SCH_ERROR: at_platform_finish_cmd(); - while (!app_queue_is_empty(&cmd_q)) { - app_queue_remove(&cmd_q, (uint8_t *)&at_cmd_descriptor); + while (!queueIsEmpty(&cmd_q)) { + at_cmd_descriptor = *((at_cmd_desc_t *)queueRemove(&cmd_q)); } global_status->status = SL_STATUS_OK; sch_state = SCH_READY; @@ -271,8 +275,8 @@ void at_parser_process(void) static void general_platform_cb(uint8_t *data, uint8_t call_number) { static at_cmd_desc_t at_cmd_descriptor; - if (!app_queue_is_empty(&cmd_q)) { - app_queue_peek(&cmd_q, (uint8_t *)&at_cmd_descriptor); + if (!queueIsEmpty(&cmd_q)) { + at_cmd_descriptor = *((at_cmd_desc_t *)queuePeek(&cmd_q)); // call number == 0 means timeout occurred if (call_number == 0) { diff --git a/driver/public/mikroe/lte_iot2_bg96/src/at_parser_platform.c b/driver/public/mikroe/lte_iot2_bg96/src/at_parser_platform.c index bb6652f3..94a03ac5 100644 --- a/driver/public/mikroe/lte_iot2_bg96/src/at_parser_platform.c +++ b/driver/public/mikroe/lte_iot2_bg96/src/at_parser_platform.c @@ -35,12 +35,8 @@ #include #include -#include "em_eusart.h" -#include "at_parser_platform.h" -#include "sl_iostream_handles.h" #include "sl_sleeptimer.h" -#include "app_queue.h" -#include "mikroe_lte_iot2_bg96_config.h" +#include "at_parser_platform.h" at_platform_status_t status = NOT_INITIALIZED; ln_cb_t global_cb = 0; @@ -48,53 +44,51 @@ sl_sleeptimer_timer_handle_t my_timer; static uint8_t line_counter = 0; static uint8_t input_buffer[IN_BUFFER_SIZE]; static uint16_t input_buffer_index = 0; -static sl_iostream_t *bg96_iostream_handle = NULL; -static void timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); +static uart_t bg96_uart; +static uint8_t bg96_uart_tx_buffer[256]; +static uint8_t bg96_uart_rx_buffer[256]; -/**************************************************************************//** - * @brief - * CMU initialization. - *****************************************************************************/ -void initCMU(void) -{ - // Enable clock to GPIO and EUSART1 - CMU_ClockEnable(cmuClock_GPIO, true); -} - -/**************************************************************************//** - * @brief - * GPIO initialization. - *****************************************************************************/ -void initGPIO(void) -{ - CMU_ClockEnable(cmuClock_GPIO, true); - GPIO_PinModeSet(BG96_PWK_PORT, - BG96_PWK_PIN, - gpioModePushPull, - 0); - - GPIO_PinModeSet(BG96_STA_PORT, - BG96_STA_PIN, - gpioModeInputPull, - 0); -} +static void timer_cb(sl_sleeptimer_timer_handle_t *handle, void *data); /**************************************************************************//** * @brief * Initialization of platform driver. * + * @param[in] handle + * Mikroe UART handle instance. * @param[in] line_callback * Callback function for new line (and ">" character for special commands). * *****************************************************************************/ -void at_platform_init(sl_iostream_t *iostream_handle, ln_cb_t line_callback) +sl_status_t at_platform_init(mikroe_uart_handle_t handle, ln_cb_t line_callback) { - bg96_iostream_handle = iostream_handle; + uart_config_t cfg; + + if (NULL == handle) { + return SL_STATUS_INVALID_PARAMETER; + } + + bg96_uart.handle = handle; + bg96_uart.tx_ring_buffer = bg96_uart_tx_buffer; + bg96_uart.rx_ring_buffer = bg96_uart_rx_buffer; + bg96_uart.is_blocking = false; + + uart_configure_default(&cfg); + + cfg.tx_ring_size = sizeof(bg96_uart_tx_buffer); + cfg.rx_ring_size = sizeof(bg96_uart_rx_buffer); + + if (uart_open(&bg96_uart, &cfg) != UART_SUCCESS) { + return SL_STATUS_INITIALIZATION; + } + + uart_set_blocking(&bg96_uart, false); + global_cb = line_callback; - initCMU(); - initGPIO(); status = READY; + + return SL_STATUS_OK; } /**************************************************************************//** @@ -138,8 +132,7 @@ sl_status_t at_platform_check_device_ready(void) * SL_STATUS_OK if there are no errors. * SL_STATUS_ALLOCATION_FAILED if cmd == NULL. *****************************************************************************/ -sl_status_t at_platform_send_cmd(volatile uint8_t *cmd, - volatile uint16_t timeout_ms) +sl_status_t at_platform_send_cmd(uint8_t *cmd, uint16_t timeout_ms) { sl_status_t st; @@ -147,8 +140,8 @@ sl_status_t at_platform_send_cmd(volatile uint8_t *cmd, size_t cmd_length = sl_strlen((char *) cmd); if (cmd_length < CMD_MAX_SIZE - 1) { sl_strcat_s((char *) cmd, CMD_MAX_SIZE, "\r"); - sl_iostream_write(bg96_iostream_handle, (const void *)cmd, - sl_strlen((char *) cmd)); + uart_clear(&bg96_uart); + uart_write(&bg96_uart, cmd, sl_strlen((char *) cmd)); line_counter = 0; status = TRANSMIT; @@ -183,8 +176,7 @@ void at_platform_process(void) { static uint8_t tempdata; - if (SL_STATUS_OK == sl_iostream_getchar(bg96_iostream_handle, - ( char *)&tempdata)) { + if (1 == uart_read(&bg96_uart, &tempdata, 1)) { input_buffer[input_buffer_index] = tempdata; if (input_buffer_index == 0) { diff --git a/driver/public/mikroe/lte_iot2_bg96/src/mikroe_bg96.c b/driver/public/mikroe/lte_iot2_bg96/src/mikroe_bg96.c index c655496e..18435b34 100644 --- a/driver/public/mikroe/lte_iot2_bg96/src/mikroe_bg96.c +++ b/driver/public/mikroe/lte_iot2_bg96/src/mikroe_bg96.c @@ -37,15 +37,10 @@ * ******************************************************************************/ #include - -#include "em_gpio.h" #include "sl_sleeptimer.h" - #include "at_parser_core.h" #include "at_parser_utility.h" - #include "mikroe_bg96.h" -#include "mikroe_lte_iot2_bg96_config.h" #define BITMASK_7BITS 0x7F #define BITMASK_8BITS 0xFF @@ -69,6 +64,9 @@ static enum { static bool required_state = false; static at_scheduler_status_t *global_output; +static digital_out_t pwk_pin; +static digital_in_t sta_pin; + static sl_sleeptimer_timer_handle_t bg96_timer_gpio_handle; static sl_sleeptimer_timer_handle_t bg96_timer_process_handler; static void bg96_timer_gpio_callback(sl_sleeptimer_timer_handle_t *handle, @@ -99,9 +97,14 @@ static void uint8_to_str(uint8_t input, uint8_t *output); * BG96 module initialize function. * *****************************************************************************/ -void bg96_init(sl_iostream_t *iostream_handle) +void bg96_init(mikroe_uart_handle_t handle) { - at_parser_init(iostream_handle); + at_parser_init(handle); + digital_out_init(&pwk_pin, + hal_gpio_pin_name(BG96_PWK_PORT, BG96_PWK_PIN)); + digital_in_pulldown_init(&sta_pin, + hal_gpio_pin_name(BG96_STA_PORT, BG96_STA_PIN)); + sl_sleeptimer_start_periodic_timer_ms(&bg96_timer_process_handler, 200, bg96_timer_process_callback, @@ -117,7 +120,7 @@ void bg96_init(sl_iostream_t *iostream_handle) *****************************************************************************/ bool bg96_is_alive(void) { - return (bool) GPIO_PinInGet(BG96_STA_PORT, BG96_STA_PIN); + return (bool) digital_in_read(&sta_pin); } /**************************************************************************//** @@ -142,7 +145,7 @@ sl_status_t bg96_sleep(at_scheduler_status_t *output_object) } global_output = output_object; - GPIO_PinOutSet(BG96_PWK_PORT, BG96_PWK_PIN); + digital_out_high(&pwk_pin); timer_status = sl_sleeptimer_restart_timer_ms(&bg96_timer_gpio_handle, BG96_GPIO_H_TIME, bg96_timer_gpio_callback, @@ -188,7 +191,7 @@ sl_status_t bg96_wake_up(at_scheduler_status_t *output_object) if (bg96_ready == bg96_state) { if (!bg96_is_alive()) { global_output = output_object; - GPIO_PinOutSet(BG96_PWK_PORT, BG96_PWK_PIN); + digital_out_high(&pwk_pin); sl_status_t timer_status = sl_sleeptimer_restart_timer_ms( &bg96_timer_gpio_handle, BG96_GPIO_H_TIME, @@ -307,9 +310,9 @@ sl_status_t bg96_gnss_stop(at_scheduler_status_t *output_object) * BG96 NB IoT initialization. * *****************************************************************************/ -void bg96_nb_init(sl_iostream_t *iostream_handle) +void bg96_nb_init(mikroe_uart_handle_t handle) { - bg96_init(iostream_handle); + bg96_init(handle); } /**************************************************************************//** @@ -1190,7 +1193,7 @@ static void bg96_timer_gpio_callback(sl_sleeptimer_timer_handle_t *handle, if (handle == &bg96_timer_gpio_handle) { switch (bg96_state) { case bg96_wait_for_gpio: - GPIO_PinOutClear(BG96_PWK_PORT, BG96_PWK_PIN); + digital_out_low(&pwk_pin); bg96_state = bg96_wait_for_device; sl_sleeptimer_restart_timer_ms(&bg96_timer_gpio_handle, diff --git a/driver/public/mikroe/mic2/config/brd2703a/mikroe_mic2_config.h b/driver/public/mikroe/mic2/config/brd2703a/mikroe_mic2_config.h index c095220d..fffa4711 100644 --- a/driver/public/mikroe/mic2/config/brd2703a/mikroe_mic2_config.h +++ b/driver/public/mikroe/mic2/config/brd2703a/mikroe_mic2_config.h @@ -40,12 +40,32 @@ #ifndef MIKORE_MIC2_CONFIG_H_ #define MIKORE_MIC2_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE MIC2 I2C Configuration + +// MIKROE MIC2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MIC2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_MIC2_I2C_SPEED_MODE 0 + +// +// + // MIC 2 I2C ADDRESS // <0x2C=> AD0_LOW // <0x2D=> AD0_HIGH @@ -68,4 +88,4 @@ extern "C" { } #endif -#endif /* MIKORE_MIC2_CONFIG_H_ */ +#endif // MIKORE_MIC2_CONFIG_H_ diff --git a/driver/public/mikroe/mic2/config/brd4108a/mikroe_mic2_config.h b/driver/public/mikroe/mic2/config/brd4108a/mikroe_mic2_config.h index c095220d..fffa4711 100644 --- a/driver/public/mikroe/mic2/config/brd4108a/mikroe_mic2_config.h +++ b/driver/public/mikroe/mic2/config/brd4108a/mikroe_mic2_config.h @@ -40,12 +40,32 @@ #ifndef MIKORE_MIC2_CONFIG_H_ #define MIKORE_MIC2_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE MIC2 I2C Configuration + +// MIKROE MIC2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MIC2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_MIC2_I2C_SPEED_MODE 0 + +// +// + // MIC 2 I2C ADDRESS // <0x2C=> AD0_LOW // <0x2D=> AD0_HIGH @@ -68,4 +88,4 @@ extern "C" { } #endif -#endif /* MIKORE_MIC2_CONFIG_H_ */ +#endif // MIKORE_MIC2_CONFIG_H_ diff --git a/driver/public/mikroe/mic2/config/brd4314a/mikroe_mic2_config.h b/driver/public/mikroe/mic2/config/brd4314a/mikroe_mic2_config.h index c095220d..fffa4711 100644 --- a/driver/public/mikroe/mic2/config/brd4314a/mikroe_mic2_config.h +++ b/driver/public/mikroe/mic2/config/brd4314a/mikroe_mic2_config.h @@ -40,12 +40,32 @@ #ifndef MIKORE_MIC2_CONFIG_H_ #define MIKORE_MIC2_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE MIC2 I2C Configuration + +// MIKROE MIC2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MIC2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_MIC2_I2C_SPEED_MODE 0 + +// +// + // MIC 2 I2C ADDRESS // <0x2C=> AD0_LOW // <0x2D=> AD0_HIGH @@ -68,4 +88,4 @@ extern "C" { } #endif -#endif /* MIKORE_MIC2_CONFIG_H_ */ +#endif // MIKORE_MIC2_CONFIG_H_ diff --git a/driver/public/mikroe/mic2/config/brd4338a/mikroe_mic2_config.h b/driver/public/mikroe/mic2/config/brd4338a/mikroe_mic2_config.h new file mode 100644 index 00000000..1e188b35 --- /dev/null +++ b/driver/public/mikroe/mic2/config/brd4338a/mikroe_mic2_config.h @@ -0,0 +1,79 @@ +/***************************************************************************//** + * @file mikroe_mic2_config.h + * @brief Mikroe Mic 2 Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKORE_MIC2_CONFIG_H_ +#define MIKORE_MIC2_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE MIC2 I2C Configuration + +// MIKROE MIC2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MIC2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_MIC2_I2C_SPEED_MODE 0 + +// +// + +// MIC 2 I2C ADDRESS +// <0x2C=> AD0_LOW +// <0x2D=> AD0_HIGH +// Default: 0x2C +#define MIC2_I2C_ADDRESS 0x2C + +// <<< end of configuration section >>> + +#ifdef __cplusplus +} + +#endif +#endif // MIKORE_MIC2_CONFIG_H_ diff --git a/driver/public/mikroe/mic2/config/other/mikroe_mic2_config.h b/driver/public/mikroe/mic2/config/other/mikroe_mic2_config.h index 3baca7ad..ca147d4f 100644 --- a/driver/public/mikroe/mic2/config/other/mikroe_mic2_config.h +++ b/driver/public/mikroe/mic2/config/other/mikroe_mic2_config.h @@ -40,12 +40,34 @@ #ifndef MIKORE_MIC2_CONFIG_H_ #define MIKORE_MIC2_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE MIC2 I2C Configuration + +// MIKROE MIC2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MIC2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_MIC2_I2C_SPEED_MODE 0 + +// +// + // MIC 2 I2C ADDRESS // <0x2C=> AD0_LOW // <0x2D=> AD0_HIGH @@ -69,4 +91,4 @@ extern "C" { } #endif -#endif /* MIKORE_MIC2_CONFIG_H_ */ \ No newline at end of file +#endif // MIKORE_MIC2_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/mikroe/mic2/inc/mikroe_mic2.h b/driver/public/mikroe/mic2/inc/mikroe_mic2.h index 2c207dab..c8fa8476 100644 --- a/driver/public/mikroe/mic2/inc/mikroe_mic2.h +++ b/driver/public/mikroe/mic2/inc/mikroe_mic2.h @@ -40,18 +40,10 @@ #ifndef MIKROE_MIC2_H_ #define MIKROE_MIC2_H_ -#include "em_cmu.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" +#include "drv_analog_in.h" #include "sl_status.h" -#if defined(_SILICON_LABS_32B_SERIES_1) -#include "em_adc.h" -typedef ADC_TypeDef adc_t; -#elif defined(_SILICON_LABS_32B_SERIES_2) -#include "em_iadc.h" -typedef IADC_TypeDef adc_t; -#endif - #ifdef __cplusplus extern "C" { #endif @@ -61,38 +53,29 @@ extern "C" { */ typedef uint16_t mikroe_mic2_data_t; -/** - * @brief Config Object Initialization function. - * - * @description This function initializes click configuration structure to init - * state. - * @note All used pins will be set to unconnected state. - */ -void mikroe_mic2_cfg_setup(void); - /** * @brief Set I2c instance function. * - * @param i2cspm_instance I2C handle instance. + * @param i2c_instance I2C handle instance. * * @return status of function. * @description This function initializes all necessary pins and peripherals * used for this click. */ -sl_status_t mikroe_mic2_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_mic2_set_i2cspm_instance(mikroe_i2c_handle_t i2c_instance); /** * @brief Initialization function. * - * @param i2cspm_instance I2C handle instance + * @param i2c_instance I2C handle instance * @param adc ADC or IADC handle * @return status of function. * * @description This function initializes all necessary pins and peripherals * used for this click. */ -sl_status_t mikroe_mic2_init(sl_i2cspm_t *i2cspm_instance, - adc_t *adc); +sl_status_t mikroe_mic2_init(mikroe_i2c_handle_t i2c_instance, + mikroe_adc_handle_t adc); /** * @brief Set potenciometer value. @@ -117,4 +100,4 @@ sl_status_t mikroe_mic2_generic_read(mikroe_mic2_data_t *data); } #endif -#endif /* MIKROE_MIC2_H_ */ +#endif // MIKROE_MIC2_H_ diff --git a/driver/public/mikroe/mic2/src/mikroe_mic2.c b/driver/public/mikroe/mic2/src/mikroe_mic2.c index de248fe9..85a1b6bc 100644 --- a/driver/public/mikroe/mic2/src/mikroe_mic2.c +++ b/driver/public/mikroe/mic2/src/mikroe_mic2.c @@ -40,25 +40,18 @@ #include "mic2.h" #include "mikroe_mic2.h" #include "mikroe_mic2_config.h" -#include "third_party_hw_drivers_helpers.h" static mic2_t mic2; static mic2_cfg_t mic2_cfg; -void mikroe_mic2_cfg_setup(void) +sl_status_t mikroe_mic2_init(mikroe_i2c_handle_t i2c_instance, + mikroe_adc_handle_t adc) { - mic2_cfg_setup(&mic2_cfg); -} - -sl_status_t mikroe_mic2_init(sl_i2cspm_t *i2cspm_instance, adc_t *adc) -{ - if ((NULL == i2cspm_instance) || (NULL == adc)) { + if ((NULL == i2c_instance) || (NULL == adc)) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - - mic2.i2c.handle = i2cspm_instance; + mic2.i2c.handle = i2c_instance; mic2.slave_address = MIC2_I2C_ADDRESS; mic2.adc.handle = adc; @@ -69,9 +62,15 @@ sl_status_t mikroe_mic2_init(sl_i2cspm_t *i2cspm_instance, adc_t *adc) MIC2_ANALOG_OUTPUT_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(mic2_init(&mic2, &mic2_cfg)); +#if (MIKROE_MIC2_I2C_UC == 1) + mic2_cfg.i2c_speed = MIKROE_MIC2_I2C_SPEED_MODE; +#endif + + if (mic2_init(&mic2, &mic2_cfg) != MIC2_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } void mikroe_mic2_set_potentiometer(uint8_t ptt_value) @@ -90,13 +89,13 @@ sl_status_t mikroe_mic2_generic_read(mikroe_mic2_data_t *data) return SL_STATUS_OK; } -sl_status_t mikroe_mic2_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_mic2_set_i2c_instance(mikroe_i2c_handle_t i2c_instance) { - if (NULL == i2cspm_instance) { + if (NULL == i2c_instance) { return SL_STATUS_INVALID_PARAMETER; } - mic2.i2c.handle = i2cspm_instance; + mic2.i2c.handle = i2c_instance; return SL_STATUS_OK; } diff --git a/driver/public/mikroe/microsd/config/mikroe_microsd_config.h b/driver/public/mikroe/microsd/config/brd2703a/mikroe_microsd_config.h similarity index 97% rename from driver/public/mikroe/microsd/config/mikroe_microsd_config.h rename to driver/public/mikroe/microsd/config/brd2703a/mikroe_microsd_config.h index 341caef6..4c8630a7 100644 --- a/driver/public/mikroe/microsd/config/mikroe_microsd_config.h +++ b/driver/public/mikroe/microsd/config/brd2703a/mikroe_microsd_config.h @@ -39,6 +39,8 @@ #ifndef MIKROE_MICROSD_CONFIG_H_ #define MIKROE_MICROSD_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -73,4 +75,4 @@ extern "C" { } #endif -#endif /* MIKROE_MICROSD_CONFIG_H_ */ +#endif // MIKROE_MICROSD_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/mikroe/microsd/config/brd4108a/mikroe_microsd_config.h b/driver/public/mikroe/microsd/config/brd4108a/mikroe_microsd_config.h new file mode 100644 index 00000000..4c8630a7 --- /dev/null +++ b/driver/public/mikroe/microsd/config/brd4108a/mikroe_microsd_config.h @@ -0,0 +1,78 @@ +/***************************************************************************//** + * @file mikroe_microsd_config.h + * @brief SCL microsd config file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_MICROSD_CONFIG_H_ +#define MIKROE_MICROSD_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// SDcard clock settings + +// Set slow clock for card initialization <100000-400000> +// +// Default: 200000 +#define MIKROE_MICROSD_MMC_SLOW_CLOCK 200000 + +// Set fast clock for card +// +// If set to 0, the default bitrate of SPI is used +// Default: 0 +#define MIKROE_MICROSD_MMC_FAST_CLOCK 0 +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_MICROSD_MMC_CD +// $[GPIO_MIKROE_MICROSD_MMC_CD] +#define MIKROE_MICROSD_MMC_CD_PORT gpioPortB +#define MIKROE_MICROSD_MMC_CD_PIN 0 +// [GPIO_MIKROE_MICROSD_MMC_CD]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_MICROSD_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/mikroe/microsd/config/brd4314a/mikroe_microsd_config.h b/driver/public/mikroe/microsd/config/brd4314a/mikroe_microsd_config.h new file mode 100644 index 00000000..4c8630a7 --- /dev/null +++ b/driver/public/mikroe/microsd/config/brd4314a/mikroe_microsd_config.h @@ -0,0 +1,78 @@ +/***************************************************************************//** + * @file mikroe_microsd_config.h + * @brief SCL microsd config file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_MICROSD_CONFIG_H_ +#define MIKROE_MICROSD_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// SDcard clock settings + +// Set slow clock for card initialization <100000-400000> +// +// Default: 200000 +#define MIKROE_MICROSD_MMC_SLOW_CLOCK 200000 + +// Set fast clock for card +// +// If set to 0, the default bitrate of SPI is used +// Default: 0 +#define MIKROE_MICROSD_MMC_FAST_CLOCK 0 +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_MICROSD_MMC_CD +// $[GPIO_MIKROE_MICROSD_MMC_CD] +#define MIKROE_MICROSD_MMC_CD_PORT gpioPortB +#define MIKROE_MICROSD_MMC_CD_PIN 0 +// [GPIO_MIKROE_MICROSD_MMC_CD]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_MICROSD_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/mikroe/microsd/config/brd4338a/mikroe_microsd_config.h b/driver/public/mikroe/microsd/config/brd4338a/mikroe_microsd_config.h new file mode 100644 index 00000000..2c948897 --- /dev/null +++ b/driver/public/mikroe/microsd/config/brd4338a/mikroe_microsd_config.h @@ -0,0 +1,76 @@ +/***************************************************************************//** + * @file mikroe_microsd_config.h + * @brief SCL microsd config file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_MICROSD_CONFIG_H_ +#define MIKROE_MICROSD_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// SDcard clock settings + +// Set slow clock for card initialization <100000-400000> +// +// Default: 200000 +#define MIKROE_MICROSD_MMC_SLOW_CLOCK 200000 + +// Set fast clock for card +// +// If set to 0, the default bitrate of SPI is used +// Default: 0 +#define MIKROE_MICROSD_MMC_FAST_CLOCK 0 +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_MICROSD_MMC_CD +// $[GPIO_MIKROE_MICROSD_MMC_CD] +#define MIKROE_MICROSD_MMC_CD_PORT HP +#define MIKROE_MICROSD_MMC_CD_PIN 46 +// [GPIO_MIKROE_MICROSD_MMC_CD]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_MICROSD_CONFIG_H_ diff --git a/driver/public/mikroe/microsd/config/other/mikroe_microsd_config.h b/driver/public/mikroe/microsd/config/other/mikroe_microsd_config.h new file mode 100644 index 00000000..2e344231 --- /dev/null +++ b/driver/public/mikroe/microsd/config/other/mikroe_microsd_config.h @@ -0,0 +1,81 @@ +/***************************************************************************//** + * @file mikroe_microsd_config.h + * @brief SCL microsd config file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_MICROSD_CONFIG_H_ +#define MIKROE_MICROSD_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// SDcard clock settings + +// Set slow clock for card initialization <100000-400000> +// +// Default: 200000 +#define MIKROE_MICROSD_MMC_SLOW_CLOCK 200000 + +// Set fast clock for card +// +// If set to 0, the default bitrate of SPI is used +// Default: 0 +#define MIKROE_MICROSD_MMC_FAST_CLOCK 0 +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_MICROSD_MMC_CD +// $[GPIO_MIKROE_MICROSD_MMC_CD] +#warning "CD pin for SD card is not configured" +// #define MIKROE_MICROSD_MMC_CD_PORT 0 +// #define MIKROE_MICROSD_MMC_CD_PIN 0 +// [GPIO_MIKROE_MICROSD_MMC_CD]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_MICROSD_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/mikroe/microsd/inc/sl_sdc_sd_card.h b/driver/public/mikroe/microsd/inc/sl_sdc_sd_card.h index f18b6d3d..49916f78 100644 --- a/driver/public/mikroe/microsd/inc/sl_sdc_sd_card.h +++ b/driver/public/mikroe/microsd/inc/sl_sdc_sd_card.h @@ -51,7 +51,7 @@ extern "C" { * * @return SL_STATUS_OK if successful. Error code otherwise. ******************************************************************************/ -sl_status_t sd_card_spi_init(SPIDRV_Handle_t spi_handle); +sl_status_t sd_card_spi_init(mikroe_spi_handle_t spi_handle); /***************************************************************************//** * @brief Initialize a SD Card. diff --git a/driver/public/mikroe/microsd/src/sl_sdc_sd_card.c b/driver/public/mikroe/microsd/src/sl_sdc_sd_card.c index e1414a5d..010d8061 100644 --- a/driver/public/mikroe/microsd/src/sl_sdc_sd_card.c +++ b/driver/public/mikroe/microsd/src/sl_sdc_sd_card.c @@ -32,36 +32,28 @@ * as a demonstration for evaluation purposes only. This code will be maintained * at the sole discretion of Silicon Labs. ******************************************************************************/ +#include "drv_digital_in.h" +#include "sl_sleeptimer.h" #include "sl_sdc_sd_card.h" #include "mikroe_microsd_config.h" typedef struct { - uint8_t mosiPort; - uint8_t mosiPin; - uint8_t misoPort; - uint8_t misoPin; - uint8_t clkPort; - uint8_t clkPin; - uint8_t csPort; - uint8_t csPin; -} SPI_Pins_t; - -static Ecode_t GetSpiPins(SPIDRV_Handle_t handle, SPI_Pins_t *pins); + spi_master_t spi; + digital_in_t cd_pin; + digital_in_t miso_pin; +} sd_card_t; // SPI bit rate controls // Set slow clock for card initialization (100k-400k) #define FCLK_SLOW() \ - sdc_platform_set_bit_rate(sdc_spi_handle, MIKROE_MICROSD_MMC_SLOW_CLOCK) + sdc_platform_set_bit_rate(&sd_card.spi, MIKROE_MICROSD_MMC_SLOW_CLOCK) // Set fast clock for generic read/write -#if MIKROE_MICROSD_MMC_FAST_CLOCK == 0 -#define FCLK_FAST() \ - if (sdc_spi_handle) { \ - sdc_platform_set_bit_rate(sdc_spi_handle, \ - sdc_spi_handle->initData.bitRate); \ - } +#if MIKROE_MICROSD_MMC_FAST_CLOCK +#define FCLK_FAST() \ + sdc_platform_set_bit_rate(&sd_card.spi, MIKROE_MICROSD_MMC_FAST_CLOCK) #else -#define FCLK_SLOW() sdc_platform_set_bit_rate(sdc_spi_handle, \ - MIKROE_MICROSD_MMC_FAST_CLOCK) +// The default bitrate of SPI is used +#define FCLK_FAST() #endif // Socket controls @@ -72,8 +64,7 @@ static Ecode_t GetSpiPins(SPIDRV_Handle_t handle, SPI_Pins_t *pins); #if defined(MIKROE_MICROSD_MMC_CD_PORT) && defined(MIKROE_MICROSD_MMC_CD_PORT) // Card detected (yes:true, no:false, default:true) -#define MMC_CD (!GPIO_PinInGet(MIKROE_MICROSD_MMC_CD_PORT, \ - MIKROE_MICROSD_MMC_CD_PIN)) +#define MMC_CD (!digital_in_read(&sd_card.cd_pin)) #endif // Definitions for MMC/SDC command @@ -104,7 +95,7 @@ static volatile DSTATUS sd_card_status = STA_NOINIT; // Disk status static BYTE sd_card_type; // Card type flags static volatile UINT sd_card_timer_1, sd_card_timer_2; // 1kHz decrement timer -static SPIDRV_Handle_t sdc_spi_handle = NULL; +static sd_card_t sd_card; static sl_sleeptimer_timer_handle_t disk_timerproc_timer_handle; static void disk_timerproc_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -135,7 +126,7 @@ static bool wait_ready(UINT wt) sd_card_timer_2 = wt; do { - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); // This loop takes a time. Insert rot_rdq() here for multitask envilonment. } while (data != 0xff && sd_card_timer_2); // Wait for card goes ready or // timeout @@ -153,8 +144,8 @@ static void deselect(void) BYTE data; CS_HIGH(); - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); // Dummy clock (force DO hi-z for - // multiple slave SPI) + // Dummy clock (force DO hi-z for multiple slave SPI) + sdc_xchg_spi(&sd_card.spi, 0xff, &data); } /***************************************************************************//** @@ -169,7 +160,7 @@ static bool select(void) CS_LOW(); // Dummy clock (force DO enabled) - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); if (wait_ready(500)) { return 1; // Wait for card ready @@ -197,7 +188,7 @@ static bool rcvr_datablock(BYTE *buff, UINT btr) sd_card_timer_1 = 100; do { // Wait for data packet in timeout of 100ms - sdc_xchg_spi(sdc_spi_handle, 0xff, &token); + sdc_xchg_spi(&sd_card.spi, 0xff, &token); } while ((token == 0xff) && sd_card_timer_1); // If not valid data token, return with error @@ -205,12 +196,12 @@ static bool rcvr_datablock(BYTE *buff, UINT btr) return 0; } - sdc_rcvr_spi_multi(sdc_spi_handle, buff, btr); // Receive the data block into - // buffer + // Receive the data block into buffer + sdc_rcvr_spi_multi(&sd_card.spi, buff, btr); // Discard 2 byte-CRC. // Refer to http://elm-chan.org/docs/mmc/mmc_e.html#dataxfer for details" - sdc_xchg_spi(sdc_spi_handle, 0xff, &token); - sdc_xchg_spi(sdc_spi_handle, 0xff, &token); + sdc_xchg_spi(&sd_card.spi, 0xff, &token); + sdc_xchg_spi(&sd_card.spi, 0xff, &token); return 1; } @@ -236,15 +227,15 @@ static bool xmit_datablock(const BYTE *buff, BYTE token) return 0; } - sdc_xchg_spi(sdc_spi_handle, token, &data); // Xmit a token + sdc_xchg_spi(&sd_card.spi, token, &data); // Xmit a token if (token != 0xfd) { // Not StopTran token - sdc_xmit_spi_multi(sdc_spi_handle, buff, 512); // Xmit the data block to the - // MMC + // Xmit the data block to the MMC + sdc_xmit_spi_multi(&sd_card.spi, buff, 512); // Discard 2 byte-CRC. // Refer to http://elm-chan.org/docs/mmc/mmc_e.html#dataxfer for details" - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); // Receive a data response + sdc_xchg_spi(&sd_card.spi, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); // Receive a data response // If not accepted, return with error if ((data & 0x1F) != 0x05) { return 0; @@ -290,11 +281,11 @@ static BYTE send_cmd(BYTE cmd, DWORD arg) } // Send command packet - sdc_xchg_spi(sdc_spi_handle, 0x40 | cmd, &data); // Start + Command index - sdc_xchg_spi(sdc_spi_handle, ((BYTE)(arg >> 24)), &data); // Argument[31..24] - sdc_xchg_spi(sdc_spi_handle, ((BYTE)(arg >> 16)), &data); // Argument[23..16] - sdc_xchg_spi(sdc_spi_handle, ((BYTE)(arg >> 8)), &data); // Argument[15..8] - sdc_xchg_spi(sdc_spi_handle, (BYTE)(arg), &data); // Argument[7..0] + sdc_xchg_spi(&sd_card.spi, 0x40 | cmd, &data); // Start + Command index + sdc_xchg_spi(&sd_card.spi, ((BYTE)(arg >> 24)), &data); // Argument[31..24] + sdc_xchg_spi(&sd_card.spi, ((BYTE)(arg >> 16)), &data); // Argument[23..16] + sdc_xchg_spi(&sd_card.spi, ((BYTE)(arg >> 8)), &data); // Argument[15..8] + sdc_xchg_spi(&sd_card.spi, (BYTE)(arg), &data); // Argument[7..0] n = 0x01; // Dummy CRC + Stop if (cmd == CMD0) { @@ -303,16 +294,16 @@ static BYTE send_cmd(BYTE cmd, DWORD arg) if (cmd == CMD8) { n = 0x87; // Valid CRC for CMD8(0x1AA) + Stop } - sdc_xchg_spi(sdc_spi_handle, n, &data); + sdc_xchg_spi(&sd_card.spi, n, &data); // Receive command response if (cmd == CMD12) { // Skip a stuff byte on stop to read - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); } n = 10; // Wait for a valid response in timeout of 10 attempts do { - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); } while ((data & 0x80) && --n); return data; // Return with the response value @@ -333,7 +324,7 @@ DSTATUS sd_card_disk_initialize(void) FCLK_SLOW(); for (n = 10; n; n--) { - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); // Send 80 dummy clocks + sdc_xchg_spi(&sd_card.spi, 0xff, &data); // Send 80 dummy clocks } ty = 0; @@ -342,7 +333,7 @@ DSTATUS sd_card_disk_initialize(void) if (send_cmd(CMD8, 0x1aa) == 1) { // Is the card SDv2? for (n = 0; n < 4; n++) { // Get 32 bit return value of R7 resp - sdc_xchg_spi(sdc_spi_handle, 0xff, &ocr[n]); + sdc_xchg_spi(&sd_card.spi, 0xff, &ocr[n]); } // Is the card supports vcc of 2.7-3.6V? @@ -354,7 +345,7 @@ DSTATUS sd_card_disk_initialize(void) // Check CCS bit in the OCR if (sd_card_timer_1 && (send_cmd(CMD58, 0) == 0)) { for (n = 0; n < 4; n++) { - sdc_xchg_spi(sdc_spi_handle, 0xff, &ocr[n]); + sdc_xchg_spi(&sd_card.spi, 0xff, &ocr[n]); } ty = (ocr[0] & 0x40) ? CT_SDC2 | CT_BLOCK : CT_SDC2; // Card id SDv2 } @@ -548,11 +539,11 @@ dresult_t sd_card_disk_ioctl(BYTE cmd, void *buff) case GET_BLOCK_SIZE: if (sd_card_type & CT_SDC2) { // SDv2? if (send_cmd(ACMD13, 0) == 0) { // Read SD status - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); if (rcvr_datablock(csd, 16)) {// Read partial block for (n = 64 - 16; n; n--) { // Purge trailing data - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); } *(DWORD *)buff = 16UL << (csd[10] >> 4); res = RES_OK; @@ -638,7 +629,7 @@ dresult_t sd_card_disk_ioctl(BYTE cmd, void *buff) // READ_OCR if (send_cmd(CMD58, 0) == 0) { for (n = 4; n; n--) { - *ptr++ = sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + *ptr++ = sdc_xchg_spi(&sd_card.spi, 0xff, &data); } res = RES_OK; } @@ -649,7 +640,7 @@ dresult_t sd_card_disk_ioctl(BYTE cmd, void *buff) case MMC_GET_SDSTAT: // SD_STATUS if (send_cmd(ACMD13, 0) == 0) { - sdc_xchg_spi(sdc_spi_handle, 0xff, &data); + sdc_xchg_spi(&sd_card.spi, 0xff, &data); if (rcvr_datablock(ptr, 64)) { res = RES_OK; } @@ -668,32 +659,27 @@ dresult_t sd_card_disk_ioctl(BYTE cmd, void *buff) /***************************************************************************//** * @brief Initialize SPI interface for SD Card. ******************************************************************************/ -sl_status_t sd_card_spi_init(SPIDRV_Handle_t spi_handle) +sl_status_t sd_card_spi_init(mikroe_spi_handle_t spi_handle) { bool timer_is_running = false; - sdc_spi_handle = spi_handle; + spi_master_config_t spi_cfg; + + spi_master_configure_default(&spi_cfg); + spi_cfg.mode = SPI_MASTER_MODE_0; + spi_cfg.speed = 1000000; + spi_cfg.default_write_data = 0xFF; - SPI_Pins_t pins; - Ecode_t ret; + sd_card.spi.handle = spi_handle; + if (spi_master_open(&sd_card.spi, &spi_cfg) != SPI_MASTER_SUCCESS) { + return SPI_MASTER_ERROR; + } #if defined(MIKROE_MICROSD_MMC_CD_PORT) && defined(MIKROE_MICROSD_MMC_CD_PORT) - GPIO_PinModeSet(MIKROE_MICROSD_MMC_CD_PORT, - MIKROE_MICROSD_MMC_CD_PIN, - gpioModeInputPull, - 1); + digital_in_pullup_init(&sd_card.cd_pin, + hal_gpio_pin_name(MIKROE_MICROSD_MMC_CD_PORT, + MIKROE_MICROSD_MMC_CD_PIN)); #endif - // MISO pin is not pulled-up by SDcard click board side with a resistor. - // This pin should be reconfigured in gpioModeInputPull mode. - ret = GetSpiPins(spi_handle, &pins); - if (ret != ECODE_EMDRV_SPIDRV_OK) { - return ret; - } - GPIO_PinModeSet(pins.misoPort, - pins.misoPin, - gpioModeInputPull, - 1); - // Make sure the disk_timerproc_timer_handle timer is initialized only once sl_sleeptimer_is_timer_running(&disk_timerproc_timer_handle, &timer_is_running); @@ -755,203 +741,3 @@ void disk_timerproc(void) #endif sd_card_status = s; } - -#if defined(_SILICON_LABS_32B_SERIES_0) - -/***************************************************************************//** - * @brief Get SPI pins for Series 0 devices. - ******************************************************************************/ -static Ecode_t GetSpiPins(SPIDRV_Handle_t handle, SPI_Pins_t *pins) -{ - uint32_t location; - - location = handle->initData.portLocation; - - if (0) { -#if defined(USART0) - } else if (handle->peripheral.usartPort == USART0) { - pins->mosiPort = AF_USART0_TX_PORT(location); - pins->misoPort = AF_USART0_RX_PORT(location); - pins->clkPort = AF_USART0_CLK_PORT(location); - pins->csPort = AF_USART0_CS_PORT(location); - pins->mosiPin = AF_USART0_TX_PIN(location); - pins->misoPin = AF_USART0_RX_PIN(location); - pins->clkPin = AF_USART0_CLK_PIN(location); - pins->csPin = AF_USART0_CS_PIN(location); -#endif -#if defined(USART1) - } else if (handle->peripheral.usartPort == USART1) { - pins->mosiPort = AF_USART1_TX_PORT(location); - pins->misoPort = AF_USART1_RX_PORT(location); - pins->clkPort = AF_USART1_CLK_PORT(location); - pins->csPort = AF_USART1_CS_PORT(location); - pins->mosiPin = AF_USART1_TX_PIN(location); - pins->misoPin = AF_USART1_RX_PIN(location); - pins->clkPin = AF_USART1_CLK_PIN(location); - pins->csPin = AF_USART1_CS_PIN(location); -#endif -#if defined(USART2) - } else if (handle->peripheral.usartPort == USART2) { - pins->mosiPort = AF_USART2_TX_PORT(location); - pins->misoPort = AF_USART2_RX_PORT(location); - pins->clkPort = AF_USART2_CLK_PORT(location); - pins->csPort = AF_USART2_CS_PORT(location); - pins->mosiPin = AF_USART2_TX_PIN(location); - pins->misoPin = AF_USART2_RX_PIN(location); - pins->clkPin = AF_USART2_CLK_PIN(location); - pins->csPin = AF_USART2_CS_PIN(location); -#endif -#if defined(USARTRF0) - } else if (handle->peripheral.usartPort == USARTRF0) { - pins->mosiPort = AF_USARTRF0_TX_PORT(location); - pins->misoPort = AF_USARTRF0_RX_PORT(location); - pins->clkPort = AF_USARTRF0_CLK_PORT(location); - pins->csPort = AF_USARTRF0_CS_PORT(location); - pins->mosiPin = AF_USARTRF0_TX_PIN(location); - pins->misoPin = AF_USARTRF0_RX_PIN(location); - pins->clkPin = AF_USARTRF0_CLK_PIN(location); - pins->csPin = AF_USARTRF0_CS_PIN(location); -#endif -#if defined(USARTRF1) - } else if (handle->peripheral.usartPort == USARTRF1) { - pins->mosiPort = AF_USARTRF1_TX_PORT(location); - pins->misoPort = AF_USARTRF1_RX_PORT(location); - pins->clkPort = AF_USARTRF1_CLK_PORT(location); - pins->csPort = AF_USARTRF1_CS_PORT(location); - pins->mosiPin = AF_USARTRF1_TX_PIN(location); - pins->misoPin = AF_USARTRF1_RX_PIN(location); - pins->clkPin = AF_USARTRF1_CLK_PIN(location); - pins->csPin = AF_USARTRF1_CS_PIN(location); -#endif - } else { - return ECODE_EMDRV_SPIDRV_PARAM_ERROR; - } - return ECODE_EMDRV_SPIDRV_OK; -} - -#endif - -#if defined(_SILICON_LABS_32B_SERIES_1) - -/***************************************************************************//** - * @brief Get SPI pins for Series 1 devices. - ******************************************************************************/ -static Ecode_t GetSpiPins(SPIDRV_Handle_t handle, SPI_Pins_t *pins) -{ - if (0) { -#if defined(USART0) - } else if (handle->peripheral.usartPort == USART0) { - pins->mosiPort = AF_USART0_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USART0_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USART0_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USART0_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USART0_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USART0_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USART0_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USART0_CS_PIN(handle->initData.portLocationCs); -#endif -#if defined(USART1) - } else if (handle->peripheral.usartPort == USART1) { - pins->mosiPort = AF_USART1_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USART1_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USART1_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USART1_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USART1_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USART1_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USART1_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USART1_CS_PIN(handle->initData.portLocationCs); -#endif -#if defined(USART2) - } else if (handle->peripheral.usartPort == USART2) { - pins->mosiPort = AF_USART2_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USART2_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USART2_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USART2_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USART2_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USART2_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USART2_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USART2_CS_PIN(handle->initData.portLocationCs); -#endif -#if defined(USART3) - } else if (handle->peripheral.usartPort == USART3) { - pins->mosiPort = AF_USART3_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USART3_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USART3_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USART3_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USART3_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USART3_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USART3_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USART3_CS_PIN(handle->initData.portLocationCs); -#endif -#if defined(USART4) - } else if (handle->peripheral.usartPort == USART4) { - pins->mosiPort = AF_USART4_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USART4_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USART4_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USART4_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USART4_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USART4_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USART4_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USART4_CS_PIN(handle->initData.portLocationCs); -#endif -#if defined(USART5) - } else if (handle->peripheral.usartPort == USART5) { - pins->mosiPort = AF_USART5_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USART5_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USART5_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USART5_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USART5_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USART5_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USART5_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USART5_CS_PIN(handle->initData.portLocationCs); -#endif -#if defined(USARTRF0) - } else if (handle->peripheral.usartPort == USARTRF0) { - pins->mosiPort = AF_USARTRF0_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USARTRF0_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USARTRF0_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USARTRF0_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USARTRF0_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USARTRF0_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USARTRF0_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USARTRF0_CS_PIN(handle->initData.portLocationCs); -#endif -#if defined(USARTRF1) - } else if (handle->peripheral.usartPort == USARTRF1) { - pins->mosiPort = AF_USARTRF1_TX_PORT(handle->initData.portLocationTx); - pins->misoPort = AF_USARTRF1_RX_PORT(handle->initData.portLocationRx); - pins->clkPort = AF_USARTRF1_CLK_PORT(handle->initData.portLocationClk); - pins->csPort = AF_USARTRF1_CS_PORT(handle->initData.portLocationCs); - pins->mosiPin = AF_USARTRF1_TX_PIN(handle->initData.portLocationTx); - pins->misoPin = AF_USARTRF1_RX_PIN(handle->initData.portLocationRx); - pins->clkPin = AF_USARTRF1_CLK_PIN(handle->initData.portLocationClk); - pins->csPin = AF_USARTRF1_CS_PIN(handle->initData.portLocationCs); -#endif - } else { - return ECODE_EMDRV_SPIDRV_PARAM_ERROR; - } - return ECODE_EMDRV_SPIDRV_OK; -} - -#endif - -#if defined(_SILICON_LABS_32B_SERIES_2) - -/***************************************************************************//** - * @brief Get SPI pins for Series 2 devices. - ******************************************************************************/ -static Ecode_t GetSpiPins(SPIDRV_Handle_t handle, SPI_Pins_t *pins) -{ - pins->mosiPort = handle->initData.portTx; - pins->misoPort = handle->initData.portRx; - pins->clkPort = handle->initData.portClk; - pins->csPort = handle->initData.portCs; - pins->mosiPin = handle->initData.pinTx; - pins->misoPin = handle->initData.pinRx; - pins->clkPin = handle->initData.pinClk; - pins->csPin = handle->initData.pinCs; - - return ECODE_EMDRV_SPIDRV_OK; -} - -#endif diff --git a/driver/public/mikroe/nfc2_pn7150/config/brd2703a/mikroe_pn7150_config.h b/driver/public/mikroe/nfc2_pn7150/config/brd2703a/mikroe_pn7150_config.h index b89f9677..30cdc4fa 100644 --- a/driver/public/mikroe/nfc2_pn7150/config/brd2703a/mikroe_pn7150_config.h +++ b/driver/public/mikroe/nfc2_pn7150/config/brd2703a/mikroe_pn7150_config.h @@ -45,6 +45,24 @@ // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE PN7150 I2C Configuration + +// MIKROE PN7150 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PN7150_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PN7150_I2C_SPEED_MODE 0 + +// +// + // PN7150 I2C ADDRESS // <0x28=> I2C_ADDR_0 // <0x29=> I2C_ADDR_1 @@ -72,4 +90,4 @@ // <<< sl:end pin_tool >>> -#endif /* MIKROE_PN7150_CONFIG_H_ */ +#endif // MIKROE_PN7150_CONFIG_H_ diff --git a/driver/public/mikroe/nfc2_pn7150/config/brd4108a/mikroe_pn7150_config.h b/driver/public/mikroe/nfc2_pn7150/config/brd4108a/mikroe_pn7150_config.h index e749f071..6c09534c 100644 --- a/driver/public/mikroe/nfc2_pn7150/config/brd4108a/mikroe_pn7150_config.h +++ b/driver/public/mikroe/nfc2_pn7150/config/brd4108a/mikroe_pn7150_config.h @@ -45,6 +45,24 @@ // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE PN7150 I2C Configuration + +// MIKROE PN7150 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PN7150_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PN7150_I2C_SPEED_MODE 0 + +// +// + // PN7150 I2C ADDRESS // <0x28=> I2C_ADDR_0 // <0x29=> I2C_ADDR_1 @@ -72,4 +90,4 @@ // <<< sl:end pin_tool >>> -#endif /* MIKROE_PN7150_CONFIG_H_ */ +#endif // MIKROE_PN7150_CONFIG_H_ diff --git a/driver/public/mikroe/nfc2_pn7150/config/brd4314a/mikroe_pn7150_config.h b/driver/public/mikroe/nfc2_pn7150/config/brd4314a/mikroe_pn7150_config.h index 2fed58b4..1219e570 100644 --- a/driver/public/mikroe/nfc2_pn7150/config/brd4314a/mikroe_pn7150_config.h +++ b/driver/public/mikroe/nfc2_pn7150/config/brd4314a/mikroe_pn7150_config.h @@ -45,6 +45,24 @@ // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE PN7150 I2C Configuration + +// MIKROE PN7150 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PN7150_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PN7150_I2C_SPEED_MODE 0 + +// +// + // PN7150 I2C ADDRESS // <0x28=> I2C_ADDR_0 // <0x29=> I2C_ADDR_1 @@ -72,4 +90,4 @@ // <<< sl:end pin_tool >>> -#endif /* MIKROE_PN7150_CONFIG_H_ */ +#endif // MIKROE_PN7150_CONFIG_H_ diff --git a/driver/public/mikroe/nfc2_pn7150/config/brd4338a/mikroe_pn7150_config.h b/driver/public/mikroe/nfc2_pn7150/config/brd4338a/mikroe_pn7150_config.h new file mode 100644 index 00000000..3bc15fec --- /dev/null +++ b/driver/public/mikroe/nfc2_pn7150/config/brd4338a/mikroe_pn7150_config.h @@ -0,0 +1,91 @@ +/***************************************************************************//** + * @file mikroe_pn7150_config.h + * @brief SCL MIKROE PN7150 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_PN7150_CONFIG_H_ +#define MIKROE_PN7150_CONFIG_H_ + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PN7150 I2C Configuration + +// MIKROE PN7150 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PN7150_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PN7150_I2C_SPEED_MODE 0 + +// +// + +// PN7150 I2C ADDRESS +// <0x28=> I2C_ADDR_0 +// <0x29=> I2C_ADDR_1 +// <0x2A=> I2C_ADDR_2 +// <0x2B=> I2C_ADDR_3 +// Default: 0x28 +#define MIKROE_PN7150_ADDR 0x28 + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_PN7150_INT +// $[GPIO_MIKROE_PN7150_INT] +#define MIKROE_PN7150_INT_PORT HP +#define MIKROE_PN7150_INT_PIN 46 +// [GPIO_MIKROE_PN7150_INT]$ + +// MIKROE_PN7150_RESET +// $[GPIO_MIKROE_PN7150_RESET] +#define MIKROE_PN7150_RESET_PORT HP +#define MIKROE_PN7150_RESET_PIN 47 +// [GPIO_MIKROE_PN7150_RESET]$ + +// <<< sl:end pin_tool >>> + +#endif // MIKROE_PN7150_CONFIG_H_ diff --git a/driver/public/mikroe/nfc2_pn7150/config/other/mikroe_pn7150_config.h b/driver/public/mikroe/nfc2_pn7150/config/other/mikroe_pn7150_config.h new file mode 100644 index 00000000..2687a53f --- /dev/null +++ b/driver/public/mikroe/nfc2_pn7150/config/other/mikroe_pn7150_config.h @@ -0,0 +1,97 @@ +/***************************************************************************//** + * @file mikroe_pn7150_config.h + * @brief SCL MIKROE PN7150 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_PN7150_CONFIG_H_ +#define MIKROE_PN7150_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PN7150 I2C Configuration + +// MIKROE PN7150 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PN7150_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PN7150_I2C_SPEED_MODE 0 + +// +// + +// PN7150 I2C ADDRESS +// <0x28=> I2C_ADDR_0 +// <0x29=> I2C_ADDR_1 +// <0x2A=> I2C_ADDR_2 +// <0x2B=> I2C_ADDR_3 +// Default: 0x28 +#define MIKROE_PN7150_ADDR 0x28 + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_PN7150_INT +// $[GPIO_MIKROE_PN7150_INT] +#warning "INT pin for PN7150 is not configured" +// #define MIKROE_PN7150_INT_PORT gpioPortB +// #define MIKROE_PN7150_INT_PIN 3 +// [GPIO_MIKROE_PN7150_INT]$ + +// MIKROE_PN7150_RESET +// $[GPIO_MIKROE_PN7150_RESET] +#warning "RST pin for PN7150 is not configured" +// #define MIKROE_PN7150_RESET_PORT gpioPortC +// #define MIKROE_PN7150_RESET_PIN 6 +// [GPIO_MIKROE_PN7150_RESET]$ + +// <<< sl:end pin_tool >>> + +#endif // MIKROE_PN7150_CONFIG_H_ diff --git a/driver/public/mikroe/nfc2_pn7150/inc/mikroe_pn7150.h b/driver/public/mikroe/nfc2_pn7150/inc/mikroe_pn7150.h index f93d48c0..aa6f2033 100644 --- a/driver/public/mikroe/nfc2_pn7150/inc/mikroe_pn7150.h +++ b/driver/public/mikroe/nfc2_pn7150/inc/mikroe_pn7150.h @@ -41,7 +41,7 @@ #define _MIKROE_PN7150_H_ #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -84,23 +84,23 @@ typedef struct * @brief * Initialization function. * - * @param[in] i2cspm_instance + * @param[in] i2c_instance * I2CSPM instance * * @return SL_STATUS_OK if there are no errors. ******************************************************************************/ -sl_status_t mikroe_pn7150_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_pn7150_init(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief * This function sets the IC2SPM instance used by platform functions. * - * @param[in] i2cspm_instance + * @param[in] i2c_instance * I2CSPM instance * * @return SL_STATUS_OK if there are no errors. ******************************************************************************/ -sl_status_t mikroe_pn7150_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_pn7150_set_i2csmp_instance(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief NFC 2 default configuration function. diff --git a/driver/public/mikroe/nfc2_pn7150/src/mikroe_pn7150.c b/driver/public/mikroe/nfc2_pn7150/src/mikroe_pn7150.c index c39bfdb0..ea18f06c 100644 --- a/driver/public/mikroe/nfc2_pn7150/src/mikroe_pn7150.c +++ b/driver/public/mikroe/nfc2_pn7150/src/mikroe_pn7150.c @@ -37,7 +37,6 @@ * ******************************************************************************/ -#include "third_party_hw_drivers_helpers.h" #include "mikroe_pn7150_config.h" #include "mikroe_pn7150.h" #include "nfc2.h" @@ -48,16 +47,14 @@ static nfc2_cfg_t nfc2_cfg; /***************************************************************************//** * Initialization function. ******************************************************************************/ -sl_status_t mikroe_pn7150_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_pn7150_init(mikroe_i2c_handle_t i2c_instance) { - if (NULL == i2cspm_instance) { + if (NULL == i2c_instance) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - // Configure default i2csmp instance - nfc2.i2c.handle = i2cspm_instance; + nfc2.i2c.handle = i2c_instance; // Configure default I2C address nfc2.slave_address = MIKROE_PN7150_ADDR; @@ -65,6 +62,10 @@ sl_status_t mikroe_pn7150_init(sl_i2cspm_t *i2cspm_instance) // Call basic setup functions nfc2_cfg_setup(&nfc2_cfg); +#if (MIKROE_PN7150_I2C_UC == 1) + nfc2_cfg.i2c_speed = MIKROE_PN7150_I2C_SPEED_MODE; +#endif + #if defined(MIKROE_PN7150_INT_PORT) && defined(MIKROE_PN7150_INT_PIN) nfc2_cfg.int_pin = hal_gpio_pin_name(MIKROE_PN7150_INT_PORT, MIKROE_PN7150_INT_PIN); @@ -75,21 +76,23 @@ sl_status_t mikroe_pn7150_init(sl_i2cspm_t *i2cspm_instance) MIKROE_PN7150_RESET_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(nfc2_init(&nfc2, &nfc2_cfg)); + if (nfc2_init(&nfc2, &nfc2_cfg) != I2C_MASTER_SUCCESS) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } /***************************************************************************//** * This function sets the IC2SPM instance used by platform functions. ******************************************************************************/ -sl_status_t mikroe_pn7150_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_pn7150_set_i2csmp_instance(mikroe_i2c_handle_t i2c_instance) { - if (NULL == i2cspm_instance) { + if (NULL == i2c_instance) { return SL_STATUS_INVALID_PARAMETER; } - nfc2.i2c.handle = i2cspm_instance; + nfc2.i2c.handle = i2c_instance; return SL_STATUS_OK; } diff --git a/driver/public/mikroe/obdii_stn1110/config/brd2703a/mikroe_stn1110_config.h b/driver/public/mikroe/obdii_stn1110/config/brd2703a/mikroe_stn1110_config.h index 7329e086..ee35b15f 100644 --- a/driver/public/mikroe/obdii_stn1110/config/brd2703a/mikroe_stn1110_config.h +++ b/driver/public/mikroe/obdii_stn1110/config/brd2703a/mikroe_stn1110_config.h @@ -6,6 +6,8 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< sl:start pin_tool >>> // STN1110_RESET diff --git a/driver/public/mikroe/obdii_stn1110/config/brd4108a/mikroe_stn1110_config.h b/driver/public/mikroe/obdii_stn1110/config/brd4108a/mikroe_stn1110_config.h index 32dc5230..daaaf8d3 100644 --- a/driver/public/mikroe/obdii_stn1110/config/brd4108a/mikroe_stn1110_config.h +++ b/driver/public/mikroe/obdii_stn1110/config/brd4108a/mikroe_stn1110_config.h @@ -6,6 +6,8 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< sl:start pin_tool >>> // STN1110_RESET diff --git a/driver/public/mikroe/obdii_stn1110/config/brd4314a/mikroe_stn1110_config.h b/driver/public/mikroe/obdii_stn1110/config/brd4314a/mikroe_stn1110_config.h index 32dc5230..daaaf8d3 100644 --- a/driver/public/mikroe/obdii_stn1110/config/brd4314a/mikroe_stn1110_config.h +++ b/driver/public/mikroe/obdii_stn1110/config/brd4314a/mikroe_stn1110_config.h @@ -6,6 +6,8 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< sl:start pin_tool >>> // STN1110_RESET diff --git a/driver/public/mikroe/obdii_stn1110/config/brd4338a/mikroe_stn1110_config.h b/driver/public/mikroe/obdii_stn1110/config/brd4338a/mikroe_stn1110_config.h new file mode 100644 index 00000000..f2773be2 --- /dev/null +++ b/driver/public/mikroe/obdii_stn1110/config/brd4338a/mikroe_stn1110_config.h @@ -0,0 +1,29 @@ +#ifndef SCL_STN1110_CONFIG_H_ +#define SCL_STN1110_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< sl:start pin_tool >>> + +// STN1110_RESET +// $[GPIO_STN1110_RESET] +#define STN1110_RESET_PORT HP +#define STN1110_RESET_PIN 46 +// [GPIO_STN1110_RESET]$ + +// STN1110_INT +// $[GPIO_STN1110_INT] +#define STN1110_INT_PORT HP +#define STN1110_INT_PIN 47 +// [GPIO_STN1110_INT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* SCL_STN1110_CONFIG_H_ */ diff --git a/driver/public/mikroe/obdii_stn1110/config/other/mikroe_stn1110_config.h b/driver/public/mikroe/obdii_stn1110/config/other/mikroe_stn1110_config.h index 4b8d6dab..db3e1c20 100644 --- a/driver/public/mikroe/obdii_stn1110/config/other/mikroe_stn1110_config.h +++ b/driver/public/mikroe/obdii_stn1110/config/other/mikroe_stn1110_config.h @@ -1,6 +1,10 @@ #ifndef SCL_STN1110_CONFIG_H_ #define SCL_STN1110_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { @@ -11,15 +15,15 @@ extern "C" // STN1110_RESET // $[GPIO_STN1110_RESET] #warning "RESET pin for STN1110 is not configured" -// #define STN1110_RESET_PORT gpioPortC -// #define STN1110_RESET_PIN 6 +// #define STN1110_RESET_PORT 0 +// #define STN1110_RESET_PIN 0 // [GPIO_STN1110_RESET]$ // STN1110_INT // $[GPIO_STN1110_INT] #warning "INT pin for STN1110 is not configured" -// #define STN1110_INT_PORT gpioPortB -// #define STN1110_INT_PIN 3 +// #define STN1110_INT_PORT 0 +// #define STN1110_INT_PIN 0 // [GPIO_STN1110_INT]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/obdii_stn1110/inc/mikroe_stn1110.h b/driver/public/mikroe/obdii_stn1110/inc/mikroe_stn1110.h index 64c26b4f..9e3fdc6e 100644 --- a/driver/public/mikroe/obdii_stn1110/inc/mikroe_stn1110.h +++ b/driver/public/mikroe/obdii_stn1110/inc/mikroe_stn1110.h @@ -121,7 +121,7 @@ extern "C" { * SL_STATUS_OK if successful initialization. * Other status if initialization failed. ******************************************************************************/ -sl_status_t mikroe_stn1110_init(sl_iostream_uart_t *handle); +sl_status_t mikroe_stn1110_init(mikroe_uart_handle_t handle); /***************************************************************************//** * @brief @@ -134,7 +134,7 @@ sl_status_t mikroe_stn1110_init(sl_iostream_uart_t *handle); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_stn1110_set_uart_instance(sl_iostream_uart_t *handle); +sl_status_t mikroe_stn1110_set_uart_instance(mikroe_uart_handle_t handle); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/obdii_stn1110/src/mikroe_stn1110.c b/driver/public/mikroe/obdii_stn1110/src/mikroe_stn1110.c index 5696d914..7480c45f 100644 --- a/driver/public/mikroe/obdii_stn1110/src/mikroe_stn1110.c +++ b/driver/public/mikroe/obdii_stn1110/src/mikroe_stn1110.c @@ -39,17 +39,15 @@ #include "mikroe_stn1110.h" #include "mikroe_stn1110_config.h" -#include "third_party_hw_drivers_helpers.h" static obdii_t obdii; static obdii_cfg_t obdii_cfg; -sl_status_t mikroe_stn1110_init(sl_iostream_uart_t *handle) +sl_status_t mikroe_stn1110_init(mikroe_uart_handle_t handle) { if (NULL == handle) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); obdii.uart.handle = handle; obdii_cfg_setup(&obdii_cfg); @@ -64,12 +62,14 @@ sl_status_t mikroe_stn1110_init(sl_iostream_uart_t *handle) STN1110_INT_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(obdii_init(&obdii, &obdii_cfg)); + if (obdii_init(&obdii, &obdii_cfg) != UART_SUCCESS) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } -sl_status_t mikroe_stn1110_set_uart_instance(sl_iostream_uart_t *handle) +sl_status_t mikroe_stn1110_set_uart_instance(mikroe_uart_handle_t handle) { if (NULL == handle) { return SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/oledc_ssd1351/config/brd2703a/mikroe_ssd1351_config.h b/driver/public/mikroe/oledc_ssd1351/config/brd2703a/mikroe_ssd1351_config.h index 3f1077e6..db796634 100644 --- a/driver/public/mikroe/oledc_ssd1351/config/brd2703a/mikroe_ssd1351_config.h +++ b/driver/public/mikroe/oledc_ssd1351/config/brd2703a/mikroe_ssd1351_config.h @@ -39,11 +39,38 @@ #ifndef MIKROE_SSD1351_CONFIG_H_ #define MIKROE_SSD1351_CONFIG_H_ +#include "em_gpio.h" + #define SSD1351_DISPLAY_WIDTH 96 #define SSD1351_DISPLAY_HEIGHT 96 #define SSD1351_DISPLAY_COLOR 16 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SSD1351 SPI Configuration + +// MIKROE SSD1351 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1351_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_SSD1351_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// SSD1351_CS +// $[GPIO_SSD1351_CS] +// #define SSD1351_CS_PORT 0 +// #define SSD1351_CS_PIN 0 +// [GPIO_SSD1351_CS]$ + // SSD1351_DC // $[GPIO_SSD1351_DC] #define SSD1351_DC_PORT gpioPortA @@ -67,6 +94,7 @@ #define SSD1351_RW_PORT gpioPortB #define SSD1351_RW_PIN 0 // [GPIO_SSD1351_RW]$ + // <<< sl:end pin_tool >>> -#endif /* MIKROE_SSD1351_CONFIG_H_ */ +#endif // MIKROE_SSD1351_CONFIG_H_ diff --git a/driver/public/mikroe/oledc_ssd1351/config/brd4108a/mikroe_ssd1351_config.h b/driver/public/mikroe/oledc_ssd1351/config/brd4108a/mikroe_ssd1351_config.h index d6eafbbb..29fdd410 100644 --- a/driver/public/mikroe/oledc_ssd1351/config/brd4108a/mikroe_ssd1351_config.h +++ b/driver/public/mikroe/oledc_ssd1351/config/brd4108a/mikroe_ssd1351_config.h @@ -39,11 +39,38 @@ #ifndef MIKROE_SSD1351_CONFIG_H_ #define MIKROE_SSD1351_CONFIG_H_ +#include "em_gpio.h" + #define SSD1351_DISPLAY_WIDTH 96 #define SSD1351_DISPLAY_HEIGHT 96 #define SSD1351_DISPLAY_COLOR 16 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SSD1351 SPI Configuration + +// MIKROE SSD1351 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1351_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_SSD1351_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// SSD1351_CS +// $[GPIO_SSD1351_CS] +// #define SSD1351_CS_PORT 0 +// #define SSD1351_CS_PIN 0 +// [GPIO_SSD1351_CS]$ + // SSD1351_DC // $[GPIO_SSD1351_DC] #define SSD1351_DC_PORT gpioPortB @@ -67,6 +94,7 @@ #define SSD1351_RW_PORT gpioPortB #define SSD1351_RW_PIN 0 // [GPIO_SSD1351_RW]$ + // <<< sl:end pin_tool >>> -#endif /* MIKROE_SSD1351_CONFIG_H_ */ +#endif // MIKROE_SSD1351_CONFIG_H_ diff --git a/driver/public/mikroe/oledc_ssd1351/config/brd4314a/mikroe_ssd1351_config.h b/driver/public/mikroe/oledc_ssd1351/config/brd4314a/mikroe_ssd1351_config.h index d6eafbbb..29fdd410 100644 --- a/driver/public/mikroe/oledc_ssd1351/config/brd4314a/mikroe_ssd1351_config.h +++ b/driver/public/mikroe/oledc_ssd1351/config/brd4314a/mikroe_ssd1351_config.h @@ -39,11 +39,38 @@ #ifndef MIKROE_SSD1351_CONFIG_H_ #define MIKROE_SSD1351_CONFIG_H_ +#include "em_gpio.h" + #define SSD1351_DISPLAY_WIDTH 96 #define SSD1351_DISPLAY_HEIGHT 96 #define SSD1351_DISPLAY_COLOR 16 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SSD1351 SPI Configuration + +// MIKROE SSD1351 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1351_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_SSD1351_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// SSD1351_CS +// $[GPIO_SSD1351_CS] +// #define SSD1351_CS_PORT 0 +// #define SSD1351_CS_PIN 0 +// [GPIO_SSD1351_CS]$ + // SSD1351_DC // $[GPIO_SSD1351_DC] #define SSD1351_DC_PORT gpioPortB @@ -67,6 +94,7 @@ #define SSD1351_RW_PORT gpioPortB #define SSD1351_RW_PIN 0 // [GPIO_SSD1351_RW]$ + // <<< sl:end pin_tool >>> -#endif /* MIKROE_SSD1351_CONFIG_H_ */ +#endif // MIKROE_SSD1351_CONFIG_H_ diff --git a/driver/public/mikroe/oledc_ssd1351/config/brd4338a/mikroe_ssd1351_config.h b/driver/public/mikroe/oledc_ssd1351/config/brd4338a/mikroe_ssd1351_config.h new file mode 100644 index 00000000..02000419 --- /dev/null +++ b/driver/public/mikroe/oledc_ssd1351/config/brd4338a/mikroe_ssd1351_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file micro_oled_ssd1351_config.h + * @brief Micro OLED SSD1351 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_SSD1351_CONFIG_H_ +#define MIKROE_SSD1351_CONFIG_H_ + +#define SSD1351_DISPLAY_WIDTH 96 +#define SSD1351_DISPLAY_HEIGHT 96 +#define SSD1351_DISPLAY_COLOR 16 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SSD1351 SPI Configuration + +// MIKROE SSD1351 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1351_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_SSD1351_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// SSD1351_CS +// $[GPIO_SSD1351_CS] +// #define SSD1351_CS_PORT 0 +// #define SSD1351_CS_PIN 0 +// [GPIO_SSD1351_CS]$ + +// SSD1351_DC +// $[GPIO_SSD1351_DC] +#define SSD1351_DC_PORT HP +#define SSD1351_DC_PIN 46 +// [GPIO_SSD1351_DC]$ + +// SSD1351_RST +// $[GPIO_SSD1351_RST] +#define SSD1351_RST_PORT HP +#define SSD1351_RST_PIN 47 +// [GPIO_SSD1351_RST]$ + +// SSD1351_EN +// $[GPIO_SSD1351_EN] +#define SSD1351_EN_PORT HP +#define SSD1351_EN_PIN 48 +// [GPIO_SSD1351_EN]$ + +// SSD1351_RW +// $[GPIO_SSD1351_RW] +#define SSD1351_RW_PORT HP +#define SSD1351_RW_PIN 49 +// [GPIO_SSD1351_RW]$ + +// <<< sl:end pin_tool >>> + +// <<< Use Configuration Wizard in Context Menu >>> + +#endif // MIKROE_SSD1351_CONFIG_H_ diff --git a/driver/public/mikroe/oledc_ssd1351/config/other/mikroe_ssd1351_config.h b/driver/public/mikroe/oledc_ssd1351/config/other/mikroe_ssd1351_config.h index e183d1be..a5d091bb 100644 --- a/driver/public/mikroe/oledc_ssd1351/config/other/mikroe_ssd1351_config.h +++ b/driver/public/mikroe/oledc_ssd1351/config/other/mikroe_ssd1351_config.h @@ -39,11 +39,40 @@ #ifndef MIKROE_SSD1351_CONFIG_H_ #define MIKROE_SSD1351_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #define SSD1351_DISPLAY_WIDTH 96 #define SSD1351_DISPLAY_HEIGHT 96 #define SSD1351_DISPLAY_COLOR 16 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SSD1351 SPI Configuration + +// MIKROE SSD1351 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1351_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_SSD1351_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// SSD1351_CS +// $[GPIO_SSD1351_CS] +// #define SSD1351_CS_PORT 0 +// #define SSD1351_CS_PIN 0 +// [GPIO_SSD1351_CS]$ + // SSD1351_DC // $[GPIO_SSD1351_DC] #warning "SSD1351_DC is not configured" @@ -71,6 +100,7 @@ // #define SSD1351_RW_PORT gpioPortB // #define SSD1351_RW_PIN 0 // [GPIO_SSD1351_RW]$ + // <<< sl:end pin_tool >>> -#endif /* MIKROE_SSD1351_CONFIG_H_ */ +#endif // MIKROE_SSD1351_CONFIG_H_ diff --git a/driver/public/mikroe/oledc_ssd1351/inc/mikroe_ssd1351.h b/driver/public/mikroe/oledc_ssd1351/inc/mikroe_ssd1351.h index b1603aeb..df7e45ad 100644 --- a/driver/public/mikroe/oledc_ssd1351/inc/mikroe_ssd1351.h +++ b/driver/public/mikroe/oledc_ssd1351/inc/mikroe_ssd1351.h @@ -4,7 +4,7 @@ #include "oledc.h" #include "sl_status.h" -#include "spidrv.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -142,7 +142,7 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_ssd1351_init(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_ssd1351_init(mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief @@ -155,7 +155,7 @@ sl_status_t mikroe_ssd1351_init(SPIDRV_Handle_t spi_instance); * SL_STATUS_OK if there are no errors * SL_STATUS_INVALID_PARAMETER if spi_instance is null ******************************************************************************/ -sl_status_t mikroe_ssd1351_set_spi_instance(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_ssd1351_set_spi_instance(mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/oledc_ssd1351/inc/oled_display.h b/driver/public/mikroe/oledc_ssd1351/inc/oled_display.h index ea7a6543..b0da1c58 100644 --- a/driver/public/mikroe/oledc_ssd1351/inc/oled_display.h +++ b/driver/public/mikroe/oledc_ssd1351/inc/oled_display.h @@ -37,7 +37,6 @@ #include #include "sl_status.h" - #include "mikroe_ssd1351.h" #ifdef __cplusplus diff --git a/driver/public/mikroe/oledc_ssd1351/src/mikroe_ssd1351.c b/driver/public/mikroe/oledc_ssd1351/src/mikroe_ssd1351.c index 0cf8b7ad..ffa81eae 100644 --- a/driver/public/mikroe/oledc_ssd1351/src/mikroe_ssd1351.c +++ b/driver/public/mikroe/oledc_ssd1351/src/mikroe_ssd1351.c @@ -1,6 +1,43 @@ +/***************************************************************************//** + * @file mikroe_ssd1351.c + * @brief SSD1351 driver source file + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + #include "mikroe_ssd1351.h" #include "mikroe_ssd1351_config.h" -#include "third_party_hw_drivers_helpers.h" #include "stdio.h" static oledc_t oledc; @@ -14,19 +51,25 @@ static bool initialized = false; /***************************************************************************//** * Initialization function. ******************************************************************************/ -sl_status_t mikroe_ssd1351_init(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_ssd1351_init(mikroe_spi_handle_t spi_instance) { if (NULL == spi_instance) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - // Configure default spi instance oledc.spi.handle = spi_instance; // Call basic setup functions oledc_cfg_setup(&oledc_cfg); + +#if (MIKROE_SSD1351_SPI_UC == 1) + oledc_cfg.spi_speed = MIKROE_SSD1351_SPI_BITRATE; +#endif +#if defined(SSD1351_CS_PORT) && defined(SSD1351_CS_PIN) + oledc_cfg.cs = hal_gpio_pin_name(SSD1351_CS_PORT, SSD1351_CS_PIN); +#endif + oledc_cfg.dc = hal_gpio_pin_name(SSD1351_DC_PORT, SSD1351_DC_PIN); oledc_cfg.en = hal_gpio_pin_name(SSD1351_EN_PORT, SSD1351_EN_PIN); oledc_cfg.rw = hal_gpio_pin_name(SSD1351_RW_PORT, SSD1351_RW_PIN); @@ -35,16 +78,18 @@ sl_status_t mikroe_ssd1351_init(SPIDRV_Handle_t spi_instance) oledc_cfg.rst = hal_gpio_pin_name(SSD1351_RST_PORT, SSD1351_RST_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(oledc_init(&oledc, &oledc_cfg)); + if (oledc_init(&oledc, &oledc_cfg) != OLEDC_OK) { + return SL_STATUS_INITIALIZATION; + } initialized = true; - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } /***************************************************************************//** * This function sets the SPI instance used by platform functions. ******************************************************************************/ -sl_status_t mikroe_ssd1351_set_spi_instance(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_ssd1351_set_spi_instance(mikroe_spi_handle_t spi_instance) { if (!initialized) { return SL_STATUS_NOT_INITIALIZED; diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h index bbb3d670..bb73ff7e 100644 --- a/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h +++ b/driver/public/mikroe/oledw_ssd1306/config/brd2703a/mikroe_ssd1306_config.h @@ -52,17 +52,17 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//MIKROE SPI SSD1306 Configuration +// MIKROE SSD1306 SPI Configuration -// MIKROE SPI SSD1306 UC Configuration -// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). -// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. -// Default: 0 -#define MIKROE_SPI_SSD1306_UC 0 +// MIKROE SSD1306 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1306_SPI_UC 0 -// Bit Rate (Bits/Second) <1-116000000> +// Bit Rate (Bits/Second) <1-116000000> // Default: 10000000 -#define MIKROE_SPI_SSD1306_BITRATE 10000000 +#define MIKROE_SSD1306_SPI_BITRATE 10000000 // // diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h index 3e660eba..5247cfeb 100644 --- a/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h +++ b/driver/public/mikroe/oledw_ssd1306/config/brd4108a/mikroe_ssd1306_config.h @@ -52,17 +52,17 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//MIKROE SPI SSD1306 Configuration +// MIKROE SSD1306 SPI Configuration -// MIKROE SPI SSD1306 UC Configuration -// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). -// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. -// Default: 0 -#define MIKROE_SPI_SSD1306_UC 0 +// MIKROE SSD1306 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1306_SPI_UC 0 -// Bit Rate (Bits/Second) <1-116000000> +// Bit Rate (Bits/Second) <1-116000000> // Default: 10000000 -#define MIKROE_SPI_SSD1306_BITRATE 10000000 +#define MIKROE_SSD1306_SPI_BITRATE 10000000 // // diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h index 3e660eba..5247cfeb 100644 --- a/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h +++ b/driver/public/mikroe/oledw_ssd1306/config/brd4314a/mikroe_ssd1306_config.h @@ -52,17 +52,17 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//MIKROE SPI SSD1306 Configuration +// MIKROE SSD1306 SPI Configuration -// MIKROE SPI SSD1306 UC Configuration -// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). -// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. -// Default: 0 -#define MIKROE_SPI_SSD1306_UC 0 +// MIKROE SSD1306 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1306_SPI_UC 0 -// Bit Rate (Bits/Second) <1-116000000> +// Bit Rate (Bits/Second) <1-116000000> // Default: 10000000 -#define MIKROE_SPI_SSD1306_BITRATE 10000000 +#define MIKROE_SSD1306_SPI_BITRATE 10000000 // // diff --git a/driver/public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h index 288c0976..b81b227c 100644 --- a/driver/public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h +++ b/driver/public/mikroe/oledw_ssd1306/config/brd4338a/mikroe_ssd1306_config.h @@ -50,17 +50,17 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//MIKROE SPI SSD1306 Configuration +// MIKROE SSD1306 SPI Configuration -// MIKROE SPI SSD1306 UC Configuration -// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). -// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. -// Default: 0 -#define MIKROE_SPI_SSD1306_UC 0 +// MIKROE SSD1306 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1306_SPI_UC 0 -// Bit Rate (Bits/Second) <1-116000000> +// Bit Rate (Bits/Second) <1-116000000> // Default: 10000000 -#define MIKROE_SPI_SSD1306_BITRATE 10000000 +#define MIKROE_SSD1306_SPI_BITRATE 10000000 // // @@ -110,13 +110,13 @@ extern "C" { // SSD1306_DC // $[GPIO_SSD1306_DC] -#define SSD1306_DC_PORT 0 +#define SSD1306_DC_PORT HP #define SSD1306_DC_PIN 47 // [GPIO_SSD1306_DC]$ // SSD1306_RST // $[GPIO_SSD1306_RST] -#define SSD1306_RST_PORT 0 +#define SSD1306_RST_PORT HP #define SSD1306_RST_PIN 46 // [GPIO_SSD1306_RST]$ diff --git a/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h b/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h index 439333ec..0a5bbb97 100644 --- a/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h +++ b/driver/public/mikroe/oledw_ssd1306/config/other/mikroe_ssd1306_config.h @@ -54,17 +54,17 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//MIKROE SPI SSD1306 Configuration +// MIKROE SSD1306 SPI Configuration -// MIKROE SPI SSD1306 UC Configuration -// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). -// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. -// Default: 0 -#define MIKROE_SPI_SSD1306_UC 0 +// MIKROE SSD1306 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SSD1306_SPI_UC 0 -// Bit Rate (Bits/Second) <1-116000000> +// Bit Rate (Bits/Second) <1-116000000> // Default: 10000000 -#define MIKROE_SPI_SSD1306_BITRATE 10000000 +#define MIKROE_SSD1306_SPI_BITRATE 10000000 // // diff --git a/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c b/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c index 0c2a0815..dfd74cf6 100644 --- a/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c +++ b/driver/public/mikroe/oledw_ssd1306/src/mikroe_ssd1306.c @@ -74,8 +74,8 @@ sl_status_t mikroe_ssd1306_init(mikroe_spi_handle_t spi_instance) oledw_cfg.cs = hal_gpio_pin_name(SSD1306_CS_PORT, SSD1306_CS_PIN); #endif -#if (MIKROE_SPI_SSD1306_UC == 1) - oledw_cfg.spi_speed = MIKROE_SPI_SSD1306_BITRATE; +#if (MIKROE_SSD1306_SPI_UC == 1) + oledw_cfg.spi_speed = MIKROE_SSD1306_SPI_BITRATE; #endif if (oledw_init(&oledw, &oledw_cfg) != OLEDW_OK) { diff --git a/driver/public/mikroe/ozone2_mq131/config/brd2703a/mikroe_mq131_config.h b/driver/public/mikroe/ozone2_mq131/config/brd2703a/mikroe_mq131_config.h index 5c2153ad..1594bbf0 100644 --- a/driver/public/mikroe/ozone2_mq131/config/brd2703a/mikroe_mq131_config.h +++ b/driver/public/mikroe/ozone2_mq131/config/brd2703a/mikroe_mq131_config.h @@ -43,25 +43,49 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> // Ozone 2 Click ADC Select -// Select ADC module +// Select ADC module // // <0=> Internal ADC // <1=> External ADC -#define MIKROE_OZONE2_CLICK_ADC_SEL 1 +#define MIKROE_OZONE2_ADC_SEL 1 + +// + +// Ozone 2 Click SPI Configuration +// Ozone 2 Click SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_OZONE2_CLICK_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_OZONE2_CLICK_SPI_UC_BITRATE 10000000 + +// // + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// MIKROE_OZONE2_CLICK_AN -// $[GPIO_MIKROE_OZONE2_CLICK_AN] -#define MIKROE_OZONE2_CLICK_AN_PORT gpioPortB -#define MIKROE_OZONE2_CLICK_AN_PIN 0 -// [GPIO_MIKROE_OZONE2_CLICK_AN]$ +// MIKROE_OZONE2_AN +// $[GPIO_MIKROE_OZONE2_AN] +#define MIKROE_OZONE2_AN_PORT gpioPortB +#define MIKROE_OZONE2_AN_PIN 0 +// [GPIO_MIKROE_OZONE2_AN]$ + +// MIKROE_OZONE2_CS +// $[GPIO_MIKROE_OZONE2_CS] +#define MIKROE_OZONE2_CS_PORT gpioPortC +#define MIKROE_OZONE2_CS_PIN 0 +// [GPIO_MIKROE_OZONE2_CS]$ // <<< sl:end pin_tool >>> @@ -69,4 +93,4 @@ extern "C" { } #endif -#endif /* MIKROE_MQ131_CONFIG_H */ +#endif // MIKROE_MQ131_CONFIG_H diff --git a/driver/public/mikroe/ozone2_mq131/config/brd4108a/mikroe_mq131_config.h b/driver/public/mikroe/ozone2_mq131/config/brd4108a/mikroe_mq131_config.h index 5c2153ad..17f9586d 100644 --- a/driver/public/mikroe/ozone2_mq131/config/brd4108a/mikroe_mq131_config.h +++ b/driver/public/mikroe/ozone2_mq131/config/brd4108a/mikroe_mq131_config.h @@ -43,25 +43,49 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> // Ozone 2 Click ADC Select -// Select ADC module +// Select ADC module // // <0=> Internal ADC // <1=> External ADC -#define MIKROE_OZONE2_CLICK_ADC_SEL 1 +#define MIKROE_OZONE2_ADC_SEL 1 + +// + +// Ozone 2 Click SPI Configuration +// Ozone 2 Click SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_OZONE2_CLICK_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_OZONE2_CLICK_SPI_UC_BITRATE 10000000 + +// // + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// MIKROE_OZONE2_CLICK_AN -// $[GPIO_MIKROE_OZONE2_CLICK_AN] -#define MIKROE_OZONE2_CLICK_AN_PORT gpioPortB -#define MIKROE_OZONE2_CLICK_AN_PIN 0 -// [GPIO_MIKROE_OZONE2_CLICK_AN]$ +// MIKROE_OZONE2_AN +// $[GPIO_MIKROE_OZONE2_AN] +#define MIKROE_OZONE2_AN_PORT gpioPortB +#define MIKROE_OZONE2_AN_PIN 0 +// [GPIO_MIKROE_OZONE2_AN]$ + +// MIKROE_OZONE2_CS +// $[GPIO_MIKROE_OZONE2_CS] +#define MIKROE_OZONE2_CS_PORT gpioPortC +#define MIKROE_OZONE2_CS_PIN 3 +// [GPIO_MIKROE_OZONE2_CS]$ // <<< sl:end pin_tool >>> @@ -69,4 +93,4 @@ extern "C" { } #endif -#endif /* MIKROE_MQ131_CONFIG_H */ +#endif // MIKROE_MQ131_CONFIG_H diff --git a/driver/public/mikroe/ozone2_mq131/config/brd4314a/mikroe_mq131_config.h b/driver/public/mikroe/ozone2_mq131/config/brd4314a/mikroe_mq131_config.h index 5c2153ad..17f9586d 100644 --- a/driver/public/mikroe/ozone2_mq131/config/brd4314a/mikroe_mq131_config.h +++ b/driver/public/mikroe/ozone2_mq131/config/brd4314a/mikroe_mq131_config.h @@ -43,25 +43,49 @@ extern "C" { #endif +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> // Ozone 2 Click ADC Select -// Select ADC module +// Select ADC module // // <0=> Internal ADC // <1=> External ADC -#define MIKROE_OZONE2_CLICK_ADC_SEL 1 +#define MIKROE_OZONE2_ADC_SEL 1 + +// + +// Ozone 2 Click SPI Configuration +// Ozone 2 Click SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_OZONE2_CLICK_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_OZONE2_CLICK_SPI_UC_BITRATE 10000000 + +// // + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// MIKROE_OZONE2_CLICK_AN -// $[GPIO_MIKROE_OZONE2_CLICK_AN] -#define MIKROE_OZONE2_CLICK_AN_PORT gpioPortB -#define MIKROE_OZONE2_CLICK_AN_PIN 0 -// [GPIO_MIKROE_OZONE2_CLICK_AN]$ +// MIKROE_OZONE2_AN +// $[GPIO_MIKROE_OZONE2_AN] +#define MIKROE_OZONE2_AN_PORT gpioPortB +#define MIKROE_OZONE2_AN_PIN 0 +// [GPIO_MIKROE_OZONE2_AN]$ + +// MIKROE_OZONE2_CS +// $[GPIO_MIKROE_OZONE2_CS] +#define MIKROE_OZONE2_CS_PORT gpioPortC +#define MIKROE_OZONE2_CS_PIN 3 +// [GPIO_MIKROE_OZONE2_CS]$ // <<< sl:end pin_tool >>> @@ -69,4 +93,4 @@ extern "C" { } #endif -#endif /* MIKROE_MQ131_CONFIG_H */ +#endif // MIKROE_MQ131_CONFIG_H diff --git a/driver/public/mikroe/e_paper_154_inch/config/brd4314a/mikroe_e_paper_154_inch_config.h b/driver/public/mikroe/ozone2_mq131/config/brd4338a/mikroe_mq131_config.h similarity index 63% rename from driver/public/mikroe/e_paper_154_inch/config/brd4314a/mikroe_e_paper_154_inch_config.h rename to driver/public/mikroe/ozone2_mq131/config/brd4338a/mikroe_mq131_config.h index e6592833..4cf823a9 100644 --- a/driver/public/mikroe/e_paper_154_inch/config/brd4314a/mikroe_e_paper_154_inch_config.h +++ b/driver/public/mikroe/ozone2_mq131/config/brd4338a/mikroe_mq131_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_e_paper_config.h - * @brief Mikroe E-Paper Configuration + * @file mikroe_mq131_config.h + * @brief Mikroe MQ131 Configuration * @version 1.0.0 ******************************************************************************* * # License @@ -36,48 +36,48 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_E_PAPER_154_INCH_CONFIG_H_ -#define MIKROE_E_PAPER_154_INCH_CONFIG_H_ +#ifndef MIKROE_MQ131_CONFIG_H +#define MIKROE_MQ131_CONFIG_H #ifdef __cplusplus extern "C" { #endif -#define MIKROE_E_PAPER_WIDTH 200 -#define MIKROE_E_PAPER_HEIGHT 200 - -// A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// Ozone 2 Click ADC Select + +// Select ADC module +// +// <0=> Internal ADC +// <1=> External ADC +#define MIKROE_OZONE2_ADC_SEL 1 + +// + +// Ozone 2 Click SPI Configuration + +// Ozone 2 Click SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_OZONE2_CLICK_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_OZONE2_CLICK_SPI_UC_BITRATE 10000000 -// ESL MODE setting -// ESL_MODE> Enable Peripheral -// Macro for the ESL mode -#define ESL_MODE 0 // // -// The block ends with the following line or at the end of the file: // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// E_PAPER_DC -// $[GPIO_E_PAPER_DC] -#define E_PAPER_DC_PORT gpioPortB -#define E_PAPER_DC_PIN 4 -// [GPIO_E_PAPER_DC]$ - -// E_PAPER_RST -// $[GPIO_E_PAPER_RST] -#define E_PAPER_RST_PORT gpioPortC -#define E_PAPER_RST_PIN 6 -// [GPIO_E_PAPER_RST]$ - -// E_PAPER_BSY -// $[GPIO_E_PAPER_BSY] -#define E_PAPER_BSY_PORT gpioPortB -#define E_PAPER_BSY_PIN 3 -// [GPIO_E_PAPER_BSY]$ +// MIKROE_OZONE2_CS +// $[GPIO_MIKROE_OZONE2_CS] +#define MIKROE_OZONE2_CS_PORT HP +#define MIKROE_OZONE2_CS_PIN 46 +// [GPIO_MIKROE_OZONE2_CS]$ // <<< sl:end pin_tool >>> @@ -85,4 +85,4 @@ extern "C" { } #endif -#endif /* MIKROE_E_PAPER_154_INCH_CONFIG_H_ */ +#endif // MIKROE_MQ131_CONFIG_H diff --git a/driver/public/mikroe/ozone2_mq131/config/other/mikroe_mq131_config.h b/driver/public/mikroe/ozone2_mq131/config/other/mikroe_mq131_config.h index b829f3ea..bd706260 100644 --- a/driver/public/mikroe/ozone2_mq131/config/other/mikroe_mq131_config.h +++ b/driver/public/mikroe/ozone2_mq131/config/other/mikroe_mq131_config.h @@ -43,26 +43,53 @@ extern "C" { #endif +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + // <<< Use Configuration Wizard in Context Menu >>> // Ozone 2 Click ADC Select -// Select ADC module +// Select ADC module // // <0=> Internal ADC // <1=> External ADC -#define MIKROE_OZONE2_CLICK_ADC_SEL 1 +#define MIKROE_OZONE2_ADC_SEL 1 // + +// Ozone 2 Click SPI Configuration + +// Ozone 2 Click SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_OZONE2_CLICK_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_OZONE2_CLICK_SPI_UC_BITRATE 10000000 + +// +// + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// MIKROE_OZONE2_CLICK_AN -// $[GPIO_MIKROE_OZONE2_CLICK_AN] -#warning "MIKROE_OZONE2_CLICK_AN is not configured" -// #define MIKROE_OZONE2_CLICK_AN_PORT gpioPortB -// #define MIKROE_OZONE2_CLICK_AN_PIN 0 -// [GPIO_MIKROE_OZONE2_CLICK_AN]$ +// MIKROE_OZONE2_AN +// $[GPIO_MIKROE_OZONE2_AN] +#warning "MIKROE_OZONE2_AN is not configured" +// #define MIKROE_OZONE2_AN_PORT gpioPortB +// #define MIKROE_OZONE2_AN_PIN 0 +// [GPIO_MIKROE_OZONE2_AN]$ + +// MIKROE_OZONE2_CS +// $[GPIO_MIKROE_OZONE2_CS] +#warning "MIKROE_OZONE2_CS is not configured" +// #define MIKROE_OZONE2_CS_PORT gpioPortC +// #define MIKROE_OZONE2_CS_PIN 0 +// [GPIO_MIKROE_OZONE2_CS]$ // <<< sl:end pin_tool >>> @@ -70,4 +97,4 @@ extern "C" { } #endif -#endif /* MIKROE_MQ131_CONFIG_H */ +#endif // MIKROE_MQ131_CONFIG_H diff --git a/driver/public/mikroe/ozone2_mq131/inc/mikroe_mq131.h b/driver/public/mikroe/ozone2_mq131/inc/mikroe_mq131.h index d9cf8568..0cb9b832 100644 --- a/driver/public/mikroe/ozone2_mq131/inc/mikroe_mq131.h +++ b/driver/public/mikroe/ozone2_mq131/inc/mikroe_mq131.h @@ -36,7 +36,8 @@ #define MIKROE_MQ131_H #include "sl_status.h" -#include "spidrv.h" +#include "ozone2.h" +#include "mikroe_mq131_config.h" #ifdef __cplusplus extern "C" { @@ -47,7 +48,8 @@ extern "C" { * * @return SL_STATUS_OK if successful. Error code otherwise. ******************************************************************************/ -sl_status_t mikroe_ozone2_init (SPIDRV_Handle_t spidrv); +sl_status_t mikroe_ozone2_init(mikroe_spi_handle_t spi, + mikroe_adc_handle_t adc); /***************************************************************************//** * @brief Read ADC voltage. diff --git a/driver/public/mikroe/ozone2_mq131/src/mikroe_mq131.c b/driver/public/mikroe/ozone2_mq131/src/mikroe_mq131.c index 46eda19f..17d92897 100644 --- a/driver/public/mikroe/ozone2_mq131/src/mikroe_mq131.c +++ b/driver/public/mikroe/ozone2_mq131/src/mikroe_mq131.c @@ -33,47 +33,74 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ -#include "sl_status.h" -#include "spidrv.h" -#include "ozone2.h" - #include "mikroe_mq131.h" -#include "mikroe_mq131_config.h" +#include "drv_digital_in.h" +#include "drv_digital_out.h" + +#ifdef SLI_SI917 +#include "RTE_Device_917.h" +#else +#include "spidrv.h" +#endif static ozone2_t ctx; static ozone2_cfg_t cfg; -sl_status_t mikroe_ozone2_init(SPIDRV_Handle_t spidrv) +sl_status_t mikroe_ozone2_init(mikroe_spi_handle_t spi, + mikroe_adc_handle_t adc) { - if (spidrv == NULL) { + ozone2_cfg_setup(&cfg); + +#if MIKROE_OZONE2_ADC_SEL == 0 + + if (adc == NULL) { return SL_STATUS_NULL_POINTER; } + (void)spi; + +#if defined(MIKROE_OZONE2_AN_PORT) && defined(MIKROE_OZONE2_AN_PIN) + cfg.an = hal_gpio_pin_name(MIKROE_OZONE2_AN_PORT, MIKROE_OZONE2_AN_PIN); +#endif - ozone2_cfg_setup(&cfg); -#if MIKROE_OZONE2_CLICK_ADC_SEL == 0 cfg.adc_sel = OZONE2_ADC_SEL_AN; cfg.vref = 3.3; -#if defined(MIKROE_OZONE2_CLICK_AN_PORT) \ - && defined(MIKROE_OZONE2_CLICK_AN_PIN) - cfg.an = hal_gpio_pin_name(MIKROE_OZONE2_CLICK_AN_PORT, - MIKROE_OZONE2_CLICK_AN_PIN); -#endif + ctx.an.handle = adc; + #else + if (spi == NULL) { + return SL_STATUS_NULL_POINTER; + } + (void)adc; + cfg.adc_sel = OZONE2_ADC_SEL_SPI; - cfg.miso = hal_gpio_pin_name(spidrv->initData.portRx, - spidrv->initData.pinRx); - cfg.cs = hal_gpio_pin_name(spidrv->portCs, - spidrv->pinCs); - ctx.spi.handle = spidrv; + +#ifdef SLI_SI917 + cfg.miso = hal_gpio_pin_name(RTE_GSPI_MASTER_MISO_PORT, + RTE_GSPI_MASTER_MISO_PIN); +#else + const SPIDRV_Handle_t ptr = (SPIDRV_Handle_t)spi; + cfg.miso = hal_gpio_pin_name(ptr->initData.portRx, ptr->initData.pinRx); +#endif + +#if defined(MIKROE_OZONE2_CS_PORT) && defined(MIKROE_OZONE2_CS_PIN) + cfg.cs = hal_gpio_pin_name(MIKROE_OZONE2_CS_PORT, MIKROE_OZONE2_CS_PIN); + // CS pin need to init here since the mikroe_sdk_v2 missed this step + digital_out_t struct_cs; + digital_out_init(&struct_cs, cfg.cs); #endif + +#if (MIKROE_OZONE2_CLICK_SPI_UC == 1) + cfg.spi_speed = MIKROE_OZONE2_CLICK_SPI_UC_BITRATE; +#endif + + ctx.spi.handle = spi; +#endif + if (OZONE2_OK == ozone2_init(&ctx, &cfg)) { return SL_STATUS_OK; } - GPIO_PinModeSet(spidrv->initData.portRx, - spidrv->initData.pinRx, - gpioModeInputPull, - 0); - return SL_STATUS_FAIL; + + return SL_STATUS_INITIALIZATION; } sl_status_t mikroe_ozone2_read_signal_voltage(float *data_out) diff --git a/driver/public/mikroe/pcr_xm125/config/brd2703a/mikroe_xm125_config.h b/driver/public/mikroe/pcr_xm125/config/brd2703a/mikroe_xm125_config.h new file mode 100644 index 00000000..e0de572c --- /dev/null +++ b/driver/public/mikroe/pcr_xm125/config/brd2703a/mikroe_xm125_config.h @@ -0,0 +1,95 @@ +/***************************************************************************//** + * @file mikroe_xm125_config.h + * @brief mikroe pcr click configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_XM125_CONFIG_H_ +#define MIKROE_XM125_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE XM125 I2C Configuration + +// MIKROE XM125 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_XM125_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_XM125_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// CONFIG_XM125_RST +// $[GPIO_CONFIG_XM125_RST] +#define CONFIG_XM125_RST_PORT gpioPortC +#define CONFIG_XM125_RST_PIN 8 +// [GPIO_CONFIG_XM125_RST]$ + +// CONFIG_XM125_WUP +// $[GPIO_CONFIG_XM125_WUP] +#define CONFIG_XM125_WUP_PORT gpioPortA +#define CONFIG_XM125_WUP_PIN 0 +// [GPIO_CONFIG_XM125_WUP]$ + +// CONFIG_XM125_INT +// $[GPIO_CONFIG_XM125_INT] +#define CONFIG_XM125_INT_PORT gpioPortB +#define CONFIG_XM125_INT_PIN 1 +// [GPIO_CONFIG_XM125_INT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_XM125_CONFIG_H_ diff --git a/driver/public/mikroe/pcr_xm125/config/brd4108a/mikroe_xm125_config.h b/driver/public/mikroe/pcr_xm125/config/brd4108a/mikroe_xm125_config.h new file mode 100644 index 00000000..2d3d65b7 --- /dev/null +++ b/driver/public/mikroe/pcr_xm125/config/brd4108a/mikroe_xm125_config.h @@ -0,0 +1,95 @@ +/***************************************************************************//** + * @file mikroe_xm125_config.h + * @brief mikroe pcr click configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_XM125_CONFIG_H_ +#define MIKROE_XM125_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE XM125 I2C Configuration + +// MIKROE XM125 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_XM125_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_XM125_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// CONFIG_XM125_RST +// $[GPIO_CONFIG_XM125_RST] +#define CONFIG_XM125_RST_PORT gpioPortC +#define CONFIG_XM125_RST_PIN 6 +// [GPIO_CONFIG_XM125_RST]$ + +// CONFIG_XM125_WUP +// $[GPIO_CONFIG_XM125_WUP] +#define CONFIG_XM125_WUP_PORT gpioPortB +#define CONFIG_XM125_WUP_PIN 4 +// [GPIO_CONFIG_XM125_WUP]$ + +// CONFIG_XM125_INT +// $[GPIO_CONFIG_XM125_INT] +#define CONFIG_XM125_INT_PORT gpioPortB +#define CONFIG_XM125_INT_PIN 3 +// [GPIO_CONFIG_XM125_INT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_XM125_CONFIG_H_ diff --git a/driver/public/mikroe/pcr_xm125/config/brd4314a/mikroe_xm125_config.h b/driver/public/mikroe/pcr_xm125/config/brd4314a/mikroe_xm125_config.h new file mode 100644 index 00000000..658ab8e2 --- /dev/null +++ b/driver/public/mikroe/pcr_xm125/config/brd4314a/mikroe_xm125_config.h @@ -0,0 +1,94 @@ +/***************************************************************************//** + * @file mikroe_xm125_config.h + * @brief mikroe pcr click configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_XM125_CONFIG_H_ +#define MIKROE_XM125_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE XM125 I2C Configuration + +// MIKROE XM125 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_XM125_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_XM125_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// CONFIG_XM125_RST +// $[GPIO_CONFIG_XM125_RST] +#define CONFIG_XM125_RST_PORT gpioPortC +#define CONFIG_XM125_RST_PIN 6 +// [GPIO_CONFIG_XM125_RST]$ + +// CONFIG_XM125_WUP +// $[GPIO_CONFIG_XM125_WUP] +#define CONFIG_XM125_WUP_PORT gpioPortB +#define CONFIG_XM125_WUP_PIN 4 +// [GPIO_CONFIG_XM125_WUP]$ + +// CONFIG_XM125_INT +// $[GPIO_CONFIG_XM125_INT] +#define CONFIG_XM125_INT_PORT gpioPortB +#define CONFIG_XM125_INT_PIN 3 +// [GPIO_CONFIG_XM125_INT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_XM125_CONFIG_H_ diff --git a/driver/public/mikroe/pcr_xm125/config/brd4338a/mikroe_xm125_config.h b/driver/public/mikroe/pcr_xm125/config/brd4338a/mikroe_xm125_config.h new file mode 100644 index 00000000..647b5372 --- /dev/null +++ b/driver/public/mikroe/pcr_xm125/config/brd4338a/mikroe_xm125_config.h @@ -0,0 +1,93 @@ +/***************************************************************************//** + * @file mikroe_xm125_config.h + * @brief mikroe pcr click configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_XM125_CONFIG_H_ +#define MIKROE_XM125_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE XM125 I2C Configuration + +// MIKROE XM125 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_XM125_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_XM125_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// CONFIG_XM125_RST +// $[GPIO_CONFIG_XM125_RST] +#define CONFIG_XM125_RST_PORT HP +#define CONFIG_XM125_RST_PIN 46 +// [GPIO_CONFIG_XM125_RST]$ + +// CONFIG_XM125_WUP +// $[GPIO_CONFIG_XM125_WUP] +#define CONFIG_XM125_WUP_PORT HP +#define CONFIG_XM125_WUP_PIN 47 +// [GPIO_CONFIG_XM125_WUP]$ + +// CONFIG_XM125_INT +// $[GPIO_CONFIG_XM125_INT] +#define CONFIG_XM125_INT_PORT HP +#define CONFIG_XM125_INT_PIN 48 +// [GPIO_CONFIG_XM125_INT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_XM125_CONFIG_H_ diff --git a/driver/public/mikroe/pcr_xm125/config/other/mikroe_xm125_config.h b/driver/public/mikroe/pcr_xm125/config/other/mikroe_xm125_config.h new file mode 100644 index 00000000..8d3de2a0 --- /dev/null +++ b/driver/public/mikroe/pcr_xm125/config/other/mikroe_xm125_config.h @@ -0,0 +1,100 @@ +/***************************************************************************//** + * @file mikroe_xm125_config.h + * @brief mikroe pcr click configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_XM125_CONFIG_H_ +#define MIKROE_XM125_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE XM125 I2C Configuration + +// MIKROE XM125 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_XM125_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_XM125_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// CONFIG_XM125_RST +// $[GPIO_CONFIG_XM125_RST] +#warning "CONFIG_XM125_RST is not configured" +// #define CONFIG_XM125_RST_PORT gpioPortC +// #define CONFIG_XM125_RST_PIN 6 +// [GPIO_CONFIG_XM125_RST]$ + +// CONFIG_XM125_WUP +// $[GPIO_CONFIG_XM125_WUP] +#warning "CONFIG_XM125_WUP is not configured" +// #define CONFIG_XM125_WUP_PORT gpioPortB +// #define CONFIG_XM125_WUP_PIN 4 +// [GPIO_CONFIG_XM125_WUP]$ + +// CONFIG_XM125_INT +// $[GPIO_CONFIG_XM125_INT] +#warning "CONFIG_XM125_INT is not configured" +// #define CONFIG_XM125_INT_PORT gpioPortB +// #define CONFIG_XM125_INT_PIN 3 +// [GPIO_CONFIG_XM125_INT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_XM125_CONFIG_H_ diff --git a/driver/public/mikroe/pcr_xm125/inc/mikroe_xm125.h b/driver/public/mikroe/pcr_xm125/inc/mikroe_xm125.h new file mode 100644 index 00000000..7b0e630f --- /dev/null +++ b/driver/public/mikroe/pcr_xm125/inc/mikroe_xm125.h @@ -0,0 +1,366 @@ +/***************************************************************************//** + * @file mikroe_xm125.h + * @brief mikroe_xm125.h Prototypes + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_PCR_XM125_H_ +#define MIKROE_PCR_XM125_H_ + +#include "sl_status.h" +#include "drv_i2c_master.h" +#include "pcr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * @addtogroup pcr PCR Click Driver + * @brief API for configuring and manipulating PCR Click driver. + * @{ + */ + +/** + * @defgroup pcr_reg PCR Registers List + * @brief List of registers of PCR Click driver. + */ + +/** + * @addtogroup pcr_reg + * @{ + */ + +/** + * @brief PCR description register. + * @details Specified register for description of PCR Click driver. + */ +#define MIKROE_XM125_REG_VERSION PCR_REG_VERSION +#define MIKROE_XM125_REG_PROTOCOL_STATUS PCR_REG_PROTOCOL_STATUS +#define MIKROE_XM125_REG_MEASURE_CNT PCR_REG_MEASURE_CNT +#define MIKROE_XM125_REG_DETECTOR_STATUS PCR_REG_DETECTOR_STATUS +#define MIKROE_XM125_REG_DISTANCE_RESULT PCR_REG_DISTANCE_RESULT +#define MIKROE_XM125_REG_PEAK0_DISTANCE PCR_REG_PEAK0_DISTANCE +#define MIKROE_XM125_REG_PEAK1_DISTANCE PCR_REG_PEAK1_DISTANCE +#define MIKROE_XM125_REG_PEAK2_DISTANCE PCR_REG_PEAK2_DISTANCE +#define MIKROE_XM125_REG_PEAK3_DISTANCE PCR_REG_PEAK3_DISTANCE +#define MIKROE_XM125_REG_PEAK4_DISTANCE PCR_REG_PEAK4_DISTANCE +#define MIKROE_XM125_REG_PEAK5_DISTANCE PCR_REG_PEAK5_DISTANCE +#define MIKROE_XM125_REG_PEAK6_DISTANCE PCR_REG_PEAK6_DISTANCE +#define MIKROE_XM125_REG_PEAK7_DISTANCE PCR_REG_PEAK7_DISTANCE +#define MIKROE_XM125_REG_PEAK8_DISTANCE PCR_REG_PEAK8_DISTANCE +#define MIKROE_XM125_REG_PEAK9_DISTANCE PCR_REG_PEAK9_DISTANCE +#define MIKROE_XM125_REG_PEAK0_STRENGTH PCR_REG_PEAK0_STRENGTH +#define MIKROE_XM125_REG_PEAK1_STRENGTH PCR_REG_PEAK1_STRENGTH +#define MIKROE_XM125_REG_PEAK2_STRENGTH PCR_REG_PEAK2_STRENGTH +#define MIKROE_XM125_REG_PEAK3_STRENGTH PCR_REG_PEAK3_STRENGTH +#define MIKROE_XM125_REG_PEAK4_STRENGTH PCR_REG_PEAK4_STRENGTH +#define MIKROE_XM125_REG_PEAK5_STRENGTH PCR_REG_PEAK5_STRENGTH +#define MIKROE_XM125_REG_PEAK6_STRENGTH PCR_REG_PEAK6_STRENGTH +#define MIKROE_XM125_REG_PEAK7_STRENGTH PCR_REG_PEAK7_STRENGTH +#define MIKROE_XM125_REG_PEAK8_STRENGTH PCR_REG_PEAK8_STRENGTH +#define MIKROE_XM125_REG_PEAK9_STRENGTH PCR_REG_PEAK9_STRENGTH +#define MIKROE_XM125_REG_START PCR_REG_START +#define MIKROE_XM125_REG_END PCR_REG_END +#define MIKROE_XM125_REG_MAX_STEP_LEN PCR_REG_MAX_STEP_LEN +#define MIKROE_XM125_REG_CLOSE_RANGE_LEAK PCR_REG_CLOSE_RANGE_LEAK +#define MIKROE_XM125_REG_SIGNAL_QUALITY PCR_REG_SIGNAL_QUALITY +#define MIKROE_XM125_REG_MAX_PROFILE PCR_REG_MAX_PROFILE +#define MIKROE_XM125_REG_TRESHOLD_SENSITIVITY PCR_REG_TRESHOLD_SENSITIVITY +#define MIKROE_XM125_REG_PEAK_SORTI PCR_REG_PEAK_SORTI +#define MIKROE_XM125_REG_MAX_FRAMES_RECORDED PCR_REG_MAX_FRAMES_RECORDED +#define MIKROE_XM125_REG_AMPLITUDE_TERSHOLD PCR_REG_AMPLITUDE_TERSHOLD +#define MIKROE_XM125_REG_TERSHOLD_SENSITIVITY PCR_REG_TERSHOLD_SENSITIVITY +#define MIKROE_XM125_REG_REFLECTOR_SHAPE PCR_REG_REFLECTOR_SHAPE +#define MIKROE_XM125_REG_STRENGHT_TRESHOLD PCR_REG_STRENGHT_TRESHOLD +#define MIKROE_XM125_REG_MEASURE_ON_WAKEUP PCR_REG_MEASURE_ON_WAKEUP +#define MIKROE_XM125_REG_COMMAND PCR_REG_COMMAND + +/*! @} */ // pcr_reg + +/** + * @defgroup pcr_set PCR Registers Settings + * @brief Settings for registers of PCR Click driver. + */ + +/** + * @addtogroup pcr_set + * @{ + */ + +/** + * @brief PCR description setting. + * @details Specified setting for description of PCR Click driver. + */ + +/** + * @brief PCR Detector Status register setting. + * @details Specified setting for Detector Status register of PCR Click driver. + */ +#define MIKROE_XM125_STATUS_RSS_REG_OK PCR_STATUS_RSS_REG_OK +#define MIKROE_XM125_STATUS_CFG_CREATE_OK PCR_STATUS_CFG_CREATE_OK +#define MIKROE_XM125_STATUS_SENSOR_CREATE_OK PCR_STATUS_SENSOR_CREATE_OK +#define MIKROE_XM125_STATUS_DETECTOR_CREATE_OK PCR_STATUS_DETECTOR_CREATE_OK +#define MIKROE_XM125_STATUS_DETECTOR_BUFFER_OK PCR_STATUS_DETECTOR_BUFFER_OK +#define MIKROE_XM125_STATUS_SENSOR_BUFFER_OK PCR_STATUS_SENSOR_BUFFER_OK +#define MIKROE_XM125_STATUS_CALIB_BUFFER_OK PCR_STATUS_CALIB_BUFFER_OK +#define MIKROE_XM125_STATUS_CFG_APPLY_OK PCR_STATUS_CFG_APPLY_OK +#define MIKROE_XM125_STATUS_SENSOR_CALIB_OK PCR_STATUS_SENSOR_CALIB_OK +#define MIKROE_XM125_STATUS_DETECTOR_CALIB_OK PCR_STATUS_DETECTOR_CALIB_OK +#define MIKROE_XM125_STATUS_RSS_REG_ERR PCR_STATUS_RSS_REG_ERR +#define MIKROE_XM125_STATUS_CFG_CREATE_ERR PCR_STATUS_CFG_CREATE_ERR +#define MIKROE_XM125_STATUS_SENSOR_CREATE_ERR PCR_STATUS_SENSOR_CREATE_ERR +#define MIKROE_XM125_STATUS_DETECTOR_CREATE_ERR PCR_STATUS_DETECTOR_CREATE_ERR +#define MIKROE_XM125_STATUS_DETECTOR_BUFFER_ERR PCR_STATUS_DETECTOR_BUFFER_ERR +#define MIKROE_XM125_STATUS_SENSOR_BUFFER_ERR PCR_STATUS_SENSOR_BUFFER_ERR +#define MIKROE_XM125_STATUS_CALIB_BUFFER_ERR PCR_STATUS_CALIB_BUFFER_ERR +#define MIKROE_XM125_STATUS_CFG_APPLY_ERR PCR_STATUS_CFG_APPLY_ERR +#define MIKROE_XM125_STATUS_SENSOR_CALIB_ERR PCR_STATUS_SENSOR_CALIB_ERR +#define MIKROE_XM125_STATUS_DETECTOR_CALIB_ERR PCR_STATUS_DETECTOR_CALIB_ERR +#define MIKROE_XM125_STATUS_DETECTOR_ERR PCR_STATUS_DETECTOR_ERR +#define MIKROE_XM125_STATUS_BUSY PCR_STATUS_BUSY + +/** + * @brief PCR commands setting. + * @details Specified commands of PCR Click driver. + */ +#define MIKROE_XM125_APPLY_CFG_AND_CALIB_CMD PCR_APPLY_CFG_AND_CALIB_CMD +#define MIKROE_XM125_MEASURE_DISTANCE_CMD PCR_MEASURE_DISTANCE_CMD +#define MIKROE_XM125_APPLY_CONFIGURATION_CMD PCR_APPLY_CONFIGURATION_CMD +#define MIKROE_XM125_CALIBRATE_CMD PCR_CALIBRATE_CMD +#define MIKROE_XM125_RECALIBRATE_CMD PCR_RECALIBRATE_CMD +#define MIKROE_XM125_ENABLE_UART_LOGS_CMD PCR_ENABLE_UART_LOGS_CMD +#define MIKROE_XM125_DISABLE_UART_LOGS_CMD PCR_DISABLE_UART_LOGS_CMD +#define MIKROE_XM125_LOG_CONFIGURATION_CMD PCR_LOG_CONFIGURATION_CMD +#define MIKROE_XM125_RESET_MODULE_CMD PCR_RESET_MODULE_CMD + +/** + * @brief PCR distance setting. + * @details Specified minimum and maximum distance setting of PCR Click driver. + */ +#define MIKROE_XM125_MIN_DISTANCE PCR_MIN_DISTANCE +#define MIKROE_XM125_MAX_DISTANCE PCR_MAX_DISTANCE + +/***************************************************************************//** + * @brief + * Initialization function. + * + * @param[in] instance + * I2C instance + * + * @return + * SL_STATUS_OK Successful initialization. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null + * SL_STATUS_FAIL Initialization failed. + ******************************************************************************/ +sl_status_t mikroe_xm125_init(mikroe_i2c_handle_t instance); + +/***************************************************************************//** + * @brief + * This function sets the IC2SPM instance used by platform functions. + * + * @param[in] instance + * I2C instance + * + * @return + * SL_STATUS_OK if there are no errors. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. + ******************************************************************************/ +sl_status_t mikroe_xm125_set_i2csmp_instance(mikroe_i2c_handle_t instance); + +/***************************************************************************//** + * @brief + * This function executes a default configuration of PCR click board. + * + * @return + * SL_STATUS_OK if there are no errors. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_default_cfg(void); + +/***************************************************************************//** + * @brief + * This function writes a desired number of data bytes starting from + * the selected register by using I2C serial interface. + * + * @param[in] reg : Start register address. + * @param[in] data_in : Data to be written. + * @param[in] len : Number of bytes to be written. + * + * @return + * SL_STATUS_INVALID_PARAMETER if data_in is null + * SL_STATUS_OK - Success + * SL_STATUS_FAIL - Error. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_generic_write(uint8_t reg, uint8_t *data_in, + uint8_t len); + +/***************************************************************************//** + * @brief + * This function reads a desired number of data bytes starting from + * the selected register by using I2C serial interface. + * + * @param[in] reg : Start register address. + * @param[out] data_out : Output read data + * @param[in] len : Number of bytes to be read. + * + * @return + * SL_STATUS_INVALID_PARAMETER if data_out is null + * SL_STATUS_OK - Success + * SL_STATUS_FAIL - Error. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_generic_read (uint8_t reg, uint8_t *data_out, + uint8_t len); + +/***************************************************************************//** + * @brief + * This function is used to set wake up pin state of PCR click board. + * + * @param[in] pin_state : State of the wake up pin. + * + * + ******************************************************************************/ +void mikroe_xm125_set_wup_pin (bool wup_pin_state); + +/***************************************************************************//** + * @brief + * This function is used to set reset pin state of PCR click board. + * + * @param[in] pin_state : State of the reset pin. + * + * + ******************************************************************************/ +void mikroe_xm125_set_rst_pin(bool rst_pin_state); + +/***************************************************************************//** + * @brief + * This function is used to read interrupt pin state of PCR click board. + * + * @return + * State of the interrupt pin. + * + ******************************************************************************/ +uint8_t mikroe_xm125_get_int_pin (void); + +/***************************************************************************//** + * @brief + * This function is used to perform hardware reset of PCR click board. + * + ******************************************************************************/ +void mikroe_xm125_hw_reset (void); + +/***************************************************************************//** + * @brief + * This function writes a desired data bytes into + * the selected register by using I2C serial interface. + * + * @param[in] reg : Start register address. + * @param[in] data_in : Data to be written. + * + * @return + * SL_STATUS_OK - Success + * SL_STATUS_FAIL - Error. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_write_reg(uint16_t reg, uint32_t data_in); + +/***************************************************************************//** + * @brief + * This function reads a desired data bytes from + * the selected register by using I2C serial interface. + * + * @param[in] reg : Start register address. + * @param[out] data_out : Output read data. + * + * @return + * SL_STATUS_OK - Success + * SL_STATUS_FAIL - Error. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_read_reg(uint16_t reg, uint32_t *data_out); + +/***************************************************************************//** + * @brief + * This function is used to read status register of the PCR click board. + * @param[out] status : Read status data. + * + * @return + * SL_STATUS_OK - Success + * SL_STATUS_FAIL - Error. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_get_status(uint32_t *status); + +/***************************************************************************//** + * @brief + * This function is used to check if the PCR click board is busy. + * @return + * SL_STATUS_OK - device not busy + * SL_STATUS_FAIL - Device busy. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_check_device_busy(void); + +/***************************************************************************//** + * @brief + * This function is used to read status register, if any error flags are + * up, function will return error. + * @return + * SL_STATUS_OK + * SL_STATUS_FAIL + * + ******************************************************************************/ +sl_status_t mikroe_xm125_check_status_ok(void); + +/***************************************************************************//** + * @brief + * This function is used to read distance from the PCR click board. + * + * @param[out] distance_data : Read distance data. + * + * @return + * SL_STATUS_OK - Success + * SL_STATUS_FAIL - Error. + * + ******************************************************************************/ +sl_status_t mikroe_xm125_get_distance(uint32_t *distance_data); + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_PCR_XM125_H_ diff --git a/driver/public/mikroe/pcr_xm125/src/mikroe_xm125.c b/driver/public/mikroe/pcr_xm125/src/mikroe_xm125.c new file mode 100644 index 00000000..64f81678 --- /dev/null +++ b/driver/public/mikroe/pcr_xm125/src/mikroe_xm125.c @@ -0,0 +1,191 @@ +/***************************************************************************//** + * @file mikroe_xm125.c + * @brief mikroe_xm125.c Source File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#include "pcr.h" +#include "mikroe_xm125.h" +#include "mikroe_xm125_config.h" + +static pcr_t pcr; +static pcr_cfg_t pcr_cfg; + +sl_status_t mikroe_xm125_init(mikroe_i2c_handle_t instance) +{ + if (NULL == instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + pcr.i2c.handle = instance; + + pcr_cfg_setup(&pcr_cfg); + pcr_cfg.rst = hal_gpio_pin_name(CONFIG_XM125_RST_PORT, + CONFIG_XM125_RST_PIN); + pcr_cfg.wup = hal_gpio_pin_name(CONFIG_XM125_WUP_PORT, + CONFIG_XM125_WUP_PIN); + pcr_cfg.int_pin = hal_gpio_pin_name(CONFIG_XM125_INT_PORT, + CONFIG_XM125_INT_PIN); + +#if (MIKROE_XM125_I2C_UC == 1) + pcr_cfg.i2c_speed = MIKROE_XM125_I2C_SPEED_MODE; +#endif + + if (PCR_OK != pcr_init(&pcr, &pcr_cfg)) { + return SL_STATUS_INITIALIZATION; + } + + return SL_STATUS_OK; +} + +sl_status_t mikroe_xm125_set_i2csmp_instance(mikroe_i2c_handle_t instance) +{ + if (NULL == instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + pcr.i2c.handle = instance; + + return SL_STATUS_OK; +} + +sl_status_t mikroe_xm125_default_cfg(void) +{ + return (pcr_default_cfg(&pcr) == PCR_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t mikroe_xm125_generic_write(uint8_t reg, uint8_t *data_in, + uint8_t len) +{ + if (NULL == data_in) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (PCR_OK != pcr_generic_write(&pcr, reg, data_in, len)) { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} + +sl_status_t mikroe_xm125_generic_read(uint8_t reg, uint8_t *data_out, + uint8_t len) +{ + if (NULL == data_out) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (PCR_OK != pcr_generic_read(&pcr, reg, data_out, len)) { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} + +void mikroe_xm125_set_wup_pin(bool wup_pin_state) +{ + pcr_set_wup_pin(&pcr, (uint8_t)wup_pin_state); +} + +void mikroe_xm125_set_rst_pin(bool rst_pin_state) +{ + pcr_set_rst_pin(&pcr, (uint8_t)rst_pin_state); +} + +uint8_t mikroe_xm125_get_int_pin(void) +{ + return pcr_get_int_pin(&pcr); +} + +void mikroe_xm125_hw_reset(void) +{ + pcr_hw_reset(&pcr); +} + +sl_status_t mikroe_xm125_write_reg(uint16_t reg, uint32_t data_in) +{ + return (pcr_write_reg(&pcr, reg, + data_in) == PCR_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t mikroe_xm125_read_reg(uint16_t reg, uint32_t *data_out) +{ + if (NULL == data_out) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (PCR_OK != pcr_read_reg(&pcr, reg, data_out)) { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} + +sl_status_t mikroe_xm125_get_status(uint32_t *status) +{ + if (NULL == status) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (PCR_OK != pcr_get_status(&pcr, status)) { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} + +sl_status_t mikroe_xm125_check_device_busy(void) +{ + return (pcr_check_if_busy(&pcr) == PCR_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t mikroe_xm125_check_status_ok(void) +{ + return (pcr_check_if_ok(&pcr) == PCR_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +sl_status_t mikroe_xm125_get_distance(uint32_t *distance_data) +{ + if (NULL == distance_data) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (PCR_OK != pcr_get_distance(&pcr, distance_data)) { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} diff --git a/driver/public/mikroe/ph2/config/brd2703a/mikroe_ph2_config.h b/driver/public/mikroe/ph2/config/brd2703a/mikroe_ph2_config.h new file mode 100644 index 00000000..ced44031 --- /dev/null +++ b/driver/public/mikroe/ph2/config/brd2703a/mikroe_ph2_config.h @@ -0,0 +1,106 @@ + +/***************************************************************************/ /** + * @file mikroe ph2 config.h + * @brief mikroe ph2 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_PH2_CONFIG_H +#define MIKROE_PH2_CONFIG_H +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PH2 I2C Configuration + +// MIKROE PH2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PH2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PH2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_PH2_ST1 +// $[GPIO_MIKROE_PH2_ST1] +#ifndef MIKROE_PH2_ST1_PORT +#define MIKROE_PH2_ST1_PORT gpioPortC +#endif +#ifndef MIKROE_PH2_ST1_PIN +#define MIKROE_PH2_ST1_PIN 8 +#endif +// [GPIO_MIKROE_PH2_ST1]$ + +// MIKROE_PH2_ST2 +// $[GPIO_MIKROE_PH2_ST2] +#ifndef MIKROE_PH2_ST2_PORT +#define MIKROE_PH2_ST2_PORT gpioPortB +#endif +#ifndef MIKROE_PH2_ST2_PIN +#define MIKROE_PH2_ST2_PIN 1 +#endif +// [GPIO_MIKROE_PH2_ST2]$ + +// MIKROE_DS18B20_DQ +// $[GPIO_MIKROE_DS18B20_DQ] +#ifndef MIKROE_DS18B20_DQ_PORT +#define MIKROE_DS18B20_DQ_PORT gpioPortA +#endif +#ifndef MIKROE_DS18B20_DQ_PIN +#define MIKROE_DS18B20_DQ_PIN 0 +#endif +// [GPIO_MIKROE_DS18B20_DQ]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_PH2_CONFIG_H \ No newline at end of file diff --git a/driver/public/mikroe/ph2/config/brd4108a/mikroe_ph2_config.h b/driver/public/mikroe/ph2/config/brd4108a/mikroe_ph2_config.h new file mode 100644 index 00000000..b14e6a6d --- /dev/null +++ b/driver/public/mikroe/ph2/config/brd4108a/mikroe_ph2_config.h @@ -0,0 +1,106 @@ + +/***************************************************************************/ /** + * @file mikroe ph2 config.h + * @brief mikroe ph2 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_PH2_CONFIG_H +#define MIKROE_PH2_CONFIG_H +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PH2 I2C Configuration + +// MIKROE PH2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PH2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PH2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_PH2_ST1 +// $[GPIO_MIKROE_PH2_ST1] +#ifndef MIKROE_PH2_ST1_PORT +#define MIKROE_PH2_ST1_PORT gpioPortC +#endif +#ifndef MIKROE_PH2_ST1_PIN +#define MIKROE_PH2_ST1_PIN 6 +#endif +// [GPIO_MIKROE_PH2_ST1]$ + +// MIKROE_PH2_ST2 +// $[GPIO_MIKROE_PH2_ST2] +#ifndef MIKROE_PH2_ST2_PORT +#define MIKROE_PH2_ST2_PORT gpioPortB +#endif +#ifndef MIKROE_PH2_ST2_PIN +#define MIKROE_PH2_ST2_PIN 3 +#endif +// [GPIO_MIKROE_PH2_ST2]$ + +// MIKROE_DS18B20_DQ +// $[GPIO_MIKROE_DS18B20_DQ] +#ifndef MIKROE_DS18B20_DQ_PORT +#define MIKROE_DS18B20_DQ_PORT gpioPortB +#endif +#ifndef MIKROE_DS18B20_DQ_PIN +#define MIKROE_DS18B20_DQ_PIN 4 +#endif +// [GPIO_MIKROE_DS18B20_DQ]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_PH2_CONFIG_H \ No newline at end of file diff --git a/driver/public/mikroe/ph2/config/brd4314a/mikroe_ph2_config.h b/driver/public/mikroe/ph2/config/brd4314a/mikroe_ph2_config.h new file mode 100644 index 00000000..b14e6a6d --- /dev/null +++ b/driver/public/mikroe/ph2/config/brd4314a/mikroe_ph2_config.h @@ -0,0 +1,106 @@ + +/***************************************************************************/ /** + * @file mikroe ph2 config.h + * @brief mikroe ph2 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_PH2_CONFIG_H +#define MIKROE_PH2_CONFIG_H +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PH2 I2C Configuration + +// MIKROE PH2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PH2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PH2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_PH2_ST1 +// $[GPIO_MIKROE_PH2_ST1] +#ifndef MIKROE_PH2_ST1_PORT +#define MIKROE_PH2_ST1_PORT gpioPortC +#endif +#ifndef MIKROE_PH2_ST1_PIN +#define MIKROE_PH2_ST1_PIN 6 +#endif +// [GPIO_MIKROE_PH2_ST1]$ + +// MIKROE_PH2_ST2 +// $[GPIO_MIKROE_PH2_ST2] +#ifndef MIKROE_PH2_ST2_PORT +#define MIKROE_PH2_ST2_PORT gpioPortB +#endif +#ifndef MIKROE_PH2_ST2_PIN +#define MIKROE_PH2_ST2_PIN 3 +#endif +// [GPIO_MIKROE_PH2_ST2]$ + +// MIKROE_DS18B20_DQ +// $[GPIO_MIKROE_DS18B20_DQ] +#ifndef MIKROE_DS18B20_DQ_PORT +#define MIKROE_DS18B20_DQ_PORT gpioPortB +#endif +#ifndef MIKROE_DS18B20_DQ_PIN +#define MIKROE_DS18B20_DQ_PIN 4 +#endif +// [GPIO_MIKROE_DS18B20_DQ]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_PH2_CONFIG_H \ No newline at end of file diff --git a/driver/public/mikroe/ph2/config/brd4338a/mikroe_ph2_config.h b/driver/public/mikroe/ph2/config/brd4338a/mikroe_ph2_config.h new file mode 100644 index 00000000..c01269ae --- /dev/null +++ b/driver/public/mikroe/ph2/config/brd4338a/mikroe_ph2_config.h @@ -0,0 +1,105 @@ + +/***************************************************************************/ /** + * @file mikroe ph2 config.h + * @brief mikroe ph2 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_PH2_CONFIG_H +#define MIKROE_PH2_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PH2 I2C Configuration + +// MIKROE PH2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PH2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PH2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_PH2_ST1 +// $[GPIO_MIKROE_PH2_ST1] +#ifndef MIKROE_PH2_ST1_PORT +#define MIKROE_PH2_ST1_PORT HP +#endif +#ifndef MIKROE_PH2_ST1_PIN +#define MIKROE_PH2_ST1_PIN 46 +#endif +// [GPIO_MIKROE_PH2_ST1]$ + +// MIKROE_PH2_ST2 +// $[GPIO_MIKROE_PH2_ST2] +#ifndef MIKROE_PH2_ST2_PORT +#define MIKROE_PH2_ST2_PORT HP +#endif +#ifndef MIKROE_PH2_ST2_PIN +#define MIKROE_PH2_ST2_PIN 47 +#endif +// [GPIO_MIKROE_PH2_ST2]$ + +// MIKROE_DS18B20_DQ +// $[GPIO_MIKROE_DS18B20_DQ] +#ifndef MIKROE_DS18B20_DQ_PORT +#define MIKROE_DS18B20_DQ_PORT HP +#endif +#ifndef MIKROE_DS18B20_DQ_PIN +#define MIKROE_DS18B20_DQ_PIN 48 +#endif +// [GPIO_MIKROE_DS18B20_DQ]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_PH2_CONFIG_H \ No newline at end of file diff --git a/driver/public/mikroe/ph2/config/other/mikroe_ph2_config.h b/driver/public/mikroe/ph2/config/other/mikroe_ph2_config.h new file mode 100644 index 00000000..015e8e57 --- /dev/null +++ b/driver/public/mikroe/ph2/config/other/mikroe_ph2_config.h @@ -0,0 +1,112 @@ + +/***************************************************************************/ /** + * @file mikroe ph2 config.h + * @brief mikroe ph2 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_PH2_CONFIG_H +#define MIKROE_PH2_CONFIG_H + +#ifndef(SLI_SI917) +#include "em_gpio.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PH2 I2C Configuration + +// MIKROE PH2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PH2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PH2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_PH2_ST1 +#warning "MIKROE_PH2_ST1 is not configured" +// $[GPIO_MIKROE_PH2_ST1] +// #ifndef MIKROE_PH2_ST1_PORT +// #define MIKROE_PH2_ST1_PORT gpioPortC +// #endif +// #ifndef MIKROE_PH2_ST1_PIN +// #define MIKROE_PH2_ST1_PIN 6 +// #endif +// [GPIO_MIKROE_PH2_ST1]$ + +// MIKROE_PH2_ST2 +#warning "MIKROE_PH2_ST2 is not configured" +// $[GPIO_MIKROE_PH2_ST2] +// #ifndef MIKROE_PH2_ST2_PORT +// #define MIKROE_PH2_ST2_PORT gpioPortB +// #endif +// #ifndef MIKROE_PH2_ST2_PIN +// #define MIKROE_PH2_ST2_PIN 3 +// #endif +// [GPIO_MIKROE_PH2_ST2]$ + +// MIKROE_DS18B20_DQ +#warning "MIKROE_DS18B20_DQ is not configured" +// $[GPIO_MIKROE_DS18B20_DQ] +// #ifndef MIKROE_DS18B20_DQ_PORT +// #define MIKROE_DS18B20_DQ_PORT gpioPortB +// #endif +// #ifndef MIKROE_DS18B20_DQ_PIN +// #define MIKROE_DS18B20_DQ_PIN 4 +// #endif +// [GPIO_MIKROE_DS18B20_DQ]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_PH2_CONFIG_H \ No newline at end of file diff --git a/driver/public/mikroe/ph2/inc/mikroe_ph2.h b/driver/public/mikroe/ph2/inc/mikroe_ph2.h new file mode 100644 index 00000000..ef132afe --- /dev/null +++ b/driver/public/mikroe/ph2/inc/mikroe_ph2.h @@ -0,0 +1,366 @@ +/***************************************************************************//** + * @file mikroe_ph2.h + * @brief Mikroe Ph2 Prototypes + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_PH2_INC_H_ +#define MIKROE_PH2_INC_H_ + +#include "sl_status.h" +#include "drv_i2c_master.h" +#include "drv_one_wire.h" +#include "ph2.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * @addtogroup ph2 pH 2 Click Driver + * @brief API for configuring and manipulating pH 2 Click driver. + * @{ + */ + +/** + * @defgroup ph2_cmd pH 2 Commands List + * @brief List of commands of pH 2 Click driver. + */ + +/** + * @addtogroup ph2_cmd + * @{ + */ + +/** + * @brief pH 2 DS18B20 commands list. + * @details Specified commands list for setting DS18B20 of pH 2 Click driver. + */ +#define MIKROE_PH2_CONVERT_TEMPERATURE PH2_CMD_CONVERT_TEMPERATURE +#define MIKROE_PH2_WRITE_SCRATCHPAD PH2_CMD_WRITE_SCRATCHPAD +#define MIKROE_PH2_READ_SCRATCHPAD PH2_CMD_READ_SCRATCHPAD +#define MIKROE_PH2_COPY_SCRATCHPAD PH2_CMD_COPY_SCRATCHPAD +#define MIKROE_PH2_RECALL_SCRATCHPAD PH2_CMD_RECALL_SCRATCHPAD +#define MIKROE_PH2_READ_POWER_SUPPLY PH2_CMD_READ_POWER_SUPPLY + +/*! @} */ // ph2_cmd + +/** + * @defgroup ph2_set pH 2 Registers Settings + * @brief Settings for registers of pH 2 Click driver. + */ + +/** + * @addtogroup ph2_set + * @{ + */ + +/** + * @brief pH 2 description setting. + * @details Specified setting for description of pH 2 Click driver. + */ +#define MIKROE_PH2_PH_CALCULATION_COEF PH2_PH_CALCULATION_COEF + +#define MIKROE_PH2_CONFIG_ADDRESS PH2_CONFIG_ADDRESS + +/** + * @brief pH 2 ADC setting. + * @details Specified settings for ADC of pH 2 Click driver. + */ +#define MIKROE_PH2_ADC_RESOLUTION PH2_ADC_RESOLUTION +#define MIKROE_PH2_VREF_3V3 PH2_VREF_3V3 +#define MIKROE_PH2_VREF_5V PH2_VREF_5V + +/** + * @brief pH 2 device address setting. + * @details Specified setting for device slave address selection of + * pH 2 Click driver. + */ +#define MIKROE_PH2_SET_DEV_ADDR PH2_SET_DEV_ADDR + +/** + * @brief pH 2 DS18B20 family code value. + * @details Specified family code value of DS18B20 of pH 2 2 Click driver. + */ +#define MIKROE_PH2_FAMILY_CODE PH2_FAMILY_CODE + +/** + * @brief pH 2 config register settings. + * @details Specified config register settings of pH 2 Click driver. + */ + +#define MIKROE_PH2_CONFIG_RESOLUTION_9BIT PH2_CONFIG_RESOLUTION_9BIT +#define MIKROE_PH2_CONFIG_RESOLUTION_10BIT PH2_CONFIG_RESOLUTION_10BIT +#define MIKROE_PH2_CONFIG_RESOLUTION_11BIT PH2_CONFIG_RESOLUTION_11BIT +#define MIKROE_PH2_CONFIG_RESOLUTION_12BIT PH2_CONFIG_RESOLUTION_12BIT +#define MIKROE_PH2_CONFIG_RESOLUTION_BIT_MASK PH2_CONFIG_RESOLUTION_BIT_MASK +#define MIKROE_PH2_CONFIG_RESERVED_BITS PH2_CONFIG_RESERVED_BITS + +/** + * @brief pH 2 temperature calculation values. + * @details Specified temperature calculation values of pH 2 Click driver. + */ +#define MIKROE_PH2_DATA_RESOLUTION PH2_DATA_RESOLUTION + +/** + * @brief pH 2 default config values. + * @details Specified default config values of pH 2 Click driver. + */ +#define MIKROE_PH2_DEFAULT_ADDRESS PH2_DEFAULT_ADDRESS +#define MIKROE_PH2_DEFAULT_RESOLUTION PH2_DEFAULT_RESOLUTION +#define MIKROE_PH2_DEFAULT_TEMP_HIGH_ALARM PH2_DEFAULT_TEMP_HIGH_ALARM +#define MIKROE_PH2_DEFAULT_TEMP_LOW_ALARM PH2_DEFAULT_TEMP_LOW_ALARM + +/***************************************************************************//** + * @brief + * Initialization function. + * + * @param[in] i2c_instance + * mikroe_i2c_handle_t instance + * + * @return + * SL_STATUS_OK Successful initialization. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null + * SL_STATUS_INITIALIZATION Initialization failed. + ******************************************************************************/ +sl_status_t mikroe_ph2_init(mikroe_i2c_handle_t i2c_instance); + +/***************************************************************************//** + * @brief + * This function sets the mikroe_i2c_handle_t instance used by platform functions. + * + * @param[in] i2c_instance + * mikroe_i2c_handle_t instance + * + * @return + * SL_STATUS_OK if there are no errors. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. + ******************************************************************************/ +sl_status_t mikroe_ph2_set_i2c_instance(mikroe_i2c_handle_t i2c_instance); + +/***************************************************************************//** + * @brief + * This function read raw ADC value function. + * + * @param[in] raw_adc + * Output ADC result + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_read_raw_adc(uint16_t *raw_adc); + +/***************************************************************************//** + * @brief + * This function reads raw ADC value and converts it to proportional voltage + * level. + * + * @param[in] voltage + * Output voltage level (volts). + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_read_voltage(float *voltage); + +/***************************************************************************//** + * @brief + * This function sets the voltage reference for pH 2 click driver. + * + * @param[in] vref + * Reference voltage (volts). + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_set_vref(float vref); + +/***************************************************************************//** + * @brief + * This function is performing calibration of Ph 2 click driver + * with known pH value substance. + * + * @param[in] pH_value + * pH value of the substance where calibration is performed. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_calibrate(float pH_value); + +/***************************************************************************//** + * @brief + * This function is reading pH value wof substance where pH probe is placed. + * + * @param[in] pH_value + * pH value of the substance. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + * @note This function calculates the pH value with the assumption that the + * temperature of the substance is 25 deg Celsius. + ******************************************************************************/ +sl_status_t mikroe_ph2_calculate_ph(float *pH_value); + +/***************************************************************************//** + * @brief + * This function is used to calibrate offset of Ph 2 click driver. + * @param[in]: + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + * @note Disconnect the probe and short-circuit the BNC connector in order to + * set the reference voltage. Adjust the potentiometer until the LEDs stop + * blinking or until the voltage of the OUT pin is exactly at half the value of + * the selected VCC voltage. If you are using LEDs for calibration, turn the + * potentiometer clockwise when STAT1 LED is blinking and counter-clockwise + * when STAT2 LED is blinking. + ******************************************************************************/ +sl_status_t mikroe_ph2_calibrate_offset(void); + +/***************************************************************************//** + * @brief + * This function is used turn on/off STAT1 LED of Ph 2 click driver. + * @param[in] state + * TRUE: turn on + * FALSE: turn off + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_enable_st1(bool state); + +/***************************************************************************//** + * @brief + * This function is used turn on/off STAT2 LED of Ph 2 click driver. + * @param[in] state + * TRUE: turn on + * FALSE: turn off + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_enable_st2(bool state); + +/***************************************************************************//** + * @brief + * This function initializes all necessary pins and peripherals used + * for DS18B20 sensor. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_INITIALIZATION: Initialization failed. + ******************************************************************************/ +sl_status_t mikroe_ds18b20_init(void); + +/***************************************************************************//** + * @brief + * This function checks the communication by reading the ROM address + * as well as verifying family code and Maxim CRC 8. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_check_communication(void); + +/***************************************************************************//** + * @brief + * This function selects the device one OneWirebus + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_select_device(void); + +/***************************************************************************//** + * @brief + * This function reads a desired number of scratchpad bytes using One Wire + * communication protocol. + * @param[out] scratchpad + * Output read scratchpad. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_read_scratchpad(uint8_t *scratchpad); + +/***************************************************************************//** + * @brief + * This function writes the temperature thresholds and configuration byte to + * the scratchpad. + * @param[in] temp_high : Temperature high limit. + * @param[in] temp_low : Temperature low limit. + * @param[in] config : Configuration byte. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_write_scratchpad(uint8_t temp_high, + uint8_t temp_low, + uint8_t config); + +/***************************************************************************//** + * @brief + * This function executes a default configuration of pH 2 DS18B20 sensor. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_default_cfg (void); + +/***************************************************************************//** + * @brief + * This function starts the measurement by sending an appropriate command for + * that. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_start_measurement(void); + +/***************************************************************************//** + * @brief + * This function reads the temperature value in Celsius. + * @param[out] temperature : Temperature in Celsius. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_read_temperature (float *temperature); + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_PH2_INC_H_ diff --git a/driver/public/mikroe/ph2/src/mikroe_ph2.c b/driver/public/mikroe/ph2/src/mikroe_ph2.c new file mode 100644 index 00000000..b0c7244a --- /dev/null +++ b/driver/public/mikroe/ph2/src/mikroe_ph2.c @@ -0,0 +1,398 @@ +/***************************************************************************//** + * @file mikroe_ph2.c + * @brief Mikroe Ph2 Source File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include "mikroe_ph2.h" +#include "mikroe_ph2_config.h" +#include "ph2.h" + +static ph2_t mikroe_ph2; +static ph2_cfg_t mikroe_ph2_cfg; + +/***************************************************************************//** + * @brief + * Initialization function. + * + * @param[in] i2c_instance + * mikroe_i2c_handle_t instance + * + * @return + * SL_STATUS_OK Successful initialization. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null + * SL_STATUS_INITIALIZATION Initialization failed. + ******************************************************************************/ +sl_status_t mikroe_ph2_init(mikroe_i2c_handle_t i2c_instance) +{ + if (NULL == i2c_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + mikroe_ph2.i2c.handle = i2c_instance; + + ph2_cfg_setup(&mikroe_ph2_cfg); + +#if (MIKROE_PH2_I2C_UC == 1) + mikroe_ph2_cfg.i2c_speed = MIKROE_PH2_I2C_SPEED_MODE; +#endif + +#if defined(MIKROE_PH2_ST1_PORT) && defined(MIKROE_PH2_ST1_PIN) + mikroe_ph2_cfg.st1 = hal_gpio_pin_name(MIKROE_PH2_ST1_PORT, + MIKROE_PH2_ST1_PIN); +#endif + +#if defined(MIKROE_PH2_ST2_PORT) && defined(MIKROE_PH2_ST2_PIN) + mikroe_ph2_cfg.st2 = hal_gpio_pin_name(MIKROE_PH2_ST2_PORT, + MIKROE_PH2_ST2_PIN); +#endif + +#if defined(MIKROE_DS18B20_DQ_PORT) && defined(MIKROE_DS18B20_DQ_PIN) + mikroe_ph2_cfg.dq = hal_gpio_pin_name(MIKROE_DS18B20_DQ_PORT, + MIKROE_DS18B20_DQ_PIN); +#endif + + if (PH2_OK != ph2_init(&mikroe_ph2, &mikroe_ph2_cfg)) { + return SL_STATUS_INITIALIZATION; + } + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief + * This function sets the mikroe_i2c_handle_t instance used by platform functions. + * + * @param[in] i2c_instance + * mikroe_i2c_handle_t instance + * + * @return + * SL_STATUS_OK if there are no errors. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. + ******************************************************************************/ +sl_status_t mikroe_ph2_set_i2c_instance(mikroe_i2c_handle_t i2c_instance) +{ + if (NULL == i2c_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + mikroe_ph2.i2c.handle = i2c_instance; + + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief + * This function read raw ADC value function. + * + * @param[in] raw_adc + * Output ADC result + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_read_raw_adc(uint16_t *raw_adc) +{ + if (NULL == raw_adc) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (ph2_read_raw_adc(&mikroe_ph2, + raw_adc) == PH2_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function reads raw ADC value and converts it to proportional voltage + * level. + * + * @param[in] voltage + * Output voltage level (volts). + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_read_voltage(float *voltage) +{ + if (NULL == voltage) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (ph2_read_voltage(&mikroe_ph2, + voltage) == PH2_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function sets the voltage reference for pH 2 click driver. + * + * @param[in] vref + * Reference voltage (volts). + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_set_vref(float vref) +{ + return (ph2_set_vref(&mikroe_ph2, + vref) == PH2_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function is performing calibration of Ph 2 click driver + * with known pH value substance. + * + * @param[in] pH_value + * pH value of the substance where calibration is performed. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_calibrate(float pH_value) +{ + return (ph2_calibrate(&mikroe_ph2, + pH_value) == PH2_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function is reading pH value wof substance where pH probe is placed. + * + * @param[in] pH_value + * pH value of the substance. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + * @note This function calculates the pH value with the assumption that the + * temperature of the substance is 25 deg Celsius. + ******************************************************************************/ +sl_status_t mikroe_ph2_calculate_ph(float *pH_value) +{ + if (NULL == pH_value) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (ph2_calculate_ph(&mikroe_ph2, + pH_value) == PH2_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function is used to calibrate offset of Ph 2 click driver. + * @param[in]: + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + * @note Disconnect the probe and short-circuit the BNC connector in order to + * set the reference voltage. Adjust the potentiometer until the LEDs stop + * blinking or until the voltage of the OUT pin is exactly at half the value of + * the selected VCC voltage. If you are using LEDs for calibration, turn the + * potentiometer clockwise when STAT1 LED is blinking and counter-clockwise + * when STAT2 LED is blinking. + ******************************************************************************/ +sl_status_t mikroe_ph2_calibrate_offset(void) +{ + ph2_calibrate_offset(&mikroe_ph2); + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief + * This function is used turn on/off STAT1 LED of Ph 2 click driver. + * @param[in] state + * TRUE: turn on + * FALSE: turn off + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_enable_st1(bool state) +{ + if (state) { + ph2_enable_st1(&mikroe_ph2); + } else { + ph2_disable_st1(&mikroe_ph2); + } + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief + * This function is used turn on/off STAT2 LED of Ph 2 click driver. + * @param[in] state + * TRUE: turn on + * FALSE: turn off + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ph2_enable_st2(bool state) +{ + if (state) { + ph2_enable_st2(&mikroe_ph2); + } else { + ph2_disable_st2(&mikroe_ph2); + } + return SL_STATUS_OK; +} + +/***************************************************************************//** + * @brief + * This function initializes all necessary pins and peripherals used + * for DS18B20 sensor. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_INITIALIZATION: Initialization failed. + ******************************************************************************/ +sl_status_t mikroe_ds18b20_init(void) +{ + return (ph2_ds18b20_init(&mikroe_ph2, + &mikroe_ph2_cfg) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_INITIALIZATION; +} + +/***************************************************************************//** + * @brief + * This function checks the communication by reading the ROM address + * as well as verifying family code and Maxim CRC 8. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_check_communication(void) +{ + return (ph2_ds18b20_check_communication(&mikroe_ph2) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function selects the device one OneWirebus + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_select_device(void) +{ + return (ph2_ds18b20_select_device(&mikroe_ph2) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function reads a desired number of scratchpad bytes using One Wire + * communication protocol. + * @param[out] scratchpad + * Output read scratchpad. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_read_scratchpad(uint8_t *scratchpad) +{ + if (NULL == scratchpad) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (ph2_ds18b20_read_scratchpad(&mikroe_ph2, scratchpad) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function writes the temperature thresholds and configuration byte to + * the scratchpad. + * @param[in] temp_high : Temperature high limit. + * @param[in] temp_low : Temperature low limit. + * @param[in] config : Configuration byte. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_write_scratchpad(uint8_t temp_high, + uint8_t temp_low, + uint8_t config) +{ + return (ph2_ds18b20_write_scratchpad(&mikroe_ph2, + temp_high, + temp_low, + config) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function executes a default configuration of pH 2 DS18B20 sensor. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_default_cfg(void) +{ + return (ph2_ds18b20_default_cfg(&mikroe_ph2) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function starts the measurement by sending an appropriate command for + * that. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_start_measurement(void) +{ + return (ph2_ds18b20_start_measurement(&mikroe_ph2) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} + +/***************************************************************************//** + * @brief + * This function reads the temperature value in Celsius. + * @param[out] temperature : Temperature in Celsius. + * @return + * SL_STATUS_OK: Success + * SL_STATUS_FAIL: Error + ******************************************************************************/ +sl_status_t mikroe_ds18b20_read_temperature(float *temperature) +{ + if (NULL == temperature) { + return SL_STATUS_INVALID_PARAMETER; + } + + return (ph2_ds18b20_read_temperature(&mikroe_ph2, temperature) == PH2_OK) + ? SL_STATUS_OK : SL_STATUS_FAIL; +} diff --git a/driver/public/mikroe/pir_pl_n823_01/config/brd2703a/mikroe_pir_pl_n823_01_config.h b/driver/public/mikroe/pir_pl_n823_01/config/brd2703a/mikroe_pir_pl_n823_01_config.h index c95168b2..9ca0faa4 100644 --- a/driver/public/mikroe/pir_pl_n823_01/config/brd2703a/mikroe_pir_pl_n823_01_config.h +++ b/driver/public/mikroe/pir_pl_n823_01/config/brd2703a/mikroe_pir_pl_n823_01_config.h @@ -40,10 +40,33 @@ #ifndef MIKORE_PIR_PL_N823_01_CONFIG_H_ #define MIKORE_PIR_PL_N823_01_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PL_N823_01 I2C Configuration + +// MIKROE PL_N823_01 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PL_N823_01_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PL_N823_01_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // PL_N823_01_ANALOG_OUTPUT @@ -58,4 +81,4 @@ extern "C" { } #endif -#endif /* MIKORE_PIR_PL_N823_01_CONFIG_H_ */ +#endif // MIKORE_PIR_PL_N823_01_CONFIG_H_ diff --git a/driver/public/mikroe/pir_pl_n823_01/config/brd4108a/mikroe_pir_pl_n823_01_config.h b/driver/public/mikroe/pir_pl_n823_01/config/brd4108a/mikroe_pir_pl_n823_01_config.h index 9140fdac..037a52db 100644 --- a/driver/public/mikroe/pir_pl_n823_01/config/brd4108a/mikroe_pir_pl_n823_01_config.h +++ b/driver/public/mikroe/pir_pl_n823_01/config/brd4108a/mikroe_pir_pl_n823_01_config.h @@ -40,10 +40,33 @@ #ifndef MIKORE_PIR_PL_N823_01_CONFIG_H_ #define MIKORE_PIR_PL_N823_01_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PL_N823_01 I2C Configuration + +// MIKROE PL_N823_01 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PL_N823_01_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PL_N823_01_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // PL_N823_01_ANALOG_OUTPUT @@ -58,4 +81,4 @@ extern "C" { } #endif -#endif /* MIKORE_PIR_PL_N823_01_CONFIG_H_ */ +#endif // MIKORE_PIR_PL_N823_01_CONFIG_H_ diff --git a/driver/public/mikroe/pir_pl_n823_01/config/brd4314a/mikroe_pir_pl_n823_01_config.h b/driver/public/mikroe/pir_pl_n823_01/config/brd4314a/mikroe_pir_pl_n823_01_config.h index 9140fdac..037a52db 100644 --- a/driver/public/mikroe/pir_pl_n823_01/config/brd4314a/mikroe_pir_pl_n823_01_config.h +++ b/driver/public/mikroe/pir_pl_n823_01/config/brd4314a/mikroe_pir_pl_n823_01_config.h @@ -40,10 +40,33 @@ #ifndef MIKORE_PIR_PL_N823_01_CONFIG_H_ #define MIKORE_PIR_PL_N823_01_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PL_N823_01 I2C Configuration + +// MIKROE PL_N823_01 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PL_N823_01_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PL_N823_01_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // PL_N823_01_ANALOG_OUTPUT @@ -58,4 +81,4 @@ extern "C" { } #endif -#endif /* MIKORE_PIR_PL_N823_01_CONFIG_H_ */ +#endif // MIKORE_PIR_PL_N823_01_CONFIG_H_ diff --git a/driver/public/mikroe/pir_pl_n823_01/config/brd4338a/mikroe_pir_pl_n823_01_config.h b/driver/public/mikroe/pir_pl_n823_01/config/brd4338a/mikroe_pir_pl_n823_01_config.h new file mode 100644 index 00000000..41c16c27 --- /dev/null +++ b/driver/public/mikroe/pir_pl_n823_01/config/brd4338a/mikroe_pir_pl_n823_01_config.h @@ -0,0 +1,71 @@ +/***************************************************************************//** + * @file mikroe_pir_pl_n823_01_config.h + * @brief Mikroe PIR PL_N823_01 Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKORE_PIR_PL_N823_01_CONFIG_H_ +#define MIKORE_PIR_PL_N823_01_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PL_N823_01 I2C Configuration + +// MIKROE PL_N823_01 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PL_N823_01_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PL_N823_01_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKORE_PIR_PL_N823_01_CONFIG_H_ diff --git a/driver/public/mikroe/pir_pl_n823_01/config/other/mikroe_pir_pl_n823_01_config.h b/driver/public/mikroe/pir_pl_n823_01/config/other/mikroe_pir_pl_n823_01_config.h index cb1a7f69..c29e0cd6 100644 --- a/driver/public/mikroe/pir_pl_n823_01/config/other/mikroe_pir_pl_n823_01_config.h +++ b/driver/public/mikroe/pir_pl_n823_01/config/other/mikroe_pir_pl_n823_01_config.h @@ -40,10 +40,33 @@ #ifndef MIKORE_PIR_PL_N823_01_CONFIG_H_ #define MIKORE_PIR_PL_N823_01_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE PL_N823_01 I2C Configuration + +// MIKROE PL_N823_01 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_PL_N823_01_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_PL_N823_01_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // PL_N823_01_ANALOG_OUTPUT @@ -59,4 +82,4 @@ extern "C" { } #endif -#endif /* MIKORE_PIR_PL_N823_01_CONFIG_H_ */ +#endif // MIKORE_PIR_PL_N823_01_CONFIG_H_ diff --git a/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h b/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h index b10d5bb6..729e6ecb 100644 --- a/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h +++ b/driver/public/mikroe/pir_pl_n823_01/inc/mikroe_pl_n823_01.h @@ -41,20 +41,34 @@ #define MIKROE_PL_N823_01_H_ #include "sl_status.h" -#include "sl_i2cspm.h" -#include "pir.h" +#include "drv_i2c_master.h" -#define PIR_PL_N823_01_I2C_SLAVE_ADDRESS 0x4D +#ifdef __cplusplus +extern "C" { +#endif -/** +/***************************************************************************//** * @brief Initialization function. * * @description This function initializes all necessary pins and peripherals * used for this click. - */ -sl_status_t mikroe_pl_n823_01_init(sl_i2cspm_t *instance); + ******************************************************************************/ +sl_status_t mikroe_pl_n823_01_init(mikroe_i2c_handle_t i2cspm_instance); + +/***************************************************************************//** + * @brief + * This function sets the IC2 instance used by platform functions. + * + * @param[in] i2c_instance + * I2C instance + * + * @return + * SL_STATUS_OK if there are no errors. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. + ******************************************************************************/ +sl_status_t mikroe_pl_n823_01_set_i2c_instance(mikroe_i2c_handle_t instance); -/** +/***************************************************************************//** * @brief Generic write function. * * @param reg Register address. @@ -62,11 +76,11 @@ sl_status_t mikroe_pl_n823_01_init(sl_i2cspm_t *instance); * @param len Number of the bytes in data buf. * * @description This function writes data to the desired register. - */ + ******************************************************************************/ sl_status_t mikroe_pl_n823_01_generic_write(uint8_t reg, uint8_t *data_buf, uint8_t len); -/** +/***************************************************************************//** * @brief Generic read function. * * @param reg Register address. @@ -74,34 +88,34 @@ sl_status_t mikroe_pl_n823_01_generic_write(uint8_t reg, uint8_t *data_buf, * @param len Number of the bytes to be read * * @description This function reads data from the desired register. - */ + ******************************************************************************/ sl_status_t mikroe_pl_n823_01_generic_read (uint8_t reg, uint8_t *data_buf, uint8_t len); -/** +/***************************************************************************//** * @brief Reading 12bit ADC value. * * This function reads single ADC conversion data - */ + ******************************************************************************/ uint16_t mikroe_pl_n823_01_get_adc(void); -/** +/***************************************************************************//** * @brief Reading register. * * This function reads register - */ + ******************************************************************************/ uint16_t mikroe_pl_n823_01_reg_read(void); -/** +/***************************************************************************//** * @brief Reading ADC data in mili Volts * * @param ref_voltage reference voltage in miliVolts (3300 or 5000 miliVolts). * * This function reads 12bit ADC data and convets it to miliVolts - */ + ******************************************************************************/ float mikroe_pl_n823_01_get_mili_volt(uint16_t ref_voltage); -/** +/***************************************************************************//** * @brief Scaling ADC results * * @param in_val ADC conversion raw data @@ -110,8 +124,12 @@ float mikroe_pl_n823_01_get_mili_volt(uint16_t ref_voltage); * * This function scales ADC conversion data (inVal) to desired range (from * outMin to outMax) and returns scaled data (outVal) - */ + ******************************************************************************/ float mikroe_pl_n823_01_scale_results (uint16_t in_val, uint16_t out_min, uint16_t out_max); -#endif /* MIKROE_PL_N823_01_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_PL_N823_01_H_ diff --git a/driver/public/mikroe/pir_pl_n823_01/src/mikroe_pl_n823_01.c b/driver/public/mikroe/pir_pl_n823_01/src/mikroe_pl_n823_01.c index d5620b31..8e125b5a 100644 --- a/driver/public/mikroe/pir_pl_n823_01/src/mikroe_pl_n823_01.c +++ b/driver/public/mikroe/pir_pl_n823_01/src/mikroe_pl_n823_01.c @@ -39,29 +39,19 @@ #include "mikroe_pl_n823_01.h" #include "mikroe_pir_pl_n823_01_config.h" -#include "third_party_hw_drivers_helpers.h" +#include "pir.h" static pir_t pir_ctx; static pir_cfg_t pir_cfg; -static void mikroe_pl_n823_01_cfg_setup(void); - -static void mikroe_pl_n823_01_cfg_setup(void) -{ - pir_cfg_setup(&pir_cfg); -} - -sl_status_t mikroe_pl_n823_01_init(sl_i2cspm_t *instance) +sl_status_t mikroe_pl_n823_01_init(mikroe_i2c_handle_t instance) { if (instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } - mikroe_pl_n823_01_cfg_setup(); + pir_cfg_setup(&pir_cfg); pir_ctx.i2c.handle = instance; - pir_ctx.slave_address = PIR_PL_N823_01_I2C_SLAVE_ADDRESS; - - THIRD_PARTY_HW_DRV_RETCODE_INIT(); #if defined(PL_N823_01_ANALOG_OUTPUT_PORT) \ && defined(PL_N823_01_ANALOG_OUTPUT_PIN) @@ -69,9 +59,26 @@ sl_status_t mikroe_pl_n823_01_init(sl_i2cspm_t *instance) PL_N823_01_ANALOG_OUTPUT_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(pir_init(&pir_ctx, &pir_cfg)); +#if (MIKROE_PL_N823_01_I2C_UC == 1) + pir_cfg.i2c_speed = MIKROE_PL_N823_01_I2C_SPEED_MODE; +#endif + + if (PIR_OK != pir_init(&pir_ctx, &pir_cfg)) { + return SL_STATUS_INITIALIZATION; + } + + return SL_STATUS_OK; +} + +sl_status_t mikroe_pl_n823_01_set_i2c_instance(mikroe_i2c_handle_t instance) +{ + if (NULL == instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + pir_ctx.i2c.handle = instance; - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } sl_status_t mikroe_pl_n823_01_generic_write(uint8_t reg, uint8_t *data_buf, diff --git a/driver/public/mikroe/pressure3_dps310/config/brd2703a/mikroe_dps310_spi_config.h b/driver/public/mikroe/pressure3_dps310/config/brd2703a/mikroe_dps310_spi_config.h new file mode 100644 index 00000000..336e5641 --- /dev/null +++ b/driver/public/mikroe/pressure3_dps310/config/brd2703a/mikroe_dps310_spi_config.h @@ -0,0 +1,80 @@ +/***************************************************************************//** + * @file micro_oled_dps310_config.h + * @brief Micro OLED DPS310 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_DPS310_SPI_CONFIG_H +#define MIKROE_DPS310_SPI_CONFIG_H + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE DPS310 SPI Configuration + +// MIKROE DPS310 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DPS310_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DPS310_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DPS310_CS +// $[GPIO_DPS310_CS] +#define DPS310_CS_PORT gpioPortC +#define DPS310_CS_PIN 0 +// [GPIO_DPS310_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_DPS310_SPI_CONFIG_H diff --git a/driver/public/mikroe/pressure3_dps310/config/brd4108a/mikroe_dps310_spi_config.h b/driver/public/mikroe/pressure3_dps310/config/brd4108a/mikroe_dps310_spi_config.h new file mode 100644 index 00000000..5813b05c --- /dev/null +++ b/driver/public/mikroe/pressure3_dps310/config/brd4108a/mikroe_dps310_spi_config.h @@ -0,0 +1,80 @@ +/***************************************************************************//** + * @file micro_oled_dps310_config.h + * @brief Micro OLED DPS310 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_DPS310_SPI_CONFIG_H +#define MIKROE_DPS310_SPI_CONFIG_H + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE DPS310 SPI Configuration + +// MIKROE DPS310 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DPS310_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DPS310_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DPS310_CS +// $[GPIO_DPS310_CS] +#define DPS310_CS_PORT gpioPortC +#define DPS310_CS_PIN 3 +// [GPIO_DPS310_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_DPS310_SPI_CONFIG_H diff --git a/driver/public/mikroe/pressure3_dps310/config/brd4314a/mikroe_dps310_spi_config.h b/driver/public/mikroe/pressure3_dps310/config/brd4314a/mikroe_dps310_spi_config.h new file mode 100644 index 00000000..5813b05c --- /dev/null +++ b/driver/public/mikroe/pressure3_dps310/config/brd4314a/mikroe_dps310_spi_config.h @@ -0,0 +1,80 @@ +/***************************************************************************//** + * @file micro_oled_dps310_config.h + * @brief Micro OLED DPS310 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_DPS310_SPI_CONFIG_H +#define MIKROE_DPS310_SPI_CONFIG_H + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE DPS310 SPI Configuration + +// MIKROE DPS310 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DPS310_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DPS310_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DPS310_CS +// $[GPIO_DPS310_CS] +#define DPS310_CS_PORT gpioPortC +#define DPS310_CS_PIN 3 +// [GPIO_DPS310_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_DPS310_SPI_CONFIG_H diff --git a/driver/public/mikroe/pressure3_dps310/config/brd4338a/mikroe_dps310_spi_config.h b/driver/public/mikroe/pressure3_dps310/config/brd4338a/mikroe_dps310_spi_config.h new file mode 100644 index 00000000..ba9cceec --- /dev/null +++ b/driver/public/mikroe/pressure3_dps310/config/brd4338a/mikroe_dps310_spi_config.h @@ -0,0 +1,78 @@ +/***************************************************************************//** + * @file micro_oled_dps310_config.h + * @brief Micro OLED DPS310 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_DPS310_SPI_CONFIG_H +#define MIKROE_DPS310_SPI_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE DPS310 SPI Configuration + +// MIKROE DPS310 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DPS310_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DPS310_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DPS310_CS +// $[GPIO_DPS310_CS] +#define DPS310_CS_PORT HP +#define DPS310_CS_PIN 46 +// [GPIO_DPS310_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_DPS310_SPI_CONFIG_H diff --git a/driver/public/mikroe/pressure3_dps310/config/mikroe_dps310_i2c_config.h b/driver/public/mikroe/pressure3_dps310/config/mikroe_dps310_i2c_config.h new file mode 100644 index 00000000..6a2f291f --- /dev/null +++ b/driver/public/mikroe/pressure3_dps310/config/mikroe_dps310_i2c_config.h @@ -0,0 +1,70 @@ +/***************************************************************************/ /** + * @file mikroe_dps310_i2c_config.h + * @brief Mikroe DPS310 I2C configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_DPS310_I2C_CONFIG_H +#define MIKROE_DPS310_I2C_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE DPS310 I2C Configuration + +// MIKROE DPS310 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DPS310_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DPS310_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_DPS310_I2C_CONFIG_H diff --git a/driver/public/mikroe/e_paper_154_inch/config/brd2703a/mikroe_e_paper_154_inch_config.h b/driver/public/mikroe/pressure3_dps310/config/other/mikroe_dps310_spi_config.h similarity index 64% rename from driver/public/mikroe/e_paper_154_inch/config/brd2703a/mikroe_e_paper_154_inch_config.h rename to driver/public/mikroe/pressure3_dps310/config/other/mikroe_dps310_spi_config.h index c20513da..b41142d5 100644 --- a/driver/public/mikroe/e_paper_154_inch/config/brd2703a/mikroe_e_paper_154_inch_config.h +++ b/driver/public/mikroe/pressure3_dps310/config/other/mikroe_dps310_spi_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_e_paper_config.h - * @brief Mikroe E-Paper Configuration + * @file micro_oled_dps310_config.h + * @brief Micro OLED DPS310 Configuration * @version 1.0.0 ******************************************************************************* * # License @@ -36,48 +36,43 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_E_PAPER_154_INCH_CONFIG_H_ -#define MIKROE_E_PAPER_154_INCH_CONFIG_H_ +#ifndef MIKROE_DPS310_SPI_CONFIG_H +#define MIKROE_DPS310_SPI_CONFIG_H + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif #ifdef __cplusplus extern "C" { #endif -#define MIKROE_E_PAPER_WIDTH 200 -#define MIKROE_E_PAPER_HEIGHT 200 - -// A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> -// ESL MODE setting -// ESL_MODE> Enable Peripheral -// Macro for the ESL mode -#define ESL_MODE 0 +// MIKROE DPS310 SPI Configuration + +// MIKROE DPS310 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DPS310_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_DPS310_SPI_BITRATE 10000000 + // // - -// The block ends with the following line or at the end of the file: // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// E_PAPER_DC -// $[GPIO_E_PAPER_DC] -#define E_PAPER_DC_PORT gpioPortA -#define E_PAPER_DC_PIN 0 -// [GPIO_E_PAPER_DC]$ - -// E_PAPER_RST -// $[GPIO_E_PAPER_RST] -#define E_PAPER_RST_PORT gpioPortC -#define E_PAPER_RST_PIN 8 -// [GPIO_E_PAPER_RST]$ - -// E_PAPER_BSY -// $[GPIO_E_PAPER_BSY] -#define E_PAPER_BSY_PORT gpioPortB -#define E_PAPER_BSY_PIN 1 -// [GPIO_E_PAPER_BSY]$ +// DPS310_CS +// $[GPIO_DPS310_CS] +#warning "CS pin for DPS310 is not configured" +// #define DPS310_CS_PORT 0 +// #define DPS310_CS_PIN 0 +// [GPIO_DPS310_CS]$ // <<< sl:end pin_tool >>> @@ -85,4 +80,4 @@ extern "C" { } #endif -#endif /* MIKROE_E_PAPER_154_INCH_CONFIG_H_ */ +#endif // MIKROE_DPS310_SPI_CONFIG_H diff --git a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h index a20506e0..adec2851 100644 --- a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h +++ b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_i2c.h @@ -41,11 +41,12 @@ #define MIKROE_PRESSURE3_H #include "sl_status.h" -#include "sl_i2cspm.h" -#include "drv_digital_out.h" -#include "drv_digital_in.h" #include "drv_i2c_master.h" +#ifdef __cplusplus +extern "C" { +#endif + // -------------------------------------------------------------- PUBLIC MACROS /** @@ -257,10 +258,6 @@ typedef struct * \{ */ -#ifdef __cplusplus -extern "C" { -#endif - /** * @brief Initialization function. * @@ -269,7 +266,7 @@ extern "C" { * @description This function initializes all necessary pins and peripherals * used for this click. */ -sl_status_t mikroe_pressure3_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_pressure3_init(mikroe_i2c_handle_t i2c_instance); /** * @brief Generic write function. diff --git a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h index fd1bb1bf..9315402b 100644 --- a/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h +++ b/driver/public/mikroe/pressure3_dps310/inc/mikroe_dps310_spi.h @@ -41,11 +41,14 @@ #define MIKROE_PRESSURE3_H #include "sl_status.h" -#include "spidrv.h" #include "drv_digital_out.h" #include "drv_digital_in.h" #include "drv_spi_master.h" +#ifdef __cplusplus +extern "C" { +#endif + // -------------------------------------------------------------- PUBLIC MACROS /** @@ -257,10 +260,6 @@ typedef struct * \{ */ -#ifdef __cplusplus -extern "C" { -#endif - /** * @brief Initialization function. * @@ -269,7 +268,7 @@ extern "C" { * @description This function initializes all necessary pins and peripherals * used for this click. */ -sl_status_t mikroe_pressure3_init(SPIDRV_Handle_t spidrv_inst); +sl_status_t mikroe_pressure3_init(mikroe_spi_handle_t spidrv_inst); /** * @brief Generic write function. diff --git a/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_i2c.c b/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_i2c.c index daf5107b..600f6b42 100644 --- a/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_i2c.c +++ b/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_i2c.c @@ -37,9 +37,11 @@ * ******************************************************************************/ +#include "drv_digital_out.h" +#include "drv_digital_in.h" #include "mikroe_dps310_i2c.h" +#include "mikroe_dps310_i2c_config.h" #include "pressure3.h" -#include "sl_status.h" /******************************************************************************** * static variables @@ -51,24 +53,29 @@ static pressure3_t ctx; /******************************************************************************** * public function *******************************************************************************/ -sl_status_t mikroe_pressure3_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_pressure3_init(mikroe_i2c_handle_t i2c_instance) { pressure3_cfg_t cfg; - if (i2cspm_instance == NULL) { + if (i2c_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } // Call basic setup functions pressure3_cfg_setup(&cfg); // Configure default i2csmp instance - ctx.i2c.handle = i2cspm_instance; + ctx.i2c.handle = i2c_instance; + +#if (MIKROE_DPS310_I2C_UC == 1) + cfg.i2c_speed = MIKROE_DPS310_I2C_SPEED_MODE; +#endif + if (PRESSURE3_OK != pressure3_init(&ctx, &cfg)) { - return SL_STATUS_FAIL; - } else { - pressure3_default_cfg(&ctx); - return SL_STATUS_OK; + return SL_STATUS_INITIALIZATION; } + + pressure3_default_cfg(&ctx); + return SL_STATUS_OK; } sl_status_t mikroe_pressure3_generic_write(uint8_t reg, diff --git a/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_spi.c b/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_spi.c index ba0b0fd1..5eedbb32 100644 --- a/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_spi.c +++ b/driver/public/mikroe/pressure3_dps310/src/mikroe_dps310_spi.c @@ -37,9 +37,10 @@ * ******************************************************************************/ +#include "sl_status.h" #include "mikroe_dps310_spi.h" +#include "mikroe_dps310_spi_config.h" #include "pressure3.h" -#include "sl_status.h" /******************************************************************************** * static variables @@ -51,7 +52,7 @@ static pressure3_t ctx; /******************************************************************************** * public function *******************************************************************************/ -sl_status_t mikroe_pressure3_init(SPIDRV_Handle_t spidrv_inst) +sl_status_t mikroe_pressure3_init(mikroe_spi_handle_t spidrv_inst) { pressure3_cfg_t cfg; @@ -61,16 +62,24 @@ sl_status_t mikroe_pressure3_init(SPIDRV_Handle_t spidrv_inst) // Call basic setup functions pressure3_cfg_setup(&cfg); - cfg.cs = hal_gpio_pin_name(spidrv_inst->portCs, spidrv_inst->pinCs); cfg.sel = PRESSURE3_MASTER_SPI; // Configure default i2csmp instance ctx.spi.handle = spidrv_inst; + +#if defined(DPS310_CS_PORT) && defined(DPS310_CS_PIN) + cfg.cs = hal_gpio_pin_name(DPS310_CS_PORT, DPS310_CS_PIN); +#endif + +#if (MIKROE_DPS310_SPI_UC == 1) + cfg.spi_speed = MIKROE_DPS310_SPI_BITRATE; +#endif + if (PRESSURE3_OK != pressure3_init(&ctx, &cfg)) { - return SL_STATUS_FAIL; - } else { - pressure3_default_cfg(&ctx); - return SL_STATUS_OK; + return SL_STATUS_INITIALIZATION; } + + pressure3_default_cfg(&ctx); + return SL_STATUS_OK; } sl_status_t mikroe_pressure3_generic_write(uint8_t reg, diff --git a/driver/public/mikroe/pwm_driver_si8711cc/inc/mikroe_si8711cc.h b/driver/public/mikroe/pwm_driver_si8711cc/inc/mikroe_si8711cc.h index 44b59197..24030672 100644 --- a/driver/public/mikroe/pwm_driver_si8711cc/inc/mikroe_si8711cc.h +++ b/driver/public/mikroe/pwm_driver_si8711cc/inc/mikroe_si8711cc.h @@ -4,7 +4,7 @@ * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -39,7 +39,7 @@ #ifndef MIKROE_SI8711CC_H_ #define MIKROE_SI8711CC_H_ #include "sl_status.h" -#include "sl_pwm.h" +#include "drv_pwm.h" #ifdef __cplusplus extern "C" { @@ -56,7 +56,7 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_si8711cc_init(sl_pwm_instance_t *pwm_instance); +sl_status_t mikroe_si8711cc_init(mikroe_pwm_handle_t pwm_instance); /***************************************************************************//** * @brief @@ -70,7 +70,7 @@ sl_status_t mikroe_si8711cc_init(sl_pwm_instance_t *pwm_instance); * SL_STATUS_INVALID_PARAMETER if pwm_instance is null. ******************************************************************************/ sl_status_t mikroe_si8711cc_set_pwm_instance( - sl_pwm_instance_t *pwm_instance); + mikroe_pwm_handle_t pwm_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/pwm_driver_si8711cc/src/mikroe_si8711cc.c b/driver/public/mikroe/pwm_driver_si8711cc/src/mikroe_si8711cc.c index 4b200084..e7898e32 100644 --- a/driver/public/mikroe/pwm_driver_si8711cc/src/mikroe_si8711cc.c +++ b/driver/public/mikroe/pwm_driver_si8711cc/src/mikroe_si8711cc.c @@ -4,7 +4,7 @@ * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -36,36 +36,35 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - #include +#include "stdbool.h" #include "mikroe_si8711cc.h" -#include "third_party_hw_drivers_helpers.h" #include "pwmdriver.h" static pwmdriver_t pwm_driver; static pwmdriver_cfg_t pwm_driver_cfg; -sl_status_t mikroe_si8711cc_init(sl_pwm_instance_t *pwm_instance) +sl_status_t mikroe_si8711cc_init(mikroe_pwm_handle_t pwm_instance) { if (NULL == pwm_instance) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - // Configure default i2csmp instance pwm_driver.pwm.handle = pwm_instance; // Call basic setup functions pwmdriver_cfg_setup(&pwm_driver_cfg); - THIRD_PARTY_HW_DRV_RETCODE_TEST(pwmdriver_init(&pwm_driver, - &pwm_driver_cfg)); + if (pwmdriver_init(&pwm_driver, &pwm_driver_cfg) != PWMDRIVER_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } -sl_status_t mikroe_si8711cc_set_pwm_instance(sl_pwm_instance_t *pwm_instance) +sl_status_t mikroe_si8711cc_set_pwm_instance( + mikroe_pwm_handle_t pwm_instance) { if (NULL == pwm_instance) { return SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/radar_mm5d91_00/config/brd2703a/mikroe_mm5d91_00_config.h b/driver/public/mikroe/radar_mm5d91_00/config/brd2703a/mikroe_mm5d91_00_config.h index 91548a7a..3111adce 100644 --- a/driver/public/mikroe/radar_mm5d91_00/config/brd2703a/mikroe_mm5d91_00_config.h +++ b/driver/public/mikroe/radar_mm5d91_00/config/brd2703a/mikroe_mm5d91_00_config.h @@ -26,11 +26,21 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * ******************************************************************************/ #ifndef MM5D91_00_CONFIG_H #define MM5D91_00_CONFIG_H +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { diff --git a/driver/public/mikroe/radar_mm5d91_00/config/brd4108a/mikroe_mm5d91_00_config.h b/driver/public/mikroe/radar_mm5d91_00/config/brd4108a/mikroe_mm5d91_00_config.h index 214111fa..3700a759 100644 --- a/driver/public/mikroe/radar_mm5d91_00/config/brd4108a/mikroe_mm5d91_00_config.h +++ b/driver/public/mikroe/radar_mm5d91_00/config/brd4108a/mikroe_mm5d91_00_config.h @@ -26,11 +26,21 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * ******************************************************************************/ #ifndef MM5D91_00_CONFIG_H #define MM5D91_00_CONFIG_H +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { diff --git a/driver/public/mikroe/radar_mm5d91_00/config/brd4314a/mikroe_mm5d91_00_config.h b/driver/public/mikroe/radar_mm5d91_00/config/brd4314a/mikroe_mm5d91_00_config.h index 214111fa..3700a759 100644 --- a/driver/public/mikroe/radar_mm5d91_00/config/brd4314a/mikroe_mm5d91_00_config.h +++ b/driver/public/mikroe/radar_mm5d91_00/config/brd4314a/mikroe_mm5d91_00_config.h @@ -26,11 +26,21 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * ******************************************************************************/ #ifndef MM5D91_00_CONFIG_H #define MM5D91_00_CONFIG_H +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { diff --git a/driver/public/mikroe/radar_mm5d91_00/config/brd4338a/mikroe_mm5d91_00_config.h b/driver/public/mikroe/radar_mm5d91_00/config/brd4338a/mikroe_mm5d91_00_config.h new file mode 100644 index 00000000..9ff65612 --- /dev/null +++ b/driver/public/mikroe/radar_mm5d91_00/config/brd4338a/mikroe_mm5d91_00_config.h @@ -0,0 +1,79 @@ +/***************************************************************************//** + * @file mikroe_mm5d91_00_config.h + * @brief SCL MM5D91_00 Configuration + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MM5D91_00_CONFIG_H +#define MM5D91_00_CONFIG_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< sl:start pin_tool >>> + +// CONFIG_MM5D91_00_RST +// $[GPIO_CONFIG_MM5D91_00_RST] +#define CONFIG_MM5D91_00_RST_PORT HP +#define CONFIG_MM5D91_00_RST_PIN 46 +// [GPIO_CONFIG_MM5D91_00_RST]$ + +// CONFIG_MM5D91_00_GPIO0 +// $[GPIO_CONFIG_MM5D91_00_GPIO0] +#define CONFIG_MM5D91_00_GPIO0_PORT HP +#define CONFIG_MM5D91_00_GPIO0_PIN 47 +// [GPIO_CONFIG_MM5D91_00_GPIO0]$ + +// CONFIG_MM5D91_00_GPIO1 +// $[GPIO_CONFIG_MM5D91_00_GPIO1] +#define CONFIG_MM5D91_00_GPIO1_PORT HP +#define CONFIG_MM5D91_00_GPIO1_PIN 48 +// [GPIO_CONFIG_MM5D91_00_GPIO1]$ + +// CONFIG_MM5D91_00_GPIO2 +// $[GPIO_CONFIG_MM5D91_00_GPIO2] +#define CONFIG_MM5D91_00_GPIO2_PORT HP +#define CONFIG_MM5D91_00_GPIO2_PIN 49 +// [GPIO_CONFIG_MM5D91_00_GPIO2]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // MM5D91_00_CONFIG_H diff --git a/driver/public/mikroe/radar_mm5d91_00/config/other/mikroe_mm5d91_00_config.h b/driver/public/mikroe/radar_mm5d91_00/config/other/mikroe_mm5d91_00_config.h index 59c85b62..86c662f7 100644 --- a/driver/public/mikroe/radar_mm5d91_00/config/other/mikroe_mm5d91_00_config.h +++ b/driver/public/mikroe/radar_mm5d91_00/config/other/mikroe_mm5d91_00_config.h @@ -26,11 +26,23 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * ******************************************************************************/ #ifndef MM5D91_00_CONFIG_H #define MM5D91_00_CONFIG_H +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { @@ -41,28 +53,28 @@ extern "C" // CONFIG_MM5D91_00_RST // $[GPIO_CONFIG_MM5D91_00_RST] #warning "RST pin for MM5D91_00 is not configured" -// #define CONFIG_MM5D91_00_RST_PORT gpioPortC -// #define CONFIG_MM5D91_00_RST_PIN 6 +// #define CONFIG_MM5D91_00_RST_PORT 0 +// #define CONFIG_MM5D91_00_RST_PIN 0 // [GPIO_CONFIG_MM5D91_00_RST]$ // CONFIG_MM5D91_00_GPIO0 // $[GPIO_CONFIG_MM5D91_00_GPIO0] #warning "GP0 pin for MM5D91_00 is not configured" -// #define CONFIG_MM5D91_00_GPIO0_PORT gpioPortB -// #define CONFIG_MM5D91_00_GPIO0_PIN 3 +// #define CONFIG_MM5D91_00_GPIO0_PORT 0 +// #define CONFIG_MM5D91_00_GPIO0_PIN 0 // [GPIO_CONFIG_MM5D91_00_GPIO0]$ // CONFIG_MM5D91_00_GPIO1 // $[GPIO_CONFIG_MM5D91_00_GPIO1] #warning "GP1 pin for MM5D91_00 is not configured" -// #define CONFIG_MM5D91_00_GPIO1_PORT gpioPortB -// #define CONFIG_MM5D91_00_GPIO1_PIN 4 +// #define CONFIG_MM5D91_00_GPIO1_PORT 0 +// #define CONFIG_MM5D91_00_GPIO1_PIN 0 // [GPIO_CONFIG_MM5D91_00_GPIO1]$ // CONFIG_MM5D91_00_GPIO2 // $[GPIO_CONFIG_MM5D91_00_GPIO2] #warning "GP2 pin for MM5D91_00 is not configured" -// #define CONFIG_MM5D91_00_GPIO2_PORT gpioPortB +// #define CONFIG_MM5D91_00_GPIO2_PORT 0 // #define CONFIG_MM5D91_00_GPIO2_PIN 0 // [GPIO_CONFIG_MM5D91_00_GPIO2]$ diff --git a/driver/public/mikroe/radar_mm5d91_00/inc/mikroe_mm5d91_00.h b/driver/public/mikroe/radar_mm5d91_00/inc/mikroe_mm5d91_00.h index b05f6f67..55ca6a0a 100644 --- a/driver/public/mikroe/radar_mm5d91_00/inc/mikroe_mm5d91_00.h +++ b/driver/public/mikroe/radar_mm5d91_00/inc/mikroe_mm5d91_00.h @@ -48,26 +48,28 @@ typedef radar_t mikroe_radar_t; /***************************************************************************//** * @brief Radar initialization function. * @details This function initializes all necessary pins and peripherals used - * for this click board. - * @param[out] ctx : Click context object. - * See #radar_t object definition for detailed explanation. - * @param[in] cfg : Click configuration structure. - * See #radar_cfg_t object definition for detailed explanation. + * for this click board. + * @param[in] handle : Click context object. * @return @li @c SL_STATUS_OK - Success, * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_usart_init (mikroe_radar_t *ctx, - sl_iostream_uart_t *stream, - uint32_t baud_rate); +sl_status_t mikroe_radar_init(mikroe_uart_handle_t handle); + +/***************************************************************************//** + * @brief This function sets the UART instance used by platform functions + * @param[in] handle: UART instance + * @return + * SL_STATUS_OK if there are no errors + * SL_STATUS_INVALID_PARAMETER if spi_instance is null + ******************************************************************************/ +sl_status_t mikroe_radar_set_uart_instance(mikroe_uart_handle_t handle); /***************************************************************************//** * @brief Radar data writing function. * @details This function writes a desired number of data bytes by using UART - * serial interface. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. + * serial interface. * @param[in] data_buf : Data buffer for sending. * @param[in] len : Number of bytes for sending. * @return @li @c >=0 - Success, @@ -75,16 +77,13 @@ sl_status_t mikroe_radar_usart_init (mikroe_radar_t *ctx, * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -int32_t mikroe_radar_generic_write (mikroe_radar_t *ctx, - uint8_t *data_buf, - uint16_t len); +int32_t mikroe_radar_generic_write(uint8_t *data_buf, + uint16_t len); /***************************************************************************//** * @brief Radar data reading function. * @details This function reads a desired number of data bytes by using UART - * serial interface. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. + * serial interface. * @param[out] data_buf : Output read data. * @param[in] max_len : Number of bytes to be read. * @return @li @c >0 - Number of data bytes read, @@ -92,77 +91,57 @@ int32_t mikroe_radar_generic_write (mikroe_radar_t *ctx, * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -int32_t mikroe_radar_generic_read(mikroe_radar_t *ctx, - uint8_t *data_buf, +int32_t mikroe_radar_generic_read(uint8_t *data_buf, uint16_t max_len); /***************************************************************************//** * @brief Radar enable device function. * @details This function enables the device by setting the RST pin to low logic - * state. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. - * @return @li @c SL_STATUS_OK - Success, - * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. - * @note None. + * state. ******************************************************************************/ -sl_status_t mikroe_radar_enable_device(mikroe_radar_t *ctx); +void mikroe_radar_enable_device(void); /***************************************************************************//** * @brief Radar disable device function. * @details This function disables the device by setting the RST pin to high - * logic state. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. - * @return @li @c SL_STATUS_OK - Success, - * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. - * @note None. + * logic state. ******************************************************************************/ -sl_status_t mikroe_radar_disable_device(mikroe_radar_t *ctx); +void mikroe_radar_disable_device(void); /***************************************************************************//** * @brief Radar get gpio 2 pin function. * @details This function returns the GPIO 2 (bootloader mode indication) pin - * logic state. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. + * logic state. * @return @li @c SL_STATUS_OK - Success, * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_get_gpio2_pin(mikroe_radar_t *ctx, uint8_t *gpio_val); +sl_status_t mikroe_radar_get_gpio2_pin(uint8_t *gpio_val); /***************************************************************************//** * @brief Radar get gpio 1 pin function. * @details This function returns the GPIO 1 (presence detected indication) pin - * logic state. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. + * logic state. * @return @li @c SL_STATUS_OK - Success, * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_get_gpio1_pin(mikroe_radar_t *ctx, uint8_t *gpio_val); +sl_status_t mikroe_radar_get_gpio1_pin(uint8_t *gpio_val); /***************************************************************************//** * @brief Radar get gpio 0 pin function. * @details This function returns the GPIO 0 (no presence indication) pin logic - * state. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. + * state. * @return @li @c SL_STATUS_OK - Success, * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_get_gpio0_pin(mikroe_radar_t *ctx, uint8_t *gpio_val); +sl_status_t mikroe_radar_get_gpio0_pin(uint8_t *gpio_val); /***************************************************************************//** * @brief Radar set command function. * @details This function sends a desired set command with payload to the module - * and - * waits for an ACK response. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. + * and waits for an ACK response. * @param[in] cmd_id : Set command ID. * @param[in] payload : Command payload content. * @param[in] payload_size : Command payload size in bytes. @@ -171,17 +150,14 @@ sl_status_t mikroe_radar_get_gpio0_pin(mikroe_radar_t *ctx, uint8_t *gpio_val); * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_set_command(mikroe_radar_t *ctx, - uint8_t cmd_id, +sl_status_t mikroe_radar_set_command(uint8_t cmd_id, uint8_t *payload, uint8_t payload_size); /***************************************************************************//** * @brief Radar get command function. * @details This function sends a desired get command to the module and waits - * for a response. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. + * for a response. * @param[in] cmd_id : Get command ID. * @param[out] payload : Command payload content. * @param[out] payload_size : Command payload size in bytes. @@ -190,16 +166,13 @@ sl_status_t mikroe_radar_set_command(mikroe_radar_t *ctx, * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_get_command(mikroe_radar_t *ctx, - uint8_t cmd_id, +sl_status_t mikroe_radar_get_command(uint8_t cmd_id, uint8_t *payload, uint8_t *payload_size); /***************************************************************************//** * @brief Radar get event function. * @details This function waits for an IN/OUT event or ACK command response. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. * @param[out] evt_id : Event ID. * @param[out] payload : Event payload content. * @param[out] payload_size : Event payload size in bytes. @@ -208,30 +181,24 @@ sl_status_t mikroe_radar_get_command(mikroe_radar_t *ctx, * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_get_event(mikroe_radar_t *ctx, - uint8_t *evt_id, +sl_status_t mikroe_radar_get_event(uint8_t *evt_id, uint8_t *payload, uint8_t *payload_size); /***************************************************************************//** * @brief Radar get temperature function. * @details This function reads the chip internal temperature. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. * @param[out] temperature : Chip internal temperature in Celsius. * @return @li @c SL_STATUS_OK - Success, * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_get_temperature(mikroe_radar_t *ctx, - float *temperature); +sl_status_t mikroe_radar_get_temperature(float *temperature); /***************************************************************************//** * @brief Radar set detection range function. * @details This function sets the min and max presence detection values. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. * @param[in] min : Minimal detection level in meters [0.0 - 10.0]. * @param[in] max : Maximal detection level in meters [0.2 - 10.0] (Must be >= * min). @@ -240,22 +207,19 @@ sl_status_t mikroe_radar_get_temperature(mikroe_radar_t *ctx, * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_set_detection_range(mikroe_radar_t *ctx, - float min, +sl_status_t mikroe_radar_set_detection_range(float min, float max); /***************************************************************************//** * @brief Radar reset config function. * @details This function resets all configuration to default and performs a * system reset. - * @param[in] ctx : Click context object. - * See #radar_t object definition for detailed explanation. * @return @li @c SL_STATUS_OK - Success, * @li @c SL_STATUS_INVALID_PARAMETER - Invalid parameter. * See #err_t definition for detailed explanation. * @note None. ******************************************************************************/ -sl_status_t mikroe_radar_reset_config(mikroe_radar_t *ctx); +sl_status_t mikroe_radar_reset_config(void); /***************************************************************************//** * @brief Radar float ieee to mchip function. diff --git a/driver/public/mikroe/radar_mm5d91_00/src/mikroe_mm5d91_00.c b/driver/public/mikroe/radar_mm5d91_00/src/mikroe_mm5d91_00.c index b847cc03..2dde0b26 100644 --- a/driver/public/mikroe/radar_mm5d91_00/src/mikroe_mm5d91_00.c +++ b/driver/public/mikroe/radar_mm5d91_00/src/mikroe_mm5d91_00.c @@ -40,20 +40,23 @@ #include "mikroe_mm5d91_00.h" #include "mikroe_mm5d91_00_config.h" -sl_status_t mikroe_radar_usart_init(mikroe_radar_t *ctx, - sl_iostream_uart_t *stream, - uint32_t baud_rate) -{ - radar_cfg_t cfg; - err_t retval; +static mikroe_radar_t mikroe_radar; +static radar_cfg_t cfg; +static bool initialized = false; - if (!ctx || !stream) { - return SL_STATUS_INVALID_PARAMETER; +sl_status_t mikroe_radar_init(mikroe_uart_handle_t handle) +{ + if (handle == NULL) { + return SL_STATUS_NULL_POINTER; } + mikroe_radar.uart.handle = handle; + radar_cfg_setup(&cfg); +#if defined(CONFIG_MM5D91_00_RST_PORT) && defined(CONFIG_MM5D91_00_RST_PIN) cfg.rst = hal_gpio_pin_name(CONFIG_MM5D91_00_RST_PORT, CONFIG_MM5D91_00_RST_PIN); +#endif #if defined(CONFIG_MM5D91_00_GPIO0_PORT) && defined(CONFIG_MM5D91_00_GPIO0_PIN) cfg.gp0 = hal_gpio_pin_name(CONFIG_MM5D91_00_GPIO0_PORT, CONFIG_MM5D91_00_GPIO0_PIN); @@ -66,161 +69,134 @@ sl_status_t mikroe_radar_usart_init(mikroe_radar_t *ctx, cfg.gp2 = hal_gpio_pin_name(CONFIG_MM5D91_00_GPIO2_PORT, CONFIG_MM5D91_00_GPIO2_PIN); #endif - if (baud_rate > 0) { - cfg.baud_rate = baud_rate; + + if (radar_init(&mikroe_radar, &cfg) != RADAR_OK) { + return SL_STATUS_INITIALIZATION; } - ctx->uart.handle = stream; - retval = radar_init(ctx, &cfg); - if (UART_SUCCESS == retval) { - retval = radar_default_cfg(ctx); + if (radar_default_cfg(&mikroe_radar) != RADAR_OK) { + return SL_STATUS_INITIALIZATION; } - return RADAR_OK == retval ? SL_STATUS_OK : SL_STATUS_FAIL; + + initialized = true; + return SL_STATUS_OK; } -int32_t mikroe_radar_generic_write(mikroe_radar_t *ctx, - uint8_t *data_buf, - uint16_t len) +sl_status_t mikroe_radar_set_uart_instance(mikroe_uart_handle_t handle) { - if (!ctx || !data_buf || (len == 0)) { - return SL_STATUS_INVALID_PARAMETER; + if (!initialized) { + return SL_STATUS_NOT_INITIALIZED; + } + + if (NULL == handle) { + return SL_STATUS_NULL_POINTER; } - return (int32_t)radar_generic_write(ctx, data_buf, len); + mikroe_radar.uart.handle = handle; + + return SL_STATUS_OK; } -int32_t mikroe_radar_generic_read(mikroe_radar_t *ctx, - uint8_t *data_buf, - uint16_t max_len) +int32_t mikroe_radar_generic_write(uint8_t *data_buf, + uint16_t len) { - if (!ctx || !data_buf || (max_len == 0)) { + if ((data_buf == NULL) || (len == 0)) { return SL_STATUS_INVALID_PARAMETER; } - return (int32_t)radar_generic_read(ctx, data_buf, max_len); + return (int32_t)radar_generic_write(&mikroe_radar, data_buf, len); } -sl_status_t mikroe_radar_enable_device(mikroe_radar_t *ctx) +int32_t mikroe_radar_generic_read(uint8_t *data_buf, + uint16_t max_len) { - if (!ctx) { + if ((data_buf == NULL) || (max_len == 0)) { return SL_STATUS_INVALID_PARAMETER; } - radar_enable_device(ctx); - return SL_STATUS_OK; + return (int32_t)radar_generic_read(&mikroe_radar, data_buf, max_len); } -sl_status_t mikroe_radar_disable_device(mikroe_radar_t *ctx) +void mikroe_radar_enable_device(void) { - if (!ctx) { - return SL_STATUS_INVALID_PARAMETER; - } + radar_enable_device(&mikroe_radar); +} - radar_disable_device(ctx); - return SL_STATUS_OK; +void mikroe_radar_disable_device(void) +{ + radar_disable_device(&mikroe_radar); } -sl_status_t mikroe_radar_get_gpio2_pin(mikroe_radar_t *ctx, uint8_t *gpio_val) +sl_status_t mikroe_radar_get_gpio2_pin(uint8_t *gpio_val) { - if (!ctx || !gpio_val) { - return SL_STATUS_INVALID_PARAMETER; + if (gpio_val == NULL) { + return SL_STATUS_NULL_POINTER; } - *gpio_val = radar_get_gpio2_pin(ctx); + *gpio_val = radar_get_gpio2_pin(&mikroe_radar); return SL_STATUS_OK; } -sl_status_t mikroe_radar_get_gpio1_pin(mikroe_radar_t *ctx, uint8_t *gpio_val) +sl_status_t mikroe_radar_get_gpio1_pin(uint8_t *gpio_val) { - if (!ctx || !gpio_val) { - return SL_STATUS_INVALID_PARAMETER; + if (gpio_val == NULL) { + return SL_STATUS_NULL_POINTER; } - *gpio_val = radar_get_gpio1_pin(ctx); + *gpio_val = radar_get_gpio1_pin(&mikroe_radar); return SL_STATUS_OK; } -sl_status_t mikroe_radar_get_gpio0_pin(mikroe_radar_t *ctx, uint8_t *gpio_val) +sl_status_t mikroe_radar_get_gpio0_pin(uint8_t *gpio_val) { - if (!ctx || !gpio_val) { - return SL_STATUS_INVALID_PARAMETER; + if (gpio_val == NULL) { + return SL_STATUS_NULL_POINTER; } - *gpio_val = radar_get_gpio0_pin(ctx); + *gpio_val = radar_get_gpio0_pin(&mikroe_radar); return SL_STATUS_OK; } -sl_status_t mikroe_radar_set_command(mikroe_radar_t *ctx, - uint8_t cmd_id, +sl_status_t mikroe_radar_set_command(uint8_t cmd_id, uint8_t *payload, uint8_t payload_size) { - if (!ctx) { - return SL_STATUS_INVALID_PARAMETER; - } - - return (RADAR_OK == radar_set_command(ctx, cmd_id, payload, payload_size)) - ? SL_STATUS_OK : SL_STATUS_FAIL; + return (radar_set_command(&mikroe_radar, cmd_id, payload, payload_size) + == RADAR_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; } -sl_status_t mikroe_radar_get_command(mikroe_radar_t *ctx, - uint8_t cmd_id, +sl_status_t mikroe_radar_get_command(uint8_t cmd_id, uint8_t *payload, uint8_t *payload_size) { - if (!ctx) { - return SL_STATUS_INVALID_PARAMETER; - } - - return RADAR_OK - == radar_get_command(ctx, cmd_id, payload, - payload_size) ? SL_STATUS_OK : SL_STATUS_FAIL; + return (radar_get_command(&mikroe_radar, cmd_id, payload, payload_size) + == RADAR_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; } -sl_status_t mikroe_radar_get_event(mikroe_radar_t *ctx, - uint8_t *evt_id, +sl_status_t mikroe_radar_get_event(uint8_t *evt_id, uint8_t *payload, uint8_t *payload_size) { - if (!ctx) { - return SL_STATUS_INVALID_PARAMETER; - } - - return RADAR_OK - == radar_get_event(ctx, evt_id, payload, - payload_size) ? SL_STATUS_OK : SL_STATUS_FAIL; + return (radar_get_event(&mikroe_radar, evt_id, payload, payload_size) + == RADAR_OK) ? SL_STATUS_OK : SL_STATUS_FAIL; } -sl_status_t mikroe_radar_get_temperature(mikroe_radar_t *ctx, - float *temperature) +sl_status_t mikroe_radar_get_temperature(float *temperature) { - if (!ctx || !temperature) { - return SL_STATUS_INVALID_PARAMETER; - } - - return (RADAR_OK == radar_get_temperature(ctx, temperature)) + return (RADAR_OK == radar_get_temperature(&mikroe_radar, temperature)) ? SL_STATUS_OK : SL_STATUS_FAIL; } -sl_status_t mikroe_radar_set_detection_range(mikroe_radar_t *ctx, - float min, +sl_status_t mikroe_radar_set_detection_range(float min, float max) { - if (!ctx) { - return SL_STATUS_INVALID_PARAMETER; - } - - return (RADAR_OK == radar_set_detection_range(ctx, min, max)) + return (RADAR_OK == radar_set_detection_range(&mikroe_radar, min, max)) ? SL_STATUS_OK : SL_STATUS_FAIL; } -sl_status_t mikroe_radar_reset_config(mikroe_radar_t *ctx) +sl_status_t mikroe_radar_reset_config(void) { - if (!ctx) { - return SL_STATUS_INVALID_PARAMETER; - } - - return (RADAR_OK == radar_reset_config(ctx)) + return (RADAR_OK == radar_reset_config(&mikroe_radar)) ? SL_STATUS_OK : SL_STATUS_FAIL; } diff --git a/driver/public/mikroe/relay2_lca717/config/brd2703a/mikroe_relay2_config.h b/driver/public/mikroe/relay2_lca717/config/brd2703a/mikroe_relay2_config.h index 7251956d..4f42c239 100644 --- a/driver/public/mikroe/relay2_lca717/config/brd2703a/mikroe_relay2_config.h +++ b/driver/public/mikroe/relay2_lca717/config/brd2703a/mikroe_relay2_config.h @@ -40,6 +40,8 @@ #ifndef SCL_RELAY2_CONFIG_H_ #define SCL_RELAY2_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/relay2_lca717/config/brd4108a/mikroe_relay2_config.h b/driver/public/mikroe/relay2_lca717/config/brd4108a/mikroe_relay2_config.h index 88f52669..005b3aae 100644 --- a/driver/public/mikroe/relay2_lca717/config/brd4108a/mikroe_relay2_config.h +++ b/driver/public/mikroe/relay2_lca717/config/brd4108a/mikroe_relay2_config.h @@ -40,6 +40,8 @@ #ifndef SCL_RELAY2_CONFIG_H_ #define SCL_RELAY2_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/relay2_lca717/config/brd4314a/mikroe_relay2_config.h b/driver/public/mikroe/relay2_lca717/config/brd4314a/mikroe_relay2_config.h index 88f52669..005b3aae 100644 --- a/driver/public/mikroe/relay2_lca717/config/brd4314a/mikroe_relay2_config.h +++ b/driver/public/mikroe/relay2_lca717/config/brd4314a/mikroe_relay2_config.h @@ -40,6 +40,8 @@ #ifndef SCL_RELAY2_CONFIG_H_ #define SCL_RELAY2_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/relay2_lca717/config/brd4338a/mikroe_relay2_config.h b/driver/public/mikroe/relay2_lca717/config/brd4338a/mikroe_relay2_config.h new file mode 100644 index 00000000..0d96da16 --- /dev/null +++ b/driver/public/mikroe/relay2_lca717/config/brd4338a/mikroe_relay2_config.h @@ -0,0 +1,67 @@ +/***************************************************************************//** + * @file mikroe_relay2_config.h + * @brief SCL Relay2 Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SCL_RELAY2_CONFIG_H_ +#define SCL_RELAY2_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< sl:start pin_tool >>> + +// RELAY2_RL1 +// $[GPIO_RELAY2_RL1] +#define RELAY2_RL1_PORT HP +#define RELAY2_RL1_PIN 46 +// [GPIO_RELAY2_RL1]$ + +// RELAY2_RL2 +// $[GPIO_RELAY2_RL2] +#define RELAY2_RL2_PORT HP +#define RELAY2_RL2_PIN 47 +// [GPIO_RELAY2_RL2]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* SCL_RELAY2_CONFIG_H_ */ diff --git a/driver/public/mikroe/relay2_lca717/config/other/mikroe_relay2_config.h b/driver/public/mikroe/relay2_lca717/config/other/mikroe_relay2_config.h index c6627b63..7062d11f 100644 --- a/driver/public/mikroe/relay2_lca717/config/other/mikroe_relay2_config.h +++ b/driver/public/mikroe/relay2_lca717/config/other/mikroe_relay2_config.h @@ -40,6 +40,10 @@ #ifndef SCL_RELAY2_CONFIG_H_ #define SCL_RELAY2_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/driver/public/mikroe/relay2_lca717/src/mikroe_relay2.c b/driver/public/mikroe/relay2_lca717/src/mikroe_relay2.c index 8220eecf..4eb1ca2f 100644 --- a/driver/public/mikroe/relay2_lca717/src/mikroe_relay2.c +++ b/driver/public/mikroe/relay2_lca717/src/mikroe_relay2.c @@ -37,35 +37,31 @@ * ******************************************************************************/ -#include "em_gpio.h" +#include #include "relay2.h" #include "mikroe_relay2.h" #include "mikroe_relay2_config.h" -#include "third_party_hw_drivers_helpers.h" static relay2_t relay2; static relay2_cfg_t relay2_cfg; sl_status_t mikroe_relay2_init(void) { - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - relay2_cfg_setup(&relay2_cfg); + #if defined(RELAY2_RL1_PORT) && defined(RELAY2_RL1_PIN) relay2_cfg.an = hal_gpio_pin_name(RELAY2_RL1_PORT, RELAY2_RL1_PIN); -#else - relay2_cfg.an = hal_gpio_pin_name(gpioPortB, 4); #endif #if defined(RELAY2_RL2_PORT) && defined(RELAY2_RL2_PIN) relay2_cfg.pwm = hal_gpio_pin_name(RELAY2_RL2_PORT, RELAY2_RL2_PIN); -#else - relay2_cfg.pwm = hal_gpio_pin_name(gpioPortB, 0); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(relay2_init(&relay2, &relay2_cfg)); + if (relay2_init(&relay2, &relay2_cfg) != RELAY2_OK) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } void mikroe_relay2_relay1_control(uint8_t pin_state) diff --git a/driver/public/mikroe/rf_meter_ad8318/config/mikroe_ad8318_config.h b/driver/public/mikroe/rf_meter_ad8318/config/mikroe_ad8318_config.h new file mode 100644 index 00000000..f5a21069 --- /dev/null +++ b/driver/public/mikroe/rf_meter_ad8318/config/mikroe_ad8318_config.h @@ -0,0 +1,81 @@ +/***************************************************************************//** + * @file mikroe_ad8318_config.h + * @brief mikroe ad8318 config + * @version 0.0.1 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef AD8318_CONFIG_H_ +#define AD8318_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_AD8318 SPI Configuration + +// MIKROE_AD8318 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_AD8318_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 1000000 +#define MIKROE_AD8318_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_AD8318_CS +// $[GPIO_MIKROE_AD8318_CS] +// #define MIKROE_AD8318_CS_PORT 0 +// #define MIKROE_AD8318_CS_PIN 0 +// [GPIO_MIKROE_AD8318_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // AD8318_CONFIG_H_ diff --git a/driver/public/mikroe/rf_meter_ad8318/inc/mikroe_ad8318.h b/driver/public/mikroe/rf_meter_ad8318/inc/mikroe_ad8318.h index 97b29fda..ce6bc68b 100644 --- a/driver/public/mikroe/rf_meter_ad8318/inc/mikroe_ad8318.h +++ b/driver/public/mikroe/rf_meter_ad8318/inc/mikroe_ad8318.h @@ -41,7 +41,7 @@ #define MIKROE_AD8318_H_ #include "sl_status.h" -#include "spidrv.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -78,7 +78,7 @@ void mikroe_ad8318_cfg_setup(void); * @description This function initializes all necessary pins and peripherals * used for this click. */ -sl_status_t mikroe_ad8318_set_spi_instance(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_ad8318_set_spi_instance(mikroe_spi_handle_t spi_instance); /** * @brief Initialization function. @@ -87,7 +87,7 @@ sl_status_t mikroe_ad8318_set_spi_instance(SPIDRV_Handle_t spi_instance); * @description This function initializes all necessary pins and peripherals * used for this click. */ -sl_status_t mikroe_ad8318_init(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_ad8318_init(mikroe_spi_handle_t spi_instance); /** * @brief Data read function diff --git a/driver/public/mikroe/rf_meter_ad8318/src/mikroe_ad8318.c b/driver/public/mikroe/rf_meter_ad8318/src/mikroe_ad8318.c index 0dde69c1..9cc67ca4 100644 --- a/driver/public/mikroe/rf_meter_ad8318/src/mikroe_ad8318.c +++ b/driver/public/mikroe/rf_meter_ad8318/src/mikroe_ad8318.c @@ -36,10 +36,9 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - #include "mikroe_ad8318.h" -#include "third_party_hw_drivers_helpers.h" #include "rfmeter.h" +#include "mikroe_ad8318_config.h" static rfmeter_t rf_meter; static rfmeter_cfg_t rf_meter_cfg; @@ -49,7 +48,7 @@ void mikroe_ad8318_cfg_setup(void) rfmeter_cfg_setup(&rf_meter_cfg); } -sl_status_t mikroe_ad8318_set_spi_instance(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_ad8318_set_spi_instance(mikroe_spi_handle_t spi_instance) { if (NULL == spi_instance) { return SL_STATUS_INVALID_PARAMETER; @@ -60,23 +59,30 @@ sl_status_t mikroe_ad8318_set_spi_instance(SPIDRV_Handle_t spi_instance) return SL_STATUS_OK; } -sl_status_t mikroe_ad8318_init(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_ad8318_init(mikroe_spi_handle_t spi_instance) { if (NULL == spi_instance) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - rfmeter_cfg_setup(&rf_meter_cfg); +#if (MIKROE_AD8318_SPI_UC == 1) + rf_meter_cfg.spi_speed = MIKROE_AD8318_SPI_BITRATE; +#endif + rf_meter.spi.handle = spi_instance; - rf_meter_cfg.cs = hal_gpio_pin_name(spi_instance->portCs, - spi_instance->pinCs); - THIRD_PARTY_HW_DRV_RETCODE_TEST(rfmeter_init(&rf_meter, &rf_meter_cfg)); +#if defined(MIKROE_AD8318_CS_PORT) && defined(MIKROE_AD8318_CS_PIN) + rf_meter_cfg.cs = hal_gpio_pin_name(MIKROE_AD8318_CS_PORT, + MIKROE_AD8318_CS_PIN); +#endif + + if (rfmeter_init(&rf_meter, &rf_meter_cfg) == RFMETER_OK) { + return SL_STATUS_OK; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_INITIALIZATION; } sl_status_t mikroe_ad8318_read_data(uint16_t *read_data) diff --git a/driver/public/mikroe/rng/config/mikroe_rng_config.h b/driver/public/mikroe/rng/config/mikroe_rng_config.h new file mode 100644 index 00000000..56b6827c --- /dev/null +++ b/driver/public/mikroe/rng/config/mikroe_rng_config.h @@ -0,0 +1,82 @@ +/***************************************************************************/ /** + * @file mikroe_rng_config.h + * @brief Mikroe RNG configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_RNG_CONFIG_H +#define MIKROE_RNG_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE I2C RNG Configuration + +// MIKROE I2C RNG UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_I2C_RNG_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_I2C_RNG_SPEED_MODE 0 + +// +// + +// I2C Setting + +// RNG Address +// <0x48=> RNG_DEVICE_SLAVE_ADDRESS_GND +// <0x49=> RNG_DEVICE_SLAVE_ADDRESS_VDD +// <0x4A=> RNG_DEVICE_SLAVE_ADDRESS_SDA +// <0x4B=> RNG_DEVICE_SLAVE_ADDRESS_SDL +#define RNG_DEVICE_SLAVE_ADDRESS 0x48 + +// + +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_RNG_CONFIG_H diff --git a/driver/public/mikroe/rng/inc/mikroe_rng.h b/driver/public/mikroe/rng/inc/mikroe_rng.h index 25d61259..4cb1e9a8 100644 --- a/driver/public/mikroe/rng/inc/mikroe_rng.h +++ b/driver/public/mikroe/rng/inc/mikroe_rng.h @@ -38,9 +38,10 @@ ******************************************************************************/ #ifndef MIKROE_RNG_H_ #define MIKROE_RNG_H_ + #include "sl_status.h" -#include "sl_i2cspm.h" #include "rng.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -117,7 +118,7 @@ extern "C" { * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_rng_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_rng_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -130,7 +131,7 @@ sl_status_t mikroe_rng_init(sl_i2cspm_t *i2cspm_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_rng_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_rng_set_i2csmp_instance(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -222,4 +223,4 @@ void mikroe_rng_set_threshold (uint8_t thresh_reg, } #endif -#endif /* MIKROE_RNG_H_ */ +#endif // MIKROE_RNG_H_ diff --git a/driver/public/mikroe/rng/src/mikroe_rng.c b/driver/public/mikroe/rng/src/mikroe_rng.c index 0f9248b1..fffe05cc 100644 --- a/driver/public/mikroe/rng/src/mikroe_rng.c +++ b/driver/public/mikroe/rng/src/mikroe_rng.c @@ -37,29 +37,33 @@ * ******************************************************************************/ #include "mikroe_rng.h" +#include "mikroe_rng_config.h" #include "rng.h" static rng_t rng; static rng_cfg_t rng_cfg; -sl_status_t mikroe_rng_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_rng_init(mikroe_i2c_handle_t i2cspm_instance) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; + if (NULL == i2cspm_instance) { + return SL_STATUS_INVALID_PARAMETER; + } - if (NULL != i2cspm_instance) { - rng.i2c.handle = i2cspm_instance; - rng_cfg_setup(&rng_cfg); + rng.i2c.handle = i2cspm_instance; + rng_cfg_setup(&rng_cfg); + rng_cfg.i2c_address = RNG_DEVICE_SLAVE_ADDRESS; + +#if (MIKROE_I2C_RNG_UC == 1) + rng_cfg.i2c_speed = MIKROE_I2C_RNG_SPEED_MODE; +#endif - if (I2C_MASTER_SUCCESS == rng_init(&rng, &rng_cfg)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } + if (RNG_OK != rng_init(&rng, &rng_cfg)) { + return SL_STATUS_INITIALIZATION; } - return stt; + return SL_STATUS_OK; } -sl_status_t mikroe_rng_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_rng_set_i2csmp_instance(mikroe_i2c_handle_t i2cspm_instance) { sl_status_t stt = SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/rtc10_ds3231m/config/brd2703a/mikroe_ds3231m_config.h b/driver/public/mikroe/rtc10_ds3231m/config/brd2703a/mikroe_ds3231m_config.h index 231d4883..0ca7131a 100644 --- a/driver/public/mikroe/rtc10_ds3231m/config/brd2703a/mikroe_ds3231m_config.h +++ b/driver/public/mikroe/rtc10_ds3231m/config/brd2703a/mikroe_ds3231m_config.h @@ -42,6 +42,27 @@ #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE DS3231M I2C Configuration + +// MIKROE DS3231M I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DS3231M_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DS3231M_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // MIKROE_DS3231M_INT @@ -64,4 +85,4 @@ // <<< sl:end pin_tool >>> -#endif /* MIKROE_DS3231M_CONFIG_H_ */ +#endif // MIKROE_DS3231M_CONFIG_H_ diff --git a/driver/public/mikroe/rtc10_ds3231m/config/brd4108a/mikroe_ds3231m_config.h b/driver/public/mikroe/rtc10_ds3231m/config/brd4108a/mikroe_ds3231m_config.h index 2eb4a5dd..71a6d842 100644 --- a/driver/public/mikroe/rtc10_ds3231m/config/brd4108a/mikroe_ds3231m_config.h +++ b/driver/public/mikroe/rtc10_ds3231m/config/brd4108a/mikroe_ds3231m_config.h @@ -42,26 +42,47 @@ #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE DS3231M I2C Configuration + +// MIKROE DS3231M I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DS3231M_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DS3231M_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // MIKROE_DS3231M_INT // $[GPIO_MIKROE_DS3231M_INT] -#define MIKROE_DS3231M_INT_PORT gpioPortB -#define MIKROE_DS3231M_INT_PIN 3 +#define MIKROE_DS3231M_INT_PORT gpioPortB +#define MIKROE_DS3231M_INT_PIN 3 // [GPIO_MIKROE_DS3231M_INT]$ // MIKROE_DS3231M_AN // $[GPIO_MIKROE_DS3231M_AN] -#define MIKROE_DS3231M_AN_PORT gpioPortB -#define MIKROE_DS3231M_AN_PIN 0 +#define MIKROE_DS3231M_AN_PORT gpioPortB +#define MIKROE_DS3231M_AN_PIN 0 // [GPIO_MIKROE_DS3231M_AN]$ // MIKROE_DS3231M_RST // $[GPIO_MIKROE_DS3231M_RST] -#define MIKROE_DS3231M_RST_PORT gpioPortC -#define MIKROE_DS3231M_RST_PIN 6 +#define MIKROE_DS3231M_RST_PORT gpioPortC +#define MIKROE_DS3231M_RST_PIN 6 // [GPIO_MIKROE_DS3231M_RST]$ // <<< sl:end pin_tool >>> -#endif /* MIKROE_DS3231M_CONFIG_H_ */ +#endif // MIKROE_DS3231M_CONFIG_H_ diff --git a/driver/public/mikroe/rtc10_ds3231m/config/brd4314a/mikroe_ds3231m_config.h b/driver/public/mikroe/rtc10_ds3231m/config/brd4314a/mikroe_ds3231m_config.h index 2eb4a5dd..71a6d842 100644 --- a/driver/public/mikroe/rtc10_ds3231m/config/brd4314a/mikroe_ds3231m_config.h +++ b/driver/public/mikroe/rtc10_ds3231m/config/brd4314a/mikroe_ds3231m_config.h @@ -42,26 +42,47 @@ #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE DS3231M I2C Configuration + +// MIKROE DS3231M I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DS3231M_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DS3231M_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // MIKROE_DS3231M_INT // $[GPIO_MIKROE_DS3231M_INT] -#define MIKROE_DS3231M_INT_PORT gpioPortB -#define MIKROE_DS3231M_INT_PIN 3 +#define MIKROE_DS3231M_INT_PORT gpioPortB +#define MIKROE_DS3231M_INT_PIN 3 // [GPIO_MIKROE_DS3231M_INT]$ // MIKROE_DS3231M_AN // $[GPIO_MIKROE_DS3231M_AN] -#define MIKROE_DS3231M_AN_PORT gpioPortB -#define MIKROE_DS3231M_AN_PIN 0 +#define MIKROE_DS3231M_AN_PORT gpioPortB +#define MIKROE_DS3231M_AN_PIN 0 // [GPIO_MIKROE_DS3231M_AN]$ // MIKROE_DS3231M_RST // $[GPIO_MIKROE_DS3231M_RST] -#define MIKROE_DS3231M_RST_PORT gpioPortC -#define MIKROE_DS3231M_RST_PIN 6 +#define MIKROE_DS3231M_RST_PORT gpioPortC +#define MIKROE_DS3231M_RST_PIN 6 // [GPIO_MIKROE_DS3231M_RST]$ // <<< sl:end pin_tool >>> -#endif /* MIKROE_DS3231M_CONFIG_H_ */ +#endif // MIKROE_DS3231M_CONFIG_H_ diff --git a/driver/public/mikroe/rtc10_ds3231m/config/brd4338a/mikroe_ds3231m_config.h b/driver/public/mikroe/rtc10_ds3231m/config/brd4338a/mikroe_ds3231m_config.h new file mode 100644 index 00000000..5ea4b692 --- /dev/null +++ b/driver/public/mikroe/rtc10_ds3231m/config/brd4338a/mikroe_ds3231m_config.h @@ -0,0 +1,86 @@ +/***************************************************************************//** + * @file mikroe_ds3231m_config.h + * @brief RTC10 Click Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_DS3231M_CONFIG_H_ +#define MIKROE_DS3231M_CONFIG_H_ + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE DS3231M I2C Configuration + +// MIKROE DS3231M I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DS3231M_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DS3231M_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_DS3231M_INT +// $[GPIO_MIKROE_DS3231M_INT] +#define MIKROE_DS3231M_INT_PORT HP +#define MIKROE_DS3231M_INT_PIN 48 +// [GPIO_MIKROE_DS3231M_INT]$ + +// MIKROE_DS3231M_AN +// $[GPIO_MIKROE_DS3231M_AN] +#define MIKROE_DS3231M_AN_PORT HP +#define MIKROE_DS3231M_AN_PIN 47 +// [GPIO_MIKROE_DS3231M_AN]$ + +// MIKROE_DS3231M_RST +// $[GPIO_MIKROE_DS3231M_RST] +#define MIKROE_DS3231M_RST_PORT HP +#define MIKROE_DS3231M_RST_PIN 46 +// [GPIO_MIKROE_DS3231M_RST]$ + +// <<< sl:end pin_tool >>> + +#endif // MIKROE_DS3231M_CONFIG_H_ diff --git a/driver/public/mikroe/rtc10_ds3231m/config/other/mikroe_ds3231m_config.h b/driver/public/mikroe/rtc10_ds3231m/config/other/mikroe_ds3231m_config.h index a45849bd..9056e013 100644 --- a/driver/public/mikroe/rtc10_ds3231m/config/other/mikroe_ds3231m_config.h +++ b/driver/public/mikroe/rtc10_ds3231m/config/other/mikroe_ds3231m_config.h @@ -40,31 +40,54 @@ #ifndef MIKROE_DS3231M_CONFIG_H_ #define MIKROE_DS3231M_CONFIG_H_ +#ifndef SLI_SI917 #include "em_gpio.h" +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE DS3231M I2C Configuration + +// MIKROE DS3231M I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_DS3231M_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_DS3231M_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> // <<< sl:start pin_tool >>> // MIKROE_DS3231M_INT // $[GPIO_MIKROE_DS3231M_INT] #warning "MIKROE_DS3231M_INT is not configured" -// #define MIKROE_DS3231M_INT_PORT gpioPortB -// #define MIKROE_DS3231M_INT_PIN 3 +// #define MIKROE_DS3231M_INT_PORT gpioPortB +// #define MIKROE_DS3231M_INT_PIN 3 // [GPIO_MIKROE_DS3231M_INT]$ // MIKROE_DS3231M_AN // $[GPIO_MIKROE_DS3231M_AN] #warning "MIKROE_DS3231M_AN is not configured" -// #define MIKROE_DS3231M_AN gpioPortB -// #define MIKROE_DS3231M_AN 3 +// #define MIKROE_DS3231M_AN gpioPortB +// #define MIKROE_DS3231M_AN 3 // [GPIO_MIKROE_DS3231M_AN]$ // MIKROE_DS3231M_RST // $[GPIO_MIKROE_DS3231M_RST] #warning "MIKROE_DS3231M_RST is not configured" -// #define MIKROE_DS3231M_RST_PORT gpioPortB -// #define MIKROE_DS3231M_RST_PIN 3 +// #define MIKROE_DS3231M_RST_PORT gpioPortB +// #define MIKROE_DS3231M_RST_PIN 3 // [GPIO_MIKROE_DS3231M_RST]$ // <<< sl:end pin_tool >>> -#endif /* MIKROE_DS3231M_CONFIG_H_ */ +#endif // MIKROE_DS3231M_CONFIG_H_ diff --git a/driver/public/mikroe/rtc10_ds3231m/inc/mikroe_ds3231m.h b/driver/public/mikroe/rtc10_ds3231m/inc/mikroe_ds3231m.h index 81f3ac4a..bf82f6b9 100644 --- a/driver/public/mikroe/rtc10_ds3231m/inc/mikroe_ds3231m.h +++ b/driver/public/mikroe/rtc10_ds3231m/inc/mikroe_ds3231m.h @@ -40,10 +40,9 @@ #ifndef MIKROE_DS3231M_H_ #define MIKROE_DS3231M_H_ -#include "rtc10.h" -#include "third_party_hw_drivers_helpers.h" #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" +#include "rtc10.h" #ifdef __cplusplus extern "C" { @@ -61,7 +60,20 @@ extern "C" { * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_ds3231m_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_ds3231m_init(mikroe_i2c_handle_t i2cspm_instance); + +/***************************************************************************//** + * @brief + * Set I2C instance function. + * + * @param[in] i2c_instance + * I2C instance + * + * @return + * SL_STATUS_OK Successful. + * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null + ******************************************************************************/ +sl_status_t mikroe_ds3231m_set_i2c_instance(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief @@ -732,4 +744,4 @@ extern "C" } #endif -#endif /* MIKROE_DS3231M_H_ */ +#endif // MIKROE_DS3231M_H_ diff --git a/driver/public/mikroe/rtc10_ds3231m/src/mikroe_ds3231m.c b/driver/public/mikroe/rtc10_ds3231m/src/mikroe_ds3231m.c index 8c008a76..ddf40cf0 100644 --- a/driver/public/mikroe/rtc10_ds3231m/src/mikroe_ds3231m.c +++ b/driver/public/mikroe/rtc10_ds3231m/src/mikroe_ds3231m.c @@ -46,10 +46,8 @@ static bool initialized = false; /**************************************************************************//** * RTC clicks initialization. ******************************************************************************/ -sl_status_t mikroe_ds3231m_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_ds3231m_init(mikroe_i2c_handle_t i2cspm_instance) { - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - if (i2cspm_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } @@ -66,10 +64,30 @@ sl_status_t mikroe_ds3231m_init(sl_i2cspm_t *i2cspm_instance) rtc_cfg.int_pin = hal_gpio_pin_name(MIKROE_DS3231M_INT_PORT, MIKROE_DS3231M_INT_PIN); - THIRD_PARTY_HW_DRV_RETCODE_TEST(rtc10_init(&rtc_ctx, &rtc_cfg)); +#if (MIKROE_DS3231M_I2C_UC == 1) + rtc_cfg.i2c_speed = MIKROE_DS3231M_I2C_SPEED_MODE; +#endif + + if (RTC10_OK != rtc10_init(&rtc_ctx, &rtc_cfg)) { + return SL_STATUS_INITIALIZATION; + } initialized = true; - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; +} + +/**************************************************************************//** +* Set I2C instance. +******************************************************************************/ +sl_status_t mikroe_ds3231m_set_i2c_instance(mikroe_i2c_handle_t i2c_instance) +{ + if (NULL == i2c_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + rtc_ctx.i2c.handle = i2c_instance; + + return SL_STATUS_OK; } /**************************************************************************//** diff --git a/driver/public/mikroe/servo_pca9685/config/brd2703a/mikroe_servo_config.h b/driver/public/mikroe/servo_pca9685/config/brd2703a/mikroe_servo_config.h index 7ee271e3..a4330d95 100644 --- a/driver/public/mikroe/servo_pca9685/config/brd2703a/mikroe_servo_config.h +++ b/driver/public/mikroe/servo_pca9685/config/brd2703a/mikroe_servo_config.h @@ -40,14 +40,33 @@ #ifndef MIKORE_SERVO_CONFIG_H_ #define MIKORE_SERVO_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE SERVO CLICK I2C Configuration + +// MIKROE SERVO CLICK I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_SPEED_MODE 0 +// +// + // I2C address -// SERVO PCA9685 ADDRESS +// PCA9685 ADDRESS // <0=> None // <0x40=> 0x40 // <0x41=> 0x41 @@ -58,9 +77,9 @@ extern "C" { // <0x46=> 0x46 // <0x47=> 0x47 // Default: 0 -#define SERVO_PCA9685_ADDRESS 0x40 +#define PCA9685_ADDRESS 0x40 -// SERVO LTC2497 ADDRESS +// LTC2497 ADDRESS // <0=> None // <0x14=> 0x14 // <0x16=> 0x16 @@ -71,7 +90,7 @@ extern "C" { // <0x74=> 0x74 // <0x76=> 0x76 // Default: 0x14 -#define SERVO_LTC2497_ADDRESS 0x14 +#define LTC2497_ADDRESS 0x14 // // <<< end of configuration section >>> @@ -80,8 +99,8 @@ extern "C" { // SERVO_OUTPUT_ENABLE // $[GPIO_SERVO_OUTPUT_ENABLE] -#define SERVO_OUTPUT_ENABLE_PORT gpioPortC -#define SERVO_OUTPUT_ENABLE_PIN 0 +#define SERVO_OUTPUT_ENABLE_PORT gpioPortC +#define SERVO_OUTPUT_ENABLE_PIN 0 // [GPIO_SERVO_OUTPUT_ENABLE]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/servo_pca9685/config/brd4108a/mikroe_servo_config.h b/driver/public/mikroe/servo_pca9685/config/brd4108a/mikroe_servo_config.h index 35a84fa4..b75750bd 100644 --- a/driver/public/mikroe/servo_pca9685/config/brd4108a/mikroe_servo_config.h +++ b/driver/public/mikroe/servo_pca9685/config/brd4108a/mikroe_servo_config.h @@ -40,14 +40,33 @@ #ifndef MIKORE_SERVO_CONFIG_H_ #define MIKORE_SERVO_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE SERVO CLICK I2C Configuration + +// MIKROE SERVO CLICK I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_SPEED_MODE 0 +// +// + // I2C address -// SERVO PCA9685 ADDRESS +// PCA9685 ADDRESS // <0=> None // <0x40=> 0x40 // <0x41=> 0x41 @@ -58,9 +77,9 @@ extern "C" { // <0x46=> 0x46 // <0x47=> 0x47 // Default: 0 -#define SERVO_PCA9685_ADDRESS 0x40 +#define PCA9685_ADDRESS 0x40 -// SERVO LTC2497 ADDRESS +// LTC2497 ADDRESS // <0=> None // <0x14=> 0x14 // <0x16=> 0x16 @@ -71,7 +90,7 @@ extern "C" { // <0x74=> 0x74 // <0x76=> 0x76 // Default: 0x14 -#define SERVO_LTC2497_ADDRESS 0x14 +#define LTC2497_ADDRESS 0x14 // // <<< end of configuration section >>> @@ -80,8 +99,8 @@ extern "C" { // SERVO_OUTPUT_ENABLE // $[GPIO_SERVO_OUTPUT_ENABLE] -#define SERVO_OUTPUT_ENABLE_PORT gpioPortC -#define SERVO_OUTPUT_ENABLE_PIN 3 +#define SERVO_OUTPUT_ENABLE_PORT gpioPortC +#define SERVO_OUTPUT_ENABLE_PIN 3 // [GPIO_SERVO_OUTPUT_ENABLE]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/servo_pca9685/config/brd4314a/mikroe_servo_config.h b/driver/public/mikroe/servo_pca9685/config/brd4314a/mikroe_servo_config.h index 35a84fa4..b75750bd 100644 --- a/driver/public/mikroe/servo_pca9685/config/brd4314a/mikroe_servo_config.h +++ b/driver/public/mikroe/servo_pca9685/config/brd4314a/mikroe_servo_config.h @@ -40,14 +40,33 @@ #ifndef MIKORE_SERVO_CONFIG_H_ #define MIKORE_SERVO_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE SERVO CLICK I2C Configuration + +// MIKROE SERVO CLICK I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_SPEED_MODE 0 +// +// + // I2C address -// SERVO PCA9685 ADDRESS +// PCA9685 ADDRESS // <0=> None // <0x40=> 0x40 // <0x41=> 0x41 @@ -58,9 +77,9 @@ extern "C" { // <0x46=> 0x46 // <0x47=> 0x47 // Default: 0 -#define SERVO_PCA9685_ADDRESS 0x40 +#define PCA9685_ADDRESS 0x40 -// SERVO LTC2497 ADDRESS +// LTC2497 ADDRESS // <0=> None // <0x14=> 0x14 // <0x16=> 0x16 @@ -71,7 +90,7 @@ extern "C" { // <0x74=> 0x74 // <0x76=> 0x76 // Default: 0x14 -#define SERVO_LTC2497_ADDRESS 0x14 +#define LTC2497_ADDRESS 0x14 // // <<< end of configuration section >>> @@ -80,8 +99,8 @@ extern "C" { // SERVO_OUTPUT_ENABLE // $[GPIO_SERVO_OUTPUT_ENABLE] -#define SERVO_OUTPUT_ENABLE_PORT gpioPortC -#define SERVO_OUTPUT_ENABLE_PIN 3 +#define SERVO_OUTPUT_ENABLE_PORT gpioPortC +#define SERVO_OUTPUT_ENABLE_PIN 3 // [GPIO_SERVO_OUTPUT_ENABLE]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/servo_pca9685/config/brd4338a/mikroe_servo_config.h b/driver/public/mikroe/servo_pca9685/config/brd4338a/mikroe_servo_config.h new file mode 100644 index 00000000..ee436c07 --- /dev/null +++ b/driver/public/mikroe/servo_pca9685/config/brd4338a/mikroe_servo_config.h @@ -0,0 +1,110 @@ +/***************************************************************************//** + * @file mikroe_servo_config.h + * @brief Mikroe Servo Click Configuration + * @version 1.2.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKORE_SERVO_CONFIG_H_ +#define MIKORE_SERVO_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SERVO CLICK I2C Configuration + +// MIKROE SERVO CLICK I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_SPEED_MODE 0 +// +// + +// I2C address +// PCA9685 ADDRESS +// <0=> None +// <0x40=> 0x40 +// <0x41=> 0x41 +// <0x42=> 0x42 +// <0x43=> 0x43 +// <0x44=> 0x44 +// <0x45=> 0x45 +// <0x46=> 0x46 +// <0x47=> 0x47 +// Default: 0 +#define PCA9685_ADDRESS 0x40 + +// LTC2497 ADDRESS +// <0=> None +// <0x14=> 0x14 +// <0x16=> 0x16 +// <0x26=> 0x26 +// <0x34=> 0x34 +// <0x56=> 0x56 +// <0x64=> 0x64 +// <0x74=> 0x74 +// <0x76=> 0x76 +// Default: 0x14 +#define LTC2497_ADDRESS 0x14 +// + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// SERVO_OUTPUT_ENABLE +// $[GPIO_SERVO_OUTPUT_ENABLE] +#define SERVO_OUTPUT_ENABLE_PORT HP +#define SERVO_OUTPUT_ENABLE_PIN 46 +// [GPIO_SERVO_OUTPUT_ENABLE]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} + +#endif +#endif /* MIKORE_SERVO_CONFIG_H_ */ diff --git a/driver/public/mikroe/servo_pca9685/config/other/mikroe_servo_config.h b/driver/public/mikroe/servo_pca9685/config/other/mikroe_servo_config.h index ccdca8c2..952a1e11 100644 --- a/driver/public/mikroe/servo_pca9685/config/other/mikroe_servo_config.h +++ b/driver/public/mikroe/servo_pca9685/config/other/mikroe_servo_config.h @@ -40,14 +40,35 @@ #ifndef MIKORE_SERVO_CONFIG_H_ #define MIKORE_SERVO_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE SERVO CLICK I2C Configuration + +// MIKROE SERVO CLICK I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SERVO_CLICK_I2C_SPEED_MODE 0 +// +// + // I2C address -// SERVO PCA9685 ADDRESS +// PCA9685 ADDRESS // <0=> None // <0x40=> 0x40 // <0x41=> 0x41 @@ -58,9 +79,9 @@ extern "C" { // <0x46=> 0x46 // <0x47=> 0x47 // Default: 0 -#define SERVO_PCA9685_ADDRESS 0x40 +#define PCA9685_ADDRESS 0x40 -// SERVO LTC2497 ADDRESS +// LTC2497 ADDRESS // <0=> None // <0x14=> 0x14 // <0x16=> 0x16 @@ -71,7 +92,7 @@ extern "C" { // <0x74=> 0x74 // <0x76=> 0x76 // Default: 0x14 -#define SERVO_LTC2497_ADDRESS 0x14 +#define LTC2497_ADDRESS 0x14 // // <<< end of configuration section >>> @@ -81,8 +102,8 @@ extern "C" { // SERVO_OUTPUT_ENABLE // $[GPIO_SERVO_OUTPUT_ENABLE] #warning "OE pin for Servo Click is not configured" -// #define SERVO_OUTPUT_ENABLE_PORT gpioPortB -// #define SERVO_OUTPUT_ENABLE_PIN 0 +// #define SERVO_OUTPUT_ENABLE_PORT gpioPortB +// #define SERVO_OUTPUT_ENABLE_PIN 0 // [GPIO_SERVO_OUTPUT_ENABLE]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/servo_pca9685/inc/mikroe_pca9685.h b/driver/public/mikroe/servo_pca9685/inc/mikroe_pca9685.h index 271d4db5..8cb56b0c 100644 --- a/driver/public/mikroe/servo_pca9685/inc/mikroe_pca9685.h +++ b/driver/public/mikroe/servo_pca9685/inc/mikroe_pca9685.h @@ -41,7 +41,7 @@ #define MIKROE_PCA9685_H_ #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #include "mikroe_servo_config.h" typedef struct { @@ -264,7 +264,7 @@ void mikroe_pca9685_default_cfg(void); * @description This function set the I2C instance and the address for PCA9685 * and LTC2497. */ -sl_status_t mikroe_pca9685_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_pca9685_set_i2c_instance(mikroe_i2c_handle_t i2c_instance); /** * @brief Initialization function. @@ -276,7 +276,7 @@ sl_status_t mikroe_pca9685_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance); * @description This function initializes all necessary pins and peripherals * used for this click. */ -sl_status_t mikroe_pca9685_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_pca9685_init(mikroe_i2c_handle_t i2c_instance); /** * @brief Generic write function of pca9685. diff --git a/driver/public/mikroe/servo_pca9685/src/mikroe_pca9685.c b/driver/public/mikroe/servo_pca9685/src/mikroe_pca9685.c index c6b3373c..7f7df7c8 100644 --- a/driver/public/mikroe/servo_pca9685/src/mikroe_pca9685.c +++ b/driver/public/mikroe/servo_pca9685/src/mikroe_pca9685.c @@ -38,30 +38,19 @@ ******************************************************************************/ #include "stddef.h" -#include "sl_i2cspm_instances.h" -#include "third_party_hw_drivers_helpers.h" #include "mikroe_pca9685.h" #include "servo.h" static servo_t servo_ctx; static servo_cfg_t servo_cfg; -/** - * @brief Config Object Initialization function. - * - * @description This function initializes click configuration structure to init - * state. - * @note All used pins will be set to unconnected state. - */ -static void mikroe_pca9685_cfg_setup(void); - -sl_status_t mikroe_pca9685_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_pca9685_set_i2c_instance(mikroe_i2c_handle_t i2c_instance) { - if (NULL == i2cspm_instance) { + if (NULL == i2c_instance) { return SL_STATUS_INVALID_PARAMETER; } - servo_ctx.i2c.handle = i2cspm_instance; + servo_ctx.i2c.handle = i2c_instance; return SL_STATUS_OK; } @@ -71,28 +60,32 @@ void mikroe_pca9685_default_cfg(void) servo_default_cfg(&servo_ctx); } -sl_status_t mikroe_pca9685_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_pca9685_init(mikroe_i2c_handle_t i2c_instance) { - if (NULL == i2cspm_instance) { + if (NULL == i2c_instance) { return SL_STATUS_INVALID_PARAMETER; } + servo_cfg_setup(&servo_cfg); + servo_cfg.i2c_address_of_ltc2497 = LTC2497_ADDRESS; + servo_cfg.i2c_address_of_pca9685 = PCA9685_ADDRESS; - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - - servo_ctx.i2c.handle = i2cspm_instance; - servo_cfg.i2c_address_of_pca9685 = SERVO_PCA9685_ADDRESS; - servo_cfg.i2c_address_of_ltc2497 = SERVO_LTC2497_ADDRESS; - - mikroe_pca9685_cfg_setup(); + servo_ctx.i2c.handle = i2c_instance; #if defined(SERVO_OUTPUT_ENABLE_PORT) && defined(SERVO_OUTPUT_ENABLE_PIN) servo_cfg.oe = hal_gpio_pin_name(SERVO_OUTPUT_ENABLE_PORT, SERVO_OUTPUT_ENABLE_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(servo_init(&servo_ctx, &servo_cfg)); +#if (MIKROE_SERVO_CLICK_I2C_UC == 1) + servo_cfg.i2c_speed = MIKROE_SERVO_CLICK_I2C_SPEED_MODE; +#endif + + if (SERVO_OK != servo_init(&servo_ctx, &servo_cfg)) { + return SL_STATUS_INITIALIZATION; + } - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + servo_default_cfg(&servo_ctx); + return SL_STATUS_OK; } sl_status_t mikroe_pca9685_generic_write_of_pca9685(uint8_t reg, @@ -240,8 +233,3 @@ sl_status_t mikroe_pca9685_get_current(uint8_t channel, uint16_t *current_ma) return SL_STATUS_OK; } - -static void mikroe_pca9685_cfg_setup(void) -{ - servo_cfg_setup(&servo_cfg); -} diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_i2c_config.h b/driver/public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_i2c_config.h new file mode 100644 index 00000000..939b7988 --- /dev/null +++ b/driver/public/mikroe/smoke2_adpd188bi/config/brd2703a/mikroe_smoke2_adpd188bi_i2c_config.h @@ -0,0 +1,76 @@ +/***************************************************************************//** + * @file mikroe_smoke2_adpd188bi_config.h + * @brief Smoke2 Click Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ +#define MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ + +#include "em_gpio.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SMOKE2 I2C Configuration + +// MIKROE SMOKE2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SMOKE2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SMOKE2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_SMOKE2_INT +// $[GPIO_MIKROE_SMOKE2_INT] +#define MIKROE_SMOKE2_INT_PORT gpioPortB +#define MIKROE_SMOKE2_INT_PIN 1 +// [GPIO_MIKROE_SMOKE2_INT]$ + +// <<< sl:end pin_tool >>> + +#endif /* MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ */ diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_i2c_config.h b/driver/public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_i2c_config.h new file mode 100644 index 00000000..d072cd5d --- /dev/null +++ b/driver/public/mikroe/smoke2_adpd188bi/config/brd4108a/mikroe_smoke2_adpd188bi_i2c_config.h @@ -0,0 +1,76 @@ +/***************************************************************************//** + * @file mikroe_smoke2_adpd188bi_config.h + * @brief Smoke2 Click Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ +#define MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ + +#include "em_gpio.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SMOKE2 I2C Configuration + +// MIKROE SMOKE2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SMOKE2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SMOKE2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_SMOKE2_INT +// $[GPIO_MIKROE_SMOKE2_INT] +#define MIKROE_SMOKE2_INT_PORT gpioPortB +#define MIKROE_SMOKE2_INT_PIN 3 +// [GPIO_MIKROE_SMOKE2_INT]$ + +// <<< sl:end pin_tool >>> + +#endif /* MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ */ diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_i2c_config.h b/driver/public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_i2c_config.h new file mode 100644 index 00000000..d072cd5d --- /dev/null +++ b/driver/public/mikroe/smoke2_adpd188bi/config/brd4314a/mikroe_smoke2_adpd188bi_i2c_config.h @@ -0,0 +1,76 @@ +/***************************************************************************//** + * @file mikroe_smoke2_adpd188bi_config.h + * @brief Smoke2 Click Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ +#define MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ + +#include "em_gpio.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SMOKE2 I2C Configuration + +// MIKROE SMOKE2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SMOKE2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SMOKE2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_SMOKE2_INT +// $[GPIO_MIKROE_SMOKE2_INT] +#define MIKROE_SMOKE2_INT_PORT gpioPortB +#define MIKROE_SMOKE2_INT_PIN 3 +// [GPIO_MIKROE_SMOKE2_INT]$ + +// <<< sl:end pin_tool >>> + +#endif /* MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ */ diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/brd4338a/mikroe_smoke2_adpd188bi_i2c_config.h b/driver/public/mikroe/smoke2_adpd188bi/config/brd4338a/mikroe_smoke2_adpd188bi_i2c_config.h new file mode 100644 index 00000000..252acb05 --- /dev/null +++ b/driver/public/mikroe/smoke2_adpd188bi/config/brd4338a/mikroe_smoke2_adpd188bi_i2c_config.h @@ -0,0 +1,74 @@ +/***************************************************************************//** + * @file mikroe_smoke2_adpd188bi_config.h + * @brief Smoke2 Click Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ +#define MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SMOKE2 I2C Configuration + +// MIKROE SMOKE2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SMOKE2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SMOKE2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_SMOKE2_INT +// $[GPIO_MIKROE_SMOKE2_INT] +#define MIKROE_SMOKE2_INT_PORT 0 +#define MIKROE_SMOKE2_INT_PIN 46 +// [GPIO_MIKROE_SMOKE2_INT]$ + +// <<< sl:end pin_tool >>> + +#endif /* MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ */ diff --git a/driver/public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_i2c_config.h b/driver/public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_i2c_config.h new file mode 100644 index 00000000..ac0f8873 --- /dev/null +++ b/driver/public/mikroe/smoke2_adpd188bi/config/other/mikroe_smoke2_adpd188bi_i2c_config.h @@ -0,0 +1,79 @@ +/***************************************************************************//** + * @file mikroe_smoke2_adpd188bi_config.h + * @brief Smoke2 Click Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ +#define MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE SMOKE2 I2C Configuration + +// MIKROE SMOKE2 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_SMOKE2_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_SMOKE2_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_SMOKE2_INT +// $[GPIO_MIKROE_SMOKE2_INT] +#warning "MIKROE_SMOKE2_INT is not configured" +// #define MIKROE_SMOKE2_PORT gpioPortB +// #define MIKROE_SMOKE2_PIN 3 +// [GPIO_MIKROE_SMOKE2_INT]$ + +// <<< sl:end pin_tool >>> + +#endif // MIKROE_SMOKE2_ADPD188BI_I2C_CONFIG_H_ diff --git a/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_i2c.h b/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_i2c.h index 63129935..f7be68d2 100644 --- a/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_i2c.h +++ b/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_i2c.h @@ -38,8 +38,8 @@ ******************************************************************************/ #ifndef MIKROE_ADPD188BI_H_ #define MIKROE_ADPD188BI_H_ + #include "sl_status.h" -#include "sl_i2cspm.h" #include "smoke2.h" #ifdef __cplusplus @@ -211,7 +211,7 @@ extern "C" { * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_adpd188bi_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_adpd188bi_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -224,7 +224,8 @@ sl_status_t mikroe_adpd188bi_init(sl_i2cspm_t *i2cspm_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_adpd188bi_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_adpd188bi_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_spi.h b/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_spi.h deleted file mode 100644 index 4c7102e0..00000000 --- a/driver/public/mikroe/smoke2_adpd188bi/inc/mikroe_adpd188bi_spi.h +++ /dev/null @@ -1,391 +0,0 @@ -/***************************************************************************//** - * @file mikroe_adpd188bi.h - * @brief Mikroe ADPD188BI Prototypes - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ -#ifndef MIKROE_ADPD188BI_H_ -#define MIKROE_ADPD188BI_H_ - -#include "sl_status.h" -#include "spidrv.h" -#include "smoke2.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MIKROE_ADPD188BI_REG_STATUS SMOKE2_REG_STATUS -#define MIKROE_ADPD188BI_REG_INT_MASK SMOKE2_REG_INT_MASK -#define MIKROE_ADPD188BI_REG_GPIO_DRV SMOKE2_REG_GPIO_DRV -#define MIKROE_ADPD188BI_REG_BG_STATUS SMOKE2_REG_BG_STATUS -#define MIKROE_ADPD188BI_REG_FIFO_THR SMOKE2_REG_FIFO_THR -#define MIKROE_ADPD188BI_REG_DEVID SMOKE2_REG_DEVID -#define MIKROE_ADPD188BI_REG_I2CS_ID SMOKE2_REG_I2CS_ID -#define MIKROE_ADPD188BI_REG_CLK_RATIO SMOKE2_REG_CLK_RATIO -#define MIKROE_ADPD188BI_REG_GPIO_CTRL SMOKE2_REG_GPIO_CTRL -#define MIKROE_ADPD188BI_REG_SLAVE_ADDR_KEY SMOKE2_REG_SLAVE_ADDR_KEY -#define MIKROE_ADPD188BI_REG_SW_RESET SMOKE2_REG_SW_RESET -#define MIKROE_ADPD188BI_REG_MODE SMOKE2_REG_MODE -#define MIKROE_ADPD188BI_REG_SLOT_EN SMOKE2_REG_SLOT_EN -#define MIKROE_ADPD188BI_REG_FSAMPLE SMOKE2_REG_FSAMPLE -#define MIKROE_ADPD188BI_REG_PD_LED_SELECT SMOKE2_REG_PD_LED_SELECT -#define MIKROE_ADPD188BI_REG_NUM_AVG SMOKE2_REG_NUM_AVG -#define MIKROE_ADPD188BI_REG_BIG_MEAS_A SMOKE2_REG_BIG_MEAS_A -#define MIKROE_ADPD188BI_REG_INT_SEQ_A SMOKE2_REG_INT_SEQ_A -#define MIKROE_ADPD188BI_REG_SLOTA_CH1_OFFSET SMOKE2_REG_SLOTA_CH1_OFFSET -#define MIKROE_ADPD188BI_REG_SLOTA_CH2_OFFSET SMOKE2_REG_SLOTA_CH2_OFFSET -#define MIKROE_ADPD188BI_REG_SLOTA_CH3_OFFSET SMOKE2_REG_SLOTA_CH3_OFFSET -#define MIKROE_ADPD188BI_REG_SLOTA_CH4_OFFSET SMOKE2_REG_SLOTA_CH4_OFFSET -#define MIKROE_ADPD188BI_REG_BIG_MEAS_B SMOKE2_REG_BIG_MEAS_B -#define MIKROE_ADPD188BI_REG_INT_SEQ_B SMOKE2_REG_INT_SEQ_B -#define MIKROE_ADPD188BI_REG_SLOTB_CH1_OFFSET SMOKE2_REG_SLOTB_CH1_OFFSET -#define MIKROE_ADPD188BI_REG_SLOTB_CH2_OFFSET SMOKE2_REG_SLOTB_CH2_OFFSET -#define MIKROE_ADPD188BI_REG_SLOTB_CH3_OFFSET SMOKE2_REG_SLOTB_CH3_OFFSET -#define MIKROE_ADPD188BI_REG_SLOTB_CH4_OFFSET SMOKE2_REG_SLOTB_CH4_OFFSET -#define MIKROE_ADPD188BI_REG_ILED3_COARSE SMOKE2_REG_ILED3_COARSE -#define MIKROE_ADPD188BI_REG_ILED1_COARSE SMOKE2_REG_ILED1_COARSE -#define MIKROE_ADPD188BI_REG_ILED2_COARSE SMOKE2_REG_ILED2_COARSE -#define MIKROE_ADPD188BI_REG_ILED_FINE SMOKE2_REG_ILED_FINE -#define MIKROE_ADPD188BI_REG_SLOTA_LED_PULSE SMOKE2_REG_SLOTA_LED_PULSE -#define MIKROE_ADPD188BI_REG_SLOTA_NUM_PULSES SMOKE2_REG_SLOTA_NUM_PULSES -#define MIKROE_ADPD188BI_REG_LED_DISABLE SMOKE2_REG_LED_DISABLE -#define MIKROE_ADPD188BI_REG_SLOTB_LED_PULSE SMOKE2_REG_SLOTB_LED_PULSE -#define MIKROE_ADPD188BI_REG_SLOTB_NUM_PULSES SMOKE2_REG_SLOTB_NUM_PULSES -#define MIKROE_ADPD188BI_REG_ALT_PWR_DN SMOKE2_REG_ALT_PWR_DN -#define MIKROE_ADPD188BI_REG_EXT_SYNC_STARTUP SMOKE2_REG_EXT_SYNC_STARTUP -#define MIKROE_ADPD188BI_REG_SLOTA_AFE_WINDOW SMOKE2_REG_SLOTA_AFE_WINDOW -#define MIKROE_ADPD188BI_REG_SLOTB_AFE_WINDOW SMOKE2_REG_SLOTB_AFE_WINDOW -#define MIKROE_ADPD188BI_REG_AFE_PWR_CFG1 SMOKE2_REG_AFE_PWR_CFG1 -#define MIKROE_ADPD188BI_REG_SLOTA_FLOAT_LED SMOKE2_REG_SLOTA_FLOAT_LED -#define MIKROE_ADPD188BI_REG_SLOTB_FLOAT_LED SMOKE2_REG_SLOTB_FLOAT_LED -#define MIKROE_ADPD188BI_REG_SLOTA_TIA_CFG SMOKE2_REG_SLOTA_TIA_CFG -#define MIKROE_ADPD188BI_REG_SLOTA_AFE_CFG SMOKE2_REG_SLOTA_AFE_CFG -#define MIKROE_ADPD188BI_REG_SLOTB_TIA_CFG SMOKE2_REG_SLOTB_TIA_CFG -#define MIKROE_ADPD188BI_REG_SLOTB_AFE_CFG SMOKE2_REG_SLOTB_AFE_CFG -#define MIKROE_ADPD188BI_REG_SAMPLE_CLK SMOKE2_REG_SAMPLE_CLK -#define MIKROE_ADPD188BI_REG_CLK32M_ADJUST SMOKE2_REG_CLK32M_ADJUST -#define MIKROE_ADPD188BI_REG_EXT_SYNC_SEL SMOKE2_REG_EXT_SYNC_SEL -#define MIKROE_ADPD188BI_REG_CLK32M_CAL_EN SMOKE2_REG_CLK32M_CAL_EN -#define MIKROE_ADPD188BI_REG_AFE_PWR_CFG2 SMOKE2_REG_AFE_PWR_CFG2 -#define MIKROE_ADPD188BI_REG_TIA_INDEP_GAIN SMOKE2_REG_TIA_INDEP_GAIN -#define MIKROE_ADPD188BI_REG_MATH SMOKE2_REG_MATH -#define MIKROE_ADPD188BI_REG_FLT_CONFIG_B SMOKE2_REG_FLT_CONFIG_B -#define MIKROE_ADPD188BI_REG_FLT_LED_FIRE SMOKE2_REG_FLT_LED_FIRE -#define MIKROE_ADPD188BI_REG_FLT_CONFIG_A SMOKE2_REG_FLT_CONFIG_A -#define MIKROE_ADPD188BI_REG_DATA_ACCESS_CTL SMOKE2_REG_DATA_ACCESS_CTL -#define MIKROE_ADPD188BI_REG_FIFO_ACCESS SMOKE2_REG_FIFO_ACCESS -#define MIKROE_ADPD188BI_REG_SLOTA_CH1 SMOKE2_REG_SLOTA_CH1 -#define MIKROE_ADPD188BI_REG_SLOTA_CH2 SMOKE2_REG_SLOTA_CH2 -#define MIKROE_ADPD188BI_REG_SLOTA_CH3 SMOKE2_REG_SLOTA_CH3 -#define MIKROE_ADPD188BI_REG_SLOTA_CH4 SMOKE2_REG_SLOTA_CH4 -#define MIKROE_ADPD188BI_REG_SLOTB_CH1 SMOKE2_REG_SLOTB_CH1 -#define MIKROE_ADPD188BI_REG_SLOTB_CH2 SMOKE2_REG_SLOTB_CH2 -#define MIKROE_ADPD188BI_REG_SLOTB_CH3 SMOKE2_REG_SLOTB_CH3 -#define MIKROE_ADPD188BI_REG_SLOTB_CH4 SMOKE2_REG_SLOTB_CH4 -#define MIKROE_ADPD188BI_REG_A_CH1_LOW SMOKE2_REG_A_CH1_LOW -#define MIKROE_ADPD188BI_REG_A_CH2_LOW SMOKE2_REG_A_CH2_LOW -#define MIKROE_ADPD188BI_REG_A_CH3_LOW SMOKE2_REG_A_CH3_LOW -#define MIKROE_ADPD188BI_REG_A_CH4_LOW SMOKE2_REG_A_CH4_LOW -#define MIKROE_ADPD188BI_REG_A_CH1_HIGH SMOKE2_REG_A_CH1_HIGH -#define MIKROE_ADPD188BI_REG_A_CH2_HIGH SMOKE2_REG_A_CH2_HIGH -#define MIKROE_ADPD188BI_REG_A_CH3_HIGH SMOKE2_REG_A_CH3_HIGH -#define MIKROE_ADPD188BI_REG_A_CH4_HIGH SMOKE2_REG_A_CH4_HIGH -#define MIKROE_ADPD188BI_REG_B_CH1_LOW SMOKE2_REG_B_CH1_LOW -#define MIKROE_ADPD188BI_REG_B_CH2_LOW SMOKE2_REG_B_CH2_LOW -#define MIKROE_ADPD188BI_REG_B_CH3_LOW SMOKE2_REG_B_CH3_LOW -#define MIKROE_ADPD188BI_REG_B_CH4_LOW SMOKE2_REG_B_CH4_LOW -#define MIKROE_ADPD188BI_REG_B_CH1_HIGH SMOKE2_REG_B_CH1_HIGH -#define MIKROE_ADPD188BI_REG_B_CH2_HIGH SMOKE2_REG_B_CH2_HIGH -#define MIKROE_ADPD188BI_REG_B_CH3_HIGH SMOKE2_REG_B_CH3_HIGH -#define MIKROE_ADPD188BI_REG_B_CH4_HIGH SMOKE2_REG_B_CH4_HIGH - -/*! @} */ // mikroe_adpd188bi_reg - -/** - * @defgroup mikroe_adpd188bi_set Smoke 2 Registers Settings - * @brief Settings for registers of Smoke 2 Click driver. - */ - -/** - * @addtogroup mikroe_adpd188bi_set - * @{ - */ - -/** - * @brief Smoke 2 description setting. - * @details Specified setting for description of Smoke 2 Click driver. - */ -#define MIKROE_ADPD188BI_SLOT_A SMOKE2_SLOT_A -#define MIKROE_ADPD188BI_SLOT_B SMOKE2_SLOT_B - -/** - * @brief Smoke 2 description setting to select channel. - * @details Specified setting for select channel Smoke 2 Click driver. - */ -#define MIKROE_ADPD188BI_CHN_1 SMOKE2_CHN_1 -#define MIKROE_ADPD188BI_CHN_2 SMOKE2_CHN_2 -#define MIKROE_ADPD188BI_CHN_3 SMOKE2_CHN_3 -#define MIKROE_ADPD188BI_CHN_4 SMOKE2_CHN_4 - -/** - * @brief Smoke 2 description setting to select mode. - * @details Specified setting for select mdoe Smoke 2 Click driver. - */ -#define MIKROE_ADPD188BI_MODE_IDLE SMOKE2_MODE_IDLE -#define MIKROE_ADPD188BI_MODE_PROGRAM SMOKE2_MODE_PROGRAM -#define MIKROE_ADPD188BI_MODE_NORMAL SMOKE2_MODE_NORMAL - -/** - * @brief Smoke 2 description setting for detection smoke. - * @details Specified setting for detection smoke Smoke 2 Click driver. - */ -#define MIKROE_ADPD188BI_SMOKE_DETECTED SMOKE2_SMOKE_DETECTED -#define MIKROE_ADPD188BI_SMOKE_NOT_DETECTED SMOKE2_SMOKE_NOT_DETECTED - -/** - * @brief Smoke 2 description setting for read and write. - * @details Specified setting for read and write Smoke 2 Click driver. - */ -#define MIKROE_ADPD188BI_READ_CMD SMOKE2_READ_CMD -#define MIKROE_ADPD188BI_WRITE_CMD SMOKE2_WRITE_CMD - -/** - * @brief Smoke 2 device address setting. - * @details Specified setting for device slave address selection of - * Smoke 2 Click driver. - */ -#define MIKROE_ADPD188BI_SET_DEV_ADDR SMOKE2_SET_DEV_ADDR - -/** - * @brief Data sample selection. - * @details This macro sets data samples for SPI modules. - * @note Available only on Microchip PIC family devices. - * This macro will set data sampling for all SPI modules on MCU. - * Can be overwritten with @b mikroe_adpd188bi_init which will set - * @b SET_SPI_DATA_SAMPLE_MIDDLE by default on the mapped mikrobus. - */ -#define MIKROE_ADPD188BI_SET_DATA_SAMPLE_EDGE SMOKE2_SET_DATA_SAMPLE_EDGE -#define MIKROE_ADPD188BI_SET_DATA_SAMPLE_MIDDLE SMOKE2_SET_DATA_SAMPLE_MIDDLE - -/***************************************************************************//** - * @brief - * Initialization function. - * - * @param[in] spi_instance - * SPIDriver instance - * - * @return - * SL_STATUS_OK Successful initialization. - * SL_STATUS_INVALID_PARAMETER if spi_instance is null - * SL_STATUS_FAIL Initialization failed. - ******************************************************************************/ -sl_status_t mikroe_adpd188bi_init(SPIDRV_Handle_t spi_instance); - -/***************************************************************************//** - * @brief - * This function sets the spi drv instance used by platform functions. - * - * @param[in] spi_instance - * SPIDriver instance - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_INVALID_PARAMETER if spi_instance is null. - ******************************************************************************/ -sl_status_t mikroe_adpd188bi_set_spidrv_instance(SPIDRV_Handle_t spi_instance); - -/***************************************************************************//** - * @brief - * This function executes default configuration for mikroe_adpd188bi. - * - * @return void - * - ******************************************************************************/ -void mikroe_adpd188bi_default_cfg (void); - -/***************************************************************************//** - * @brief - * This function writes data to the desired register. - * - * @param[in] reg : Register address. - * @param[in] data_in : Data to be written. - * @param[in] len : The number of data length in byte - * @return SL_STATUS_INVALID_PARAMETER if data_in is null - * SL_STATUS_OK - Success - * - ******************************************************************************/ -sl_status_t mikroe_adpd188bi_generic_write(uint8_t reg, - uint8_t *data_in, - uint8_t len); - -/***************************************************************************//** - * @brief - * This function reads data from the desired register. - * - * @param[in] reg : Register address. - * @param[out] data_out : Output read data - * @param[in] len : The number of data length in byte - * @return - * SL_STATUS_INVALID_PARAMETER if data_out is null - * SL_STATUS_OK - Success - ******************************************************************************/ -sl_status_t mikroe_adpd188bi_generic_read (uint8_t reg, - uint8_t *data_out, - uint8_t len); - -/***************************************************************************//** - * @brief - * This function read value of the interrupt pin - * @param[in] : - * @param[out] : - * @return The value of interrupt pin. - * - ******************************************************************************/ -uint8_t mikroe_adpd188bi_get_int_pin (void); - -/***************************************************************************//** - * @brief - * This function writes data to the desired register. - * - * @param[in] reg : Register address. - * @param[in] tx_data : Data to be written. - * @return : None - * - ******************************************************************************/ -void mikroe_adpd188bi_write_data(uint8_t reg, uint16_t tx_data); - -/***************************************************************************//** - * @brief - * This function reads data from the desired register. - * - * @param[in] reg : Register address. - * @return : Output read data - * - ******************************************************************************/ -uint16_t mikroe_adpd188bi_read_data(uint8_t reg); - -/***************************************************************************//** - * @brief - * This function sets the value according to the specific bit in the desired - * register - * - * @param[in] reg : Register address. - * @param[in] bit_num : Specific bit number in the register. - * @param[in] val : Value to be written. - * @return : void - * - ******************************************************************************/ -void mikroe_adpd188bi_set_bit (uint8_t reg, uint8_t bit_num, uint8_t val); - -/***************************************************************************//** - * @brief - * This function gets the value according to the specific bit in the desired - * register - * - * @param[in] reg : Register address. - * @param[in] bit_num : Specific bit number in the register. - * @return : Output read data - * - ******************************************************************************/ -uint8_t mikroe_adpd188bi_get_bit (uint8_t reg, uint8_t bit_num); - -/***************************************************************************//** - * @brief - * This function set the mode for smoke2_adpd188bi - * - * @param[in] mode : Mode for setting. - * @return : - * - ******************************************************************************/ -void mikroe_adpd188bi_set_mode (uint8_t mode); - -/***************************************************************************//** - * @brief - * This function get the int - * - * @param[in] fifo : FiFo pointer - * @param[in] slot_a : Slot_a pointer - * @param[in] slot_b : Slot_b pointer - * @return : SL_STATUS_OK or SL_STATUS_INVALID_PARAMETER - * - ******************************************************************************/ -sl_status_t mikroe_adpd188bi_get_int(uint8_t *fifo, - uint8_t *slot_a, - uint8_t *slot_b); - -/***************************************************************************//** - * @brief - * This function read the sens data - * - * @param[in] slot : slot number - * @param[in] chn : channel number - * @return : The current sens data - * - ******************************************************************************/ -uint16_t mikroe_adpd188bi_read_sens_data (uint8_t slot, uint8_t chn); - -/***************************************************************************//** - * @brief - * This function perform the software reset - * @return : None - * - ******************************************************************************/ -void mikroe_adpd188bi_soft_reset (void); - -/***************************************************************************//** - * @brief - * This function perform calibrate for mikroe_adpd188bi - * - * @param[in] threshold : The threshold to set - * @return : The calibration value - * - ******************************************************************************/ -uint16_t mikroe_adpd188bi_smoke_calibration (uint16_t threshold); - -/***************************************************************************//** - * @brief - * This function checks whether the sensing value is above threshold setting. - * - * @return : SMOKE2_SMOKE_DETECTED or SMOKE2_SMOKE_NOT_DETECTED or 0 for ERROR - * - ******************************************************************************/ -uint8_t mikroe_adpd188bi_check_smoke (void); - -#ifdef __cplusplus -} -#endif - -#endif /* MIKROE_ADPD188BI_H_ */ diff --git a/driver/public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_i2c.c b/driver/public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_i2c.c index beef8c34..0e310b26 100644 --- a/driver/public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_i2c.c +++ b/driver/public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_i2c.c @@ -37,37 +37,38 @@ * ******************************************************************************/ #include "mikroe_adpd188bi_i2c.h" -#include "mikroe_smoke2_adpd188bi_config.h" +#include "mikroe_smoke2_adpd188bi_i2c_config.h" static smoke2_t smoke2; static smoke2_cfg_t smoke2_cfg; -sl_status_t mikroe_adpd188bi_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_adpd188bi_init(mikroe_i2c_handle_t i2cspm_instance) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; + if (NULL == i2cspm_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + smoke2.i2c.handle = i2cspm_instance; + smoke2_cfg_setup(&smoke2_cfg); - if (NULL != i2cspm_instance) { - smoke2.i2c.handle = i2cspm_instance; - smoke2_cfg_setup(&smoke2_cfg); +#if defined(MIKROE_SMOKE2_INT_PORT) && defined(MIKROE_SMOKE2_INT_PIN) + smoke2_cfg.int_pin = hal_gpio_pin_name(MIKROE_SMOKE2_INT_PORT, + MIKROE_SMOKE2_INT_PIN); +#endif -#if defined(MIKROE_SMOKE2_ADPD188BI_INT_PORT) \ - && defined(MIKROE_SMOKE2_ADPD188BI_INT_PIN) - smoke2_cfg.int_pin = hal_gpio_pin_name(MIKROE_SMOKE2_ADPD188BI_INT_PORT, - MIKROE_SMOKE2_ADPD188BI_INT_PIN); +#if (MIKROE_SMOKE2_I2C_UC == 1) + smoke2_cfg.i2c_speed = MIKROE_SMOKE2_I2C_SPEED_MODE; #endif - smoke2_drv_interface_selection(&smoke2_cfg, SMOKE2_DRV_SEL_I2C); + smoke2_drv_interface_selection(&smoke2_cfg, SMOKE2_DRV_SEL_I2C); - if (I2C_MASTER_SUCCESS == smoke2_init(&smoke2, &smoke2_cfg)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } + if (SMOKE2_OK != smoke2_init(&smoke2, &smoke2_cfg)) { + return SL_STATUS_INITIALIZATION; } - return stt; + return SL_STATUS_OK; } -sl_status_t mikroe_adpd188bi_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_adpd188bi_set_i2csmp_instance( + mikroe_i2c_handle_t i2cspm_instance) { sl_status_t stt = SL_STATUS_INVALID_PARAMETER; diff --git a/driver/public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_spi.c b/driver/public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_spi.c deleted file mode 100644 index 8fea2391..00000000 --- a/driver/public/mikroe/smoke2_adpd188bi/src/mikroe_adpd188bi_spi.c +++ /dev/null @@ -1,189 +0,0 @@ -/***************************************************************************//** - * @file mikroe_adpd188bi.c - * @brief Mikroe ADPD188BI Source File - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ -#include "mikroe_adpd188bi_spi.h" -#include "mikroe_smoke2_adpd188bi_config.h" - -static smoke2_t smoke2; -static smoke2_cfg_t smoke2_cfg; - -sl_status_t mikroe_adpd188bi_init(SPIDRV_Handle_t spi_instance) -{ - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if (NULL != spi_instance) { - smoke2.spi.handle = spi_instance; - smoke2_cfg_setup(&smoke2_cfg); - -#if defined(MIKROE_SMOKE2_ADPD188BI_INT_PORT) \ - && defined(MIKROE_SMOKE2_ADPD188BI_INT_PIN) - smoke2_cfg.int_pin = hal_gpio_pin_name(MIKROE_SMOKE2_ADPD188BI_INT_PORT, - MIKROE_SMOKE2_ADPD188BI_INT_PIN); -#endif - - smoke2_cfg.cs = - hal_gpio_pin_name(spi_instance->portCs, spi_instance->pinCs); - GPIO_PinModeSet(spi_instance->portCs, - spi_instance->pinCs, - gpioModePushPull, - 1); - - smoke2_drv_interface_selection(&smoke2_cfg, SMOKE2_DRV_SEL_SPI); - - if (I2C_MASTER_SUCCESS == smoke2_init(&smoke2, &smoke2_cfg)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } - } - return stt; -} - -sl_status_t mikroe_adpd188bi_set_spidrv_instance(SPIDRV_Handle_t spi_instance) -{ - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if (NULL != spi_instance) { - smoke2.spi.handle = spi_instance; - stt = SL_STATUS_OK; - } - return stt; -} - -void mikroe_adpd188bi_default_cfg(void) -{ - smoke2_default_cfg(&smoke2); -} - -sl_status_t mikroe_adpd188bi_generic_write(uint8_t reg, - uint8_t *data_in, - uint8_t len) -{ - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - if (NULL != data_in) { - err_t st = smoke2_generic_write(&smoke2, reg, data_in, len); - - if (st == 0) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } - } - return stt; -} - -sl_status_t mikroe_adpd188bi_generic_read(uint8_t reg, - uint8_t *data_out, - uint8_t len) -{ - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - if (NULL != data_out) { - err_t st = smoke2_generic_read(&smoke2, reg, data_out, len); - - if (st == 0) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } - } - return stt; -} - -uint8_t mikroe_adpd188bi_get_int_pin(void) -{ - return smoke2_get_int_pin(&smoke2); -} - -void mikroe_adpd188bi_write_data(uint8_t reg, uint16_t tx_data) -{ - smoke2_write_data(&smoke2, reg, tx_data); -} - -uint16_t mikroe_adpd188bi_read_data(uint8_t reg) -{ - return smoke2_read_data(&smoke2, reg); -} - -void mikroe_adpd188bi_set_bit(uint8_t reg, uint8_t bit_num, uint8_t val) -{ - smoke2_set_bit(&smoke2, reg, bit_num, val); -} - -uint8_t mikroe_adpd188bi_get_bit(uint8_t reg, uint8_t bit_num) -{ - return smoke2_get_bit(&smoke2, reg, bit_num); -} - -void mikroe_adpd188bi_set_mode(uint8_t mode) -{ - smoke2_set_mode(&smoke2, mode); -} - -sl_status_t mikroe_adpd188bi_get_int(uint8_t *fifo, - uint8_t *slot_a, - uint8_t *slot_b) -{ - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if ((NULL != fifo) && (NULL != slot_a) && (NULL != slot_b)) { - smoke2_get_int(&smoke2, fifo, slot_a, slot_b); - stt = SL_STATUS_OK; - } - - return stt; -} - -uint16_t mikroe_adpd188bi_read_sens_data(uint8_t slot, uint8_t chn) -{ - return smoke2_read_sens_data(&smoke2, slot, chn); -} - -void mikroe_adpd188bi_soft_reset(void) -{ - smoke2_soft_reset(&smoke2); -} - -uint16_t mikroe_adpd188bi_smoke_calibration(uint16_t threshold) -{ - return smoke2_smoke_calibration(&smoke2, threshold); -} - -uint8_t mikroe_adpd188bi_check_smoke(void) -{ - return smoke2_check_smoke(&smoke2); -} diff --git a/driver/public/mikroe/stepper2_a4988/src/stepper2_a4988.c b/driver/public/mikroe/stepper2_a4988/src/stepper2_a4988.c index 2233d4af..25de5bdf 100644 --- a/driver/public/mikroe/stepper2_a4988/src/stepper2_a4988.c +++ b/driver/public/mikroe/stepper2_a4988/src/stepper2_a4988.c @@ -41,6 +41,7 @@ // ----------------------------------------------------------------------------- #include "stepper2_a4988.h" #include "em_cmu.h" +#include "em_timer.h" #include "em_gpio.h" #include "sl_status.h" // ----------------------------------------------------------------------------- diff --git a/driver/public/mikroe/stretch/config/brd2703a/mikroe_stretch_config.h b/driver/public/mikroe/stretch/config/brd2703a/mikroe_stretch_config.h index 4da81d6a..88219db5 100644 --- a/driver/public/mikroe/stretch/config/brd2703a/mikroe_stretch_config.h +++ b/driver/public/mikroe/stretch/config/brd2703a/mikroe_stretch_config.h @@ -40,6 +40,8 @@ #ifndef MIKORE_STRETCH_CONFIG_H_ #define MIKORE_STRETCH_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -62,6 +64,5 @@ extern "C" { #ifdef __cplusplus } - #endif -#endif /* MIKORE_STRETCH_CONFIG_H_ */ +#endif // MIKORE_STRETCH_CONFIG_H_ diff --git a/driver/public/mikroe/stretch/config/brd4108a/mikroe_stretch_config.h b/driver/public/mikroe/stretch/config/brd4108a/mikroe_stretch_config.h index 10f2226d..6a6fb7bc 100644 --- a/driver/public/mikroe/stretch/config/brd4108a/mikroe_stretch_config.h +++ b/driver/public/mikroe/stretch/config/brd4108a/mikroe_stretch_config.h @@ -40,6 +40,8 @@ #ifndef MIKORE_STRETCH_CONFIG_H_ #define MIKORE_STRETCH_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -62,6 +64,5 @@ extern "C" { #ifdef __cplusplus } - #endif -#endif /* MIKORE_STRETCH_CONFIG_H_ */ +#endif // MIKORE_STRETCH_CONFIG_H_ diff --git a/driver/public/mikroe/stretch/config/brd4314a/mikroe_stretch_config.h b/driver/public/mikroe/stretch/config/brd4314a/mikroe_stretch_config.h index 10f2226d..6a6fb7bc 100644 --- a/driver/public/mikroe/stretch/config/brd4314a/mikroe_stretch_config.h +++ b/driver/public/mikroe/stretch/config/brd4314a/mikroe_stretch_config.h @@ -40,6 +40,8 @@ #ifndef MIKORE_STRETCH_CONFIG_H_ #define MIKORE_STRETCH_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -62,6 +64,5 @@ extern "C" { #ifdef __cplusplus } - #endif -#endif /* MIKORE_STRETCH_CONFIG_H_ */ +#endif // MIKORE_STRETCH_CONFIG_H_ diff --git a/driver/public/mikroe/stretch/config/brd4338a/mikroe_stretch_config.h b/driver/public/mikroe/stretch/config/brd4338a/mikroe_stretch_config.h new file mode 100644 index 00000000..32206fd9 --- /dev/null +++ b/driver/public/mikroe/stretch/config/brd4338a/mikroe_stretch_config.h @@ -0,0 +1,60 @@ +/***************************************************************************//** + * @file mikroe_stretch_config.h + * @brief Mikroe Stretch Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKORE_STRETCH_CONFIG_H_ +#define MIKORE_STRETCH_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< sl:start pin_tool >>> + +// STRETCH_LED +// $[GPIO_STRETCH_LED] +#define STRETCH_LED_PORT HP +#define STRETCH_LED_PIN 46 +// [GPIO_STRETCH_LED]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKORE_STRETCH_CONFIG_H_ diff --git a/driver/public/mikroe/stretch/config/other/mikroe_stretch_config.h b/driver/public/mikroe/stretch/config/other/mikroe_stretch_config.h index dc375247..2c70e4dd 100644 --- a/driver/public/mikroe/stretch/config/other/mikroe_stretch_config.h +++ b/driver/public/mikroe/stretch/config/other/mikroe_stretch_config.h @@ -40,6 +40,8 @@ #ifndef MIKORE_STRETCH_CONFIG_H_ #define MIKORE_STRETCH_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif @@ -64,6 +66,5 @@ extern "C" { #ifdef __cplusplus } - #endif -#endif /* MIKORE_STRETCH_CONFIG_H_ */ \ No newline at end of file +#endif // MIKORE_STRETCH_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/mikroe/stretch/inc/mikroe_stretch.h b/driver/public/mikroe/stretch/inc/mikroe_stretch.h index 2357005a..b4eb23d5 100644 --- a/driver/public/mikroe/stretch/inc/mikroe_stretch.h +++ b/driver/public/mikroe/stretch/inc/mikroe_stretch.h @@ -39,34 +39,13 @@ #ifndef MIKROE_STRETCH_H_ #define MIKROE_STRETCH_H_ -#include "em_cmu.h" #include "sl_status.h" - -#if defined(_SILICON_LABS_32B_SERIES_1) -#include "em_adc.h" -#elif defined(_SILICON_LABS_32B_SERIES_2) -#include "em_iadc.h" -#endif +#include "drv_analog_in.h" #ifdef __cplusplus extern "C" { #endif -#if defined(_SILICON_LABS_32B_SERIES_1) -typedef ADC_TypeDef adc_t; -#elif defined(_SILICON_LABS_32B_SERIES_2) -typedef IADC_TypeDef adc_t; -#endif - -/** - * @brief Stretch configuration object setup function. - * @details This function initializes click configuration structure to initial - * values. - * @return Nothing. - * @note The all used pins will be set to unconnected state. - */ -void mikroe_stretch_setup(void); - /** * @brief Stretch initialization function. * @details This function initializes all necessary pins and peripherals used @@ -77,7 +56,7 @@ void mikroe_stretch_setup(void); * See #err_t definition for detailed explanation. * @note None. */ -sl_status_t mikroe_stretch_init(adc_t *handle); +sl_status_t mikroe_stretch_init(mikroe_adc_handle_t handle); /** * @brief Stretch read AN pin value function. @@ -103,4 +82,7 @@ void mikroe_stretch_turn_on_led(void); */ void mikroe_stretch_turn_off_led(void); -#endif /* MIKROE_STRETCH_H_ */ +#ifdef __cplusplus +} +#endif +#endif // MIKROE_STRETCH_H_ diff --git a/driver/public/mikroe/stretch/src/mikroe_stretch.c b/driver/public/mikroe/stretch/src/mikroe_stretch.c index b323ae88..312b19d2 100644 --- a/driver/public/mikroe/stretch/src/mikroe_stretch.c +++ b/driver/public/mikroe/stretch/src/mikroe_stretch.c @@ -40,26 +40,17 @@ #include #include "mikroe_stretch.h" #include "mikroe_stretch_config.h" -#include "third_party_hw_drivers_helpers.h" #include "stretch.h" static stretch_t stretch; static stretch_cfg_t stretch_cfg; -void mikroe_stretch_setup(void) -{ - stretch_cfg_setup(&stretch_cfg); -} - -sl_status_t mikroe_stretch_init(adc_t *handle) +sl_status_t mikroe_stretch_init(mikroe_adc_handle_t handle) { if (NULL == handle) { return SL_STATUS_INVALID_HANDLE; } stretch.adc.handle = handle; - - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - stretch_cfg_setup(&stretch_cfg); #if defined(STRETCH_ANALOG_OUTPUT_PORT) && defined(STRETCH_ANALOG_OUTPUT_PIN) @@ -72,9 +63,10 @@ sl_status_t mikroe_stretch_init(adc_t *handle) STRETCH_LED_PIN); #endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(stretch_init(&stretch, &stretch_cfg)); - - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + if (stretch_init(&stretch, &stretch_cfg) != STRETCH_OK) { + return SL_STATUS_INITIALIZATION; + } + return SL_STATUS_OK; } sl_status_t mikroe_stretch_generic_read(uint16_t *data_out) diff --git a/driver/public/mikroe/temphum15_sht40/config/mikroe_sht40_config.h b/driver/public/mikroe/temphum15_sht40/config/mikroe_sht40_config.h new file mode 100644 index 00000000..d9f92a4f --- /dev/null +++ b/driver/public/mikroe/temphum15_sht40/config/mikroe_sht40_config.h @@ -0,0 +1,70 @@ +/***************************************************************************/ /** + * @file mikroe_sht40_config.h + * @brief Mikroe SHT40 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_SHT40_CONFIG_H +#define MIKROE_SHT40_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE I2C SHT40 Configuration + +// MIKROE I2C SHT40 UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_I2C_SHT40_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_I2C_SHT40_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_SHT40_CONFIG_H diff --git a/driver/public/mikroe/temphum15_sht40/inc/mikroe_sht40.h b/driver/public/mikroe/temphum15_sht40/inc/mikroe_sht40.h index ff8d1533..bb0c60b5 100644 --- a/driver/public/mikroe/temphum15_sht40/inc/mikroe_sht40.h +++ b/driver/public/mikroe/temphum15_sht40/inc/mikroe_sht40.h @@ -36,10 +36,11 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_TEMPHUM15_SHT40_INC_MIKROE_SHT40_H_ -#define MIKROE_TEMPHUM15_SHT40_INC_MIKROE_SHT40_H_ +#ifndef MIKROE_SHT40_H +#define MIKROE_SHT40_H + #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #include "temphum15.h" #ifdef __cplusplus @@ -109,7 +110,7 @@ typedef struct { * @brief * Initialization function. * - * @param[in] i2cspm_instance + * @param[in] instance * I2CSPM instance * * @return @@ -117,20 +118,20 @@ typedef struct { * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_sht40_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_sht40_init(mikroe_i2c_handle_t instance); /***************************************************************************//** * @brief * This function sets the IC2SPM instance used by platform functions. * - * @param[in] i2cspm_instance + * @param[in] instance * I2CSPM instance * * @return * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null. ******************************************************************************/ -sl_status_t mikroe_sht40_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_sht40_set_i2csmp_instance(mikroe_i2c_handle_t instance); /***************************************************************************//** * @brief @@ -216,4 +217,4 @@ sl_status_t mikroe_sht40_read_serial (uint32_t *serial_number); } #endif -#endif /* MIKROE_TEMPHUM15_SHT40_INC_MIKROE_SHT40_H_ */ +#endif // MIKROE_SHT40_H diff --git a/driver/public/mikroe/temphum15_sht40/src/mikroe_sht40.c b/driver/public/mikroe/temphum15_sht40/src/mikroe_sht40.c index 6cc4afba..bcda6b9e 100644 --- a/driver/public/mikroe/temphum15_sht40/src/mikroe_sht40.c +++ b/driver/public/mikroe/temphum15_sht40/src/mikroe_sht40.c @@ -36,8 +36,9 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ + +#include "mikroe_sht40_config.h" #include "mikroe_sht40.h" -#include "temphum15.h" static temphum15_t temhum15; static temphum15_cfg_t temhum15_cfg; @@ -46,109 +47,105 @@ static temphum15_cfg_t temhum15_cfg; || (mikroe_sht40_precision_mode_medium == x) \ || (mikroe_sht40_precision_mode_low == x)) -sl_status_t mikroe_sht40_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_sht40_init(mikroe_i2c_handle_t instance) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; + if (NULL == instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + temhum15.i2c.handle = instance; + temphum15_cfg_setup(&temhum15_cfg); - if (NULL != i2cspm_instance) { - temhum15.i2c.handle = i2cspm_instance; - temphum15_cfg_setup(&temhum15_cfg); +#if (MIKROE_I2C_SHT40_UC == 1) + temhum15_cfg.i2c_speed = MIKROE_I2C_SHT40_SPEED_MODE; +#endif - if (I2C_MASTER_SUCCESS == temphum15_init(&temhum15, &temhum15_cfg)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } + if (temphum15_init(&temhum15, &temhum15_cfg) != TEMPHUM15_SUCCESS) { + return SL_STATUS_INITIALIZATION; } - return stt; + + return SL_STATUS_OK; } -sl_status_t mikroe_sht40_set_i2csmp_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_sht40_set_i2csmp_instance(mikroe_i2c_handle_t instance) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if (NULL != i2cspm_instance) { - temhum15.i2c.handle = i2cspm_instance; - stt = SL_STATUS_OK; + if (NULL == instance) { + return SL_STATUS_INVALID_PARAMETER; } - return stt; + + temhum15.i2c.handle = instance; + return SL_STATUS_OK; } sl_status_t mikroe_sht40_generic_write(uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if ((NULL != tx_buf)) { - if (I2C_MASTER_SUCCESS == temphum15_generic_write(&temhum15, reg, - tx_buf, tx_len)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } + if ((NULL == tx_buf)) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (TEMPHUM15_SUCCESS != temphum15_generic_write(&temhum15, reg, + tx_buf, tx_len)) { + return SL_STATUS_FAIL; } - return stt; + + return SL_STATUS_OK; } sl_status_t mikroe_sht40_generic_read(uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if ((NULL != rx_buf)) { - if (I2C_MASTER_SUCCESS == temphum15_generic_read(&temhum15, reg, - rx_buf, rx_len)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } + if ((NULL == rx_buf)) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (TEMPHUM15_SUCCESS != temphum15_generic_read(&temhum15, reg, + rx_buf, rx_len)) { + return SL_STATUS_FAIL; } - return stt; + + return SL_STATUS_OK; } sl_status_t mikroe_sht40_get_temp_and_hum( mikroe_sht40_precision_mode_e precision_mode, mikroe_sht40_measurement_data_t *measurement_data) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if ((NULL != measurement_data) && (CHECK_PRECISION_MODE(precision_mode))) { - float temp_val, hum_val; - if (I2C_MASTER_SUCCESS == temphum15_get_temp_and_hum(&temhum15, - precision_mode, - &temp_val, - &hum_val)) { - measurement_data->temperature = temp_val; - measurement_data->humidity = hum_val; - - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } + if ((NULL == measurement_data) || (!CHECK_PRECISION_MODE(precision_mode))) { + return SL_STATUS_INVALID_PARAMETER; } - return stt; + + float temp_val, hum_val; + if (TEMPHUM15_SUCCESS != temphum15_get_temp_and_hum(&temhum15, + precision_mode, + &temp_val, + &hum_val)) { + return SL_STATUS_FAIL; + } + + measurement_data->temperature = temp_val; + measurement_data->humidity = hum_val; + + return SL_STATUS_OK; } sl_status_t mikroe_sht40_soft_reset(void) { - sl_status_t stt = SL_STATUS_FAIL; - - if (I2C_MASTER_SUCCESS == temphum15_soft_reset(&temhum15)) { - stt = SL_STATUS_OK; + if (I2C_MASTER_SUCCESS != temphum15_soft_reset(&temhum15)) { + return SL_STATUS_FAIL; } - return stt; + return SL_STATUS_OK; } sl_status_t mikroe_sht40_read_serial(uint32_t *serial_number) { - sl_status_t stt = SL_STATUS_INVALID_PARAMETER; - - if (NULL != serial_number) { - if (I2C_MASTER_SUCCESS == temphum15_read_serial(&temhum15, serial_number)) { - stt = SL_STATUS_OK; - } else { - stt = SL_STATUS_FAIL; - } + if (NULL == serial_number) { + return SL_STATUS_INVALID_PARAMETER; } - return stt; + + if (TEMPHUM15_SUCCESS != temphum15_read_serial(&temhum15, serial_number)) { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; } diff --git a/driver/public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h b/driver/public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h index 709f76b0..964be96a 100644 --- a/driver/public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h +++ b/driver/public/mikroe/temphum9_shtc3/config/mikroe_shtc3_config.h @@ -45,20 +45,20 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//MIKROE I2C SHTC3 Configuration +// MIKROE SHTC3 I2C Configuration -// MIKROE I2C SHTC3 UC Configuration +// MIKROE SHTC3 I2C UC Configuration // Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). // Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. // Default: 0 -#define MIKROE_I2C_SHTC3_UC 0 +#define MIKROE_SHTC3_I2C_UC 0 -// Speed mode +// Speed mode // <0=> Standard mode (100kbit/s) // <1=> Fast mode (400kbit/s) // <2=> Fast mode plus (1Mbit/s) // Default: 0 -#define MIKROE_I2C_SHTC3_SPEED_MODE 0 +#define MIKROE_SHTC3_I2C_SPEED_MODE 0 // // diff --git a/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c b/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c index aaa391ab..b601c99c 100644 --- a/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c +++ b/driver/public/mikroe/temphum9_shtc3/src/mikroe_shtc3.c @@ -56,8 +56,8 @@ sl_status_t mikroe_shtc3_init(mikroe_i2c_handle_t i2cspm_instance) // Call basic setup functions temphum9_cfg_setup(&temphum9_cfg); -#if (MIKROE_I2C_SHTC3_UC == 1) - temphum9_cfg.i2c_speed = MIKROE_I2C_SHTC3_SPEED_MODE; +#if (MIKROE_SHTC3_I2C_UC == 1) + temphum9_cfg.i2c_speed = MIKROE_SHTC3_I2C_SPEED_MODE; #endif if (temphum9_init(&temphum9, &temphum9_cfg) != TEMPHUM9_OK) { diff --git a/driver/public/mikroe/thunder_as3935/config/brd2703a/mikroe_thunder_as3935_config.h b/driver/public/mikroe/thunder_as3935/config/brd2703a/mikroe_thunder_as3935_config.h index 36033957..a345b486 100644 --- a/driver/public/mikroe/thunder_as3935/config/brd2703a/mikroe_thunder_as3935_config.h +++ b/driver/public/mikroe/thunder_as3935/config/brd2703a/mikroe_thunder_as3935_config.h @@ -39,17 +39,42 @@ #ifndef MIKROE_THUNDER_AS3935_CONFIG_H_ #define MIKROE_THUNDER_AS3935_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> +// MIKROE AS3935 SPI Configuration + +// MIKROE AS3935 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_AS3935_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-2000000> +// Default: 1000000 +#define MIKROE_AS3935_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> -// THUNDER_IRQ -// $[GPIO_THUNDER_IRQ] -#define THUNDER_IRQ_PORT gpioPortB -#define THUNDER_IRQ_PIN 1 -// [GPIO_THUNDER_IRQ]$ +// AS3935_CS +// $[GPIO_AS3935_CS] +#define AS3935_CS_PORT gpioPortC +#define AS3935_CS_PIN 0 +// [GPIO_AS3935_CS]$ + +// AS3935_IRQ +// $[GPIO_AS3935_IRQ] +#define AS3935_IRQ_PORT gpioPortB +#define AS3935_IRQ_PIN 1 +// [GPIO_AS3935_IRQ]$ // <<< sl:end pin_tool >>> @@ -57,4 +82,4 @@ extern "C" { } #endif -#endif /* MIKROE_THUNDER_AS3935_CONFIG_H_ */ +#endif // MIKROE_THUNDER_AS3935_CONFIG_H_ diff --git a/driver/public/mikroe/thunder_as3935/config/brd4108a/mikroe_thunder_as3935_config.h b/driver/public/mikroe/thunder_as3935/config/brd4108a/mikroe_thunder_as3935_config.h index a469dae6..36d12abb 100644 --- a/driver/public/mikroe/thunder_as3935/config/brd4108a/mikroe_thunder_as3935_config.h +++ b/driver/public/mikroe/thunder_as3935/config/brd4108a/mikroe_thunder_as3935_config.h @@ -39,16 +39,41 @@ #ifndef MIKROE_THUNDER_AS3935_CONFIG_H_ #define MIKROE_THUNDER_AS3935_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> +// MIKROE AS3935 SPI Configuration + +// MIKROE AS3935 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_AS3935_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-2000000> +// Default: 1000000 +#define MIKROE_AS3935_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// AS3935_CS +// $[GPIO_AS3935_CS] +#define AS3935_CS_PORT gpioPortC +#define AS3935_CS_PIN 3 +// [GPIO_AS3935_CS]$ + // THUNDER_IRQ // $[GPIO_THUNDER_IRQ] -#define THUNDER_IRQ_PORT gpioPortB -#define THUNDER_IRQ_PIN 3 +#define THUNDER_IRQ_PORT gpioPortB +#define THUNDER_IRQ_PIN 3 // [GPIO_THUNDER_IRQ]$ // <<< sl:end pin_tool >>> @@ -57,4 +82,4 @@ extern "C" { } #endif -#endif /* MIKROE_THUNDER_AS3935_CONFIG_H_ */ +#endif // MIKROE_THUNDER_AS3935_CONFIG_H_ diff --git a/driver/public/mikroe/thunder_as3935/config/brd4314a/mikroe_thunder_as3935_config.h b/driver/public/mikroe/thunder_as3935/config/brd4314a/mikroe_thunder_as3935_config.h index a469dae6..1405676d 100644 --- a/driver/public/mikroe/thunder_as3935/config/brd4314a/mikroe_thunder_as3935_config.h +++ b/driver/public/mikroe/thunder_as3935/config/brd4314a/mikroe_thunder_as3935_config.h @@ -39,17 +39,42 @@ #ifndef MIKROE_THUNDER_AS3935_CONFIG_H_ #define MIKROE_THUNDER_AS3935_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> +// MIKROE AS3935 SPI Configuration + +// MIKROE AS3935 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_AS3935_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-2000000> +// Default: 1000000 +#define MIKROE_AS3935_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> -// THUNDER_IRQ -// $[GPIO_THUNDER_IRQ] -#define THUNDER_IRQ_PORT gpioPortB -#define THUNDER_IRQ_PIN 3 -// [GPIO_THUNDER_IRQ]$ +// AS3935_CS +// $[GPIO_AS3935_CS] +#define AS3935_CS_PORT gpioPortC +#define AS3935_CS_PIN 3 +// [GPIO_AS3935_CS]$ + +// AS3935_IRQ +// $[GPIO_AS3935_IRQ] +#define AS3935_IRQ_PORT gpioPortB +#define AS3935_IRQ_PIN 3 +// [GPIO_AS3935_IRQ]$ // <<< sl:end pin_tool >>> @@ -57,4 +82,4 @@ extern "C" { } #endif -#endif /* MIKROE_THUNDER_AS3935_CONFIG_H_ */ +#endif // MIKROE_THUNDER_AS3935_CONFIG_H_ diff --git a/driver/public/mikroe/e_paper_154_inch/config/brd4108a/mikroe_e_paper_154_inch_config.h b/driver/public/mikroe/thunder_as3935/config/brd4338a/mikroe_thunder_as3935_config.h similarity index 63% rename from driver/public/mikroe/e_paper_154_inch/config/brd4108a/mikroe_e_paper_154_inch_config.h rename to driver/public/mikroe/thunder_as3935/config/brd4338a/mikroe_thunder_as3935_config.h index e6592833..a3e2cd39 100644 --- a/driver/public/mikroe/e_paper_154_inch/config/brd4108a/mikroe_e_paper_154_inch_config.h +++ b/driver/public/mikroe/thunder_as3935/config/brd4338a/mikroe_thunder_as3935_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_e_paper_config.h - * @brief Mikroe E-Paper Configuration + * @file mikroe_thunder_as3935_config.h + * @brief SCL AS3935 Configuration File * @version 1.0.0 ******************************************************************************* * # License @@ -36,48 +36,43 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_E_PAPER_154_INCH_CONFIG_H_ -#define MIKROE_E_PAPER_154_INCH_CONFIG_H_ +#ifndef MIKROE_THUNDER_AS3935_CONFIG_H_ +#define MIKROE_THUNDER_AS3935_CONFIG_H_ #ifdef __cplusplus extern "C" { #endif -#define MIKROE_E_PAPER_WIDTH 200 -#define MIKROE_E_PAPER_HEIGHT 200 - -// A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE AS3935 SPI Configuration + +// MIKROE AS3935 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_AS3935_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-2000000> +// Default: 1000000 +#define MIKROE_AS3935_SPI_BITRATE 1000000 -// ESL MODE setting -// ESL_MODE> Enable Peripheral -// Macro for the ESL mode -#define ESL_MODE 0 // // - -// The block ends with the following line or at the end of the file: // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// E_PAPER_DC -// $[GPIO_E_PAPER_DC] -#define E_PAPER_DC_PORT gpioPortB -#define E_PAPER_DC_PIN 4 -// [GPIO_E_PAPER_DC]$ - -// E_PAPER_RST -// $[GPIO_E_PAPER_RST] -#define E_PAPER_RST_PORT gpioPortC -#define E_PAPER_RST_PIN 6 -// [GPIO_E_PAPER_RST]$ +// AS3935_CS +// $[GPIO_AS3935_CS] +#define AS3935_CS_PORT HP +#define AS3935_CS_PIN 47 +// [GPIO_AS3935_CS]$ -// E_PAPER_BSY -// $[GPIO_E_PAPER_BSY] -#define E_PAPER_BSY_PORT gpioPortB -#define E_PAPER_BSY_PIN 3 -// [GPIO_E_PAPER_BSY]$ +// AS3935_IRQ +// $[GPIO_AS3935_IRQ] +#define AS3935_IRQ_PORT HP +#define AS3935_IRQ_PIN 46 +// [GPIO_AS3935_IRQ]$ // <<< sl:end pin_tool >>> @@ -85,4 +80,4 @@ extern "C" { } #endif -#endif /* MIKROE_E_PAPER_154_INCH_CONFIG_H_ */ +#endif // MIKROE_THUNDER_AS3935_CONFIG_H_ diff --git a/driver/public/mikroe/thunder_as3935/config/other/mikroe_thunder_as3935_config.h b/driver/public/mikroe/thunder_as3935/config/other/mikroe_thunder_as3935_config.h index d09bc2f2..4ebfd4bf 100644 --- a/driver/public/mikroe/thunder_as3935/config/other/mikroe_thunder_as3935_config.h +++ b/driver/public/mikroe/thunder_as3935/config/other/mikroe_thunder_as3935_config.h @@ -39,18 +39,44 @@ #ifndef MIKROE_THUNDER_AS3935_CONFIG_H_ #define MIKROE_THUNDER_AS3935_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> +// MIKROE AS3935 SPI Configuration + +// MIKROE AS3935 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_AS3935_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-2000000> +// Default: 1000000 +#define MIKROE_AS3935_SPI_BITRATE 1000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> -// THUNDER_IRQ -#warning "THUNDER_IRQ is not configured" -// $[GPIO_ML8511A_AN] -// #define THUNDER_IRQ_PORT gpioPortB -// #define THUNDER_IRQ_PIN 1 -// [GPIO_THUNDER_IRQ]$ +// AS3935_CS +// $[GPIO_AS3935_CS] +#warning "AS3935_CS is not configured" +// #define AS3935_CS_PORT 0 +// #define AS3935_CS_PIN 0 +// [GPIO_AS3935_CS]$ + +// AS3935_IRQ +#warning "AS3935_IRQ is not configured" +// $[GPIO_AS3935_AN] +// #define AS3935_IRQ_PORT 0 +// #define AS3935_IRQ_PIN 0 +// [GPIO_AS3935_IRQ]$ // <<< sl:end pin_tool >>> @@ -58,4 +84,4 @@ extern "C" { } #endif -#endif /* MIKROE_THUNDER_AS3935_CONFIG_H_ */ +#endif // MIKROE_THUNDER_AS3935_CONFIG_H_ diff --git a/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h b/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h index 2b795345..51a90e66 100644 --- a/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h +++ b/driver/public/mikroe/thunder_as3935/inc/mikroe_thunder_as3935.h @@ -42,11 +42,8 @@ // ----------------------------------------------------------------------------- // Includes // ----------------------------------------------------------------------------- - #include "sl_status.h" -#include "spidrv.h" #include "thunder.h" -#include "mikroe_thunder_as3935_config.h" #ifdef __cplusplus extern "C" { @@ -67,7 +64,21 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_thunder_as3935_init(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_thunder_as3935_init(mikroe_spi_handle_t spi_instance); + +/***************************************************************************//** + * @brief + * Thunder click set instance. + * + * @param[in] spi_instance + * SPI instance. + * + * @return + * SL_STATUS_OK Successful initialization. + * SL_STATUS_FAIL Initialization failed. + ******************************************************************************/ +sl_status_t mikroe_thunder_as3935_set_spi_instance( + mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/thunder_as3935/src/mikroe_thunder_as3935.c b/driver/public/mikroe/thunder_as3935/src/mikroe_thunder_as3935.c index 1b831268..3298360a 100644 --- a/driver/public/mikroe/thunder_as3935/src/mikroe_thunder_as3935.c +++ b/driver/public/mikroe/thunder_as3935/src/mikroe_thunder_as3935.c @@ -41,7 +41,7 @@ // Includes // ----------------------------------------------------------------------------- #include "mikroe_thunder_as3935.h" -#include "third_party_hw_drivers_helpers.h" +#include "mikroe_thunder_as3935_config.h" // ----------------------------------------------------------------------------- // Local Variables @@ -57,10 +57,8 @@ static bool initialized = false; /**************************************************************************//** * Thunder click initialization. ******************************************************************************/ -sl_status_t mikroe_thunder_as3935_init(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_thunder_as3935_init(mikroe_spi_handle_t spi_instance) { - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - if (spi_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } @@ -72,17 +70,46 @@ sl_status_t mikroe_thunder_as3935_init(SPIDRV_Handle_t spi_instance) thunder_ctx.spi.handle = spi_instance; thunder_cfg_setup(&thunder_cfg); - thunder_cfg.irq = hal_gpio_pin_name(THUNDER_IRQ_PORT, THUNDER_IRQ_PIN); - thunder_cfg.cs = hal_gpio_pin_name(spi_instance->portCs, spi_instance->pinCs); - GPIO_PinModeSet(spi_instance->portCs, - spi_instance->pinCs, - gpioModePushPull, - 1); + thunder_cfg.spi_speed = 1000000; + +#if defined(AS3935_IRQ_PORT) && defined(AS3935_IRQ_PIN) + thunder_cfg.irq = hal_gpio_pin_name(AS3935_IRQ_PORT, AS3935_IRQ_PIN); +#endif + +#if defined(AS3935_CS_PORT) && defined(AS3935_CS_PIN) + thunder_cfg.cs = hal_gpio_pin_name(AS3935_CS_PORT, AS3935_CS_PIN); + // CS pin need to init here since the mikroe_sdk_v2 missed this step + digital_out_t struct_cs; + digital_out_init(&struct_cs, thunder_cfg.cs); +#endif - THIRD_PARTY_HW_DRV_RETCODE_TEST(thunder_init(&thunder_ctx, &thunder_cfg)); +#if (MIKROE_AS3935_SPI_UC == 1) + thunder_cfg.spi_speed = MIKROE_AS3935_SPI_BITRATE; +#endif + + if (thunder_init(&thunder_ctx, &thunder_cfg) != THUNDER_OK) { + return SL_STATUS_INITIALIZATION; + } initialized = true; - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; +} + +/**************************************************************************//** +* Thunder click set instance. +******************************************************************************/ +sl_status_t mikroe_thunder_as3935_set_spi_instance( + mikroe_spi_handle_t spi_instance) +{ + if (!initialized) { + return SL_STATUS_NOT_INITIALIZED; + } + if (NULL == spi_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + thunder_ctx.spi.handle = spi_instance; + + return SL_STATUS_OK; } /**************************************************************************//** diff --git a/driver/public/mikroe/turbidity_tsd10/config/mikroe_tsd10_config.h b/driver/public/mikroe/turbidity_tsd10/config/mikroe_tsd10_config.h new file mode 100644 index 00000000..661936d3 --- /dev/null +++ b/driver/public/mikroe/turbidity_tsd10/config/mikroe_tsd10_config.h @@ -0,0 +1,70 @@ +/***************************************************************************/ /** + * @file mikroe_tsd10_config.h + * @brief Mikroe TSD10 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_TSD10_CONFIG_H +#define MIKROE_TSD10_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE I2C TSD10 Configuration + +// MIKROE I2C TSD10 UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_I2C_TSD10_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_I2C_TSD10_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_TSD10_CONFIG_H diff --git a/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h b/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h index ac7694a7..e8be6524 100644 --- a/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h +++ b/driver/public/mikroe/turbidity_tsd10/inc/mikroe_tsd10.h @@ -41,11 +41,12 @@ #define MIKROE_TURBIDITY_H #include "sl_status.h" -#include "sl_i2cspm.h" -#include "drv_digital_out.h" -#include "drv_digital_in.h" #include "drv_i2c_master.h" +#ifdef __cplusplus +extern "C" { +#endif + /*! * @addtogroup turbidity Turbidity Click Driver * @brief API for configuring and manipulating Turbidity Click driver. @@ -65,7 +66,7 @@ * SL_STATUS_INVALID_PARAMETER if i2cspm_instance is null * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_turbidity_init (sl_i2cspm_t *i2cspm_instance); +sl_status_t mikroe_turbidity_init (mikroe_i2c_handle_t i2cspm_instance); /******************************************************************************* * @brief @@ -126,4 +127,8 @@ sl_status_t mikroe_turbidity_get_adc_voltage (float *voltage); ******************************************************************************/ sl_status_t mikroe_turbidity_get_ntu (float *ntu); +#ifdef __cplusplus +} +#endif + #endif // MIKROE_TURBIDITY_H diff --git a/driver/public/mikroe/turbidity_tsd10/src/mikroe_tsd10.c b/driver/public/mikroe/turbidity_tsd10/src/mikroe_tsd10.c index eb9543d2..4c54056d 100644 --- a/driver/public/mikroe/turbidity_tsd10/src/mikroe_tsd10.c +++ b/driver/public/mikroe/turbidity_tsd10/src/mikroe_tsd10.c @@ -39,25 +39,29 @@ #include "turbidity.h" #include "mikroe_tsd10.h" +#include "mikroe_tsd10_config.h" static turbidity_t turbi; static turbidity_cfg_t turbi_cfg; -sl_status_t mikroe_turbidity_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t mikroe_turbidity_init(mikroe_i2c_handle_t i2cspm_instance) { - sl_status_t retval = SL_STATUS_INVALID_PARAMETER; + if (NULL == i2cspm_instance) { + return SL_STATUS_INVALID_PARAMETER; + } - if (NULL != i2cspm_instance) { - turbi.i2c.handle = i2cspm_instance; - turbidity_cfg_setup(&turbi_cfg); + turbi.i2c.handle = i2cspm_instance; + turbidity_cfg_setup(&turbi_cfg); - if (I2C_MASTER_SUCCESS == turbidity_init(&turbi, &turbi_cfg)) { - retval = SL_STATUS_OK; - } else { - retval = SL_STATUS_FAIL; - } +#if (MIKROE_I2C_TSD10_UC == 1) + turbi_cfg.i2c_speed = MIKROE_I2C_TSD10_SPEED_MODE; +#endif + + if (I2C_MASTER_SUCCESS != turbidity_init(&turbi, &turbi_cfg)) { + return SL_STATUS_INITIALIZATION; } - return retval; + + return SL_STATUS_OK; } sl_status_t mikroe_turbidity_generic_read(uint8_t *rx_buf, uint8_t rx_len) diff --git a/driver/public/mikroe/utm7segr_max6969/config/utm7segr_max6969_config.h b/driver/public/mikroe/utm7segr_max6969/config/utm7segr_max6969_config.h new file mode 100644 index 00000000..9b28e497 --- /dev/null +++ b/driver/public/mikroe/utm7segr_max6969/config/utm7segr_max6969_config.h @@ -0,0 +1,81 @@ +/***************************************************************************//** + * @file utm7segr_max6969_config.h + * @brief utm7segr max6969 config + * @version 0.0.1 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MAX6969_CONFIG_H_ +#define MAX6969_CONFIG_H_ + +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_MAX6969 SPI Configuration + +// MIKROE_MAX6969 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_MAX6969_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_MAX6969_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_MAX6969_CS +// $[GPIO_MIKROE_MAX6969_CS] +// #define MIKROE_MAX6969_CS_PORT 0 +// #define MIKROE_MAX6969_CS_PIN 0 +// [GPIO_MIKROE_MAX6969_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif // MAX6969_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/mikroe/utm7segr_max6969/inc/mikroe_max6969.h b/driver/public/mikroe/utm7segr_max6969/inc/mikroe_max6969.h index ee8711d3..d7512ca5 100644 --- a/driver/public/mikroe/utm7segr_max6969/inc/mikroe_max6969.h +++ b/driver/public/mikroe/utm7segr_max6969/inc/mikroe_max6969.h @@ -4,7 +4,7 @@ * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -28,21 +28,18 @@ * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef MIKROE_MAX6969_H_ #define MIKROE_MAX6969_H_ #include "sl_status.h" -#include "spidrv.h" -#include "sl_pwm.h" +#include "drv_spi_master.h" +#include "drv_pwm.h" #include "utm7segr.h" #ifdef __cplusplus @@ -93,6 +90,8 @@ extern "C" { #define MIKROE_UTM7SEGR_DISPLAY_ON 0x01 #define MIKROE_UTM7SEGR_DISPLAY_OFF 0x00 +#define MIKROE_UTM7SEGR_PWM_FREQUENCY (10000) + /** @} (end addtogroup mikroe_buzz2_freq) */ /***************************************************************************//** @@ -109,8 +108,8 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_max6969_init(SPIDRV_Handle_t spi_instance, - sl_pwm_instance_t *pwm_instance); +sl_status_t mikroe_max6969_init(mikroe_spi_handle_t spi_instance, + mikroe_pwm_handle_t pwm_instance); /***************************************************************************//** * @brief @@ -137,7 +136,7 @@ void mikroe_max6969_set_contrast(uint8_t percent); * SL_STATUS_OK if there are no errors * SL_STATUS_INVALID_PARAMETER if spi_instance is null ******************************************************************************/ -sl_status_t mikroe_max6969_set_spi_instance(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_max6969_set_spi_instance(mikroe_spi_handle_t spi_instance); /***************************************************************************//** * @brief @@ -150,7 +149,7 @@ sl_status_t mikroe_max6969_set_spi_instance(SPIDRV_Handle_t spi_instance); * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if pwm_instance is null. ******************************************************************************/ -sl_status_t mikroe_max6969_set_pwm_instance(sl_pwm_instance_t *pwm_instance); +sl_status_t mikroe_max6969_set_pwm_instance(mikroe_pwm_handle_t pwm_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/utm7segr_max6969/src/mikroe_max6969.c b/driver/public/mikroe/utm7segr_max6969/src/mikroe_max6969.c index 695eab2e..afcf2c5c 100644 --- a/driver/public/mikroe/utm7segr_max6969/src/mikroe_max6969.c +++ b/driver/public/mikroe/utm7segr_max6969/src/mikroe_max6969.c @@ -4,7 +4,7 @@ * @version 1.0.0 ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -28,34 +28,31 @@ * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * + * # Experimental Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #include "utm7segr.h" #include "mikroe_max6969.h" -#include "third_party_hw_drivers_helpers.h" +#include "utm7segr_max6969_config.h" static utm7segr_t utm7segr; static utm7segr_cfg_t utm7segr_cfg; -static sl_pwm_instance_t *utm7segr_pwm_instance; +static pwm_t utm7segr_pwm_instance; -sl_status_t mikroe_max6969_init(SPIDRV_Handle_t spi_instance, - sl_pwm_instance_t *pwm_instance) +sl_status_t mikroe_max6969_init(mikroe_spi_handle_t spi_instance, + mikroe_pwm_handle_t pwm_instance) { + sl_status_t stt = SL_STATUS_OK; + if ((NULL == spi_instance) || (NULL == pwm_instance)) { return SL_STATUS_INVALID_PARAMETER; } - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - // update instance for pwm - utm7segr_pwm_instance = pwm_instance; + utm7segr_pwm_instance.handle = pwm_instance; // Configure default spi instance utm7segr.spi.handle = spi_instance; @@ -63,17 +60,38 @@ sl_status_t mikroe_max6969_init(SPIDRV_Handle_t spi_instance, // Call basic setup functions utm7segr_cfg_setup(&utm7segr_cfg); +#if (MIKROE_MAX6969_SPI_UC == 1) + utm7segr_cfg.spi_speed = MIKROE_MAX6969_SPI_BITRATE; +#endif + +#if defined(MIKROE_MAX6969_CS_PORT) && defined(MIKROE_MAX6969_CS_PIN) + utm7segr_cfg.cs = hal_gpio_pin_name(MIKROE_MAX6969_CS_PORT, + MIKROE_MAX6969_CS_PIN); + // CS pin need to init here since the mikroe_sdk_v2 missed this step + digital_out_t struct_cs; + digital_out_init(&struct_cs, utm7segr_cfg.cs); +#endif + + if (utm7segr_init(&utm7segr, &utm7segr_cfg) != UTM7SEGR_OK) { + stt = SL_STATUS_INITIALIZATION; + } + + pwm_config_t cfg_pwm; + pwm_configure_default(&cfg_pwm); + + pwm_open(&utm7segr_pwm_instance, &cfg_pwm); + pwm_set_freq(&utm7segr_pwm_instance, MIKROE_UTM7SEGR_PWM_FREQUENCY); + // Start pwm - sl_pwm_start(utm7segr_pwm_instance); + pwm_start(&utm7segr_pwm_instance); + // Set the light intensity of LED 7-segment to 50% mikroe_max6969_set_contrast(50); - THIRD_PARTY_HW_DRV_RETCODE_TEST(utm7segr_init(&utm7segr, &utm7segr_cfg)); - - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return stt; } -sl_status_t mikroe_max6969_set_spi_instance(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_max6969_set_spi_instance(mikroe_spi_handle_t spi_instance) { if (NULL == spi_instance) { return SL_STATUS_INVALID_PARAMETER; @@ -84,14 +102,14 @@ sl_status_t mikroe_max6969_set_spi_instance(SPIDRV_Handle_t spi_instance) return SL_STATUS_OK; } -sl_status_t mikroe_max6969_set_pwm_instance(sl_pwm_instance_t *pwm_instance) +sl_status_t mikroe_max6969_set_pwm_instance(mikroe_pwm_handle_t pwm_instance) { if (NULL == pwm_instance) { return SL_STATUS_INVALID_PARAMETER; } // update instance for pwm - utm7segr_pwm_instance = pwm_instance; + utm7segr_pwm_instance.handle = pwm_instance; return SL_STATUS_OK; } @@ -99,7 +117,7 @@ sl_status_t mikroe_max6969_set_pwm_instance(sl_pwm_instance_t *pwm_instance) void mikroe_max6969_set_contrast(uint8_t percent) { // Set duty cycle - sl_pwm_set_duty_cycle(utm7segr_pwm_instance, percent); + pwm_set_duty(&utm7segr_pwm_instance, (float)(percent / 100.0)); } sl_status_t mikroe_max6969_generic_write(uint8_t *data_in) diff --git a/driver/public/mikroe/uv_ml8511a/config/brd2703a/mikroe_ml8511a_config.h b/driver/public/mikroe/uv_ml8511a/config/brd2703a/mikroe_ml8511a_config.h index fa313f6f..b173d929 100644 --- a/driver/public/mikroe/uv_ml8511a/config/brd2703a/mikroe_ml8511a_config.h +++ b/driver/public/mikroe/uv_ml8511a/config/brd2703a/mikroe_ml8511a_config.h @@ -39,12 +39,50 @@ #ifndef MIKROE_ML8511A_CONFIG_H_ #define MIKROE_ML8511A_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +#define ADC_MODE 0 +#define AN_MODE 1 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE_ML8511A SPI Configuration + +// MIKROE_ML8511A SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_ML8511A_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_ML8511A_SPI_BITRATE 10000000 + +// +// + +//MIKROE ML8511A Configuration +// Operation mode +// Analog mode +// ADC mode +// Default: AN_MODE +#define MIKROE_ML8511A_OPERATION_MODE AN_MODE + +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// ML8511A_CS +// $[GPIO_ML8511A_CS] +// #define ML8511A_CS_PORT 0 +// #define ML8511A_CS_PIN 0 +// [GPIO_ML8511A_CS]$ + // ML8511A_AN // $[GPIO_ML8511A_AN] #define ML8511A_AN_PORT gpioPortB diff --git a/driver/public/mikroe/uv_ml8511a/config/brd4108a/mikroe_ml8511a_config.h b/driver/public/mikroe/uv_ml8511a/config/brd4108a/mikroe_ml8511a_config.h index 7d19951f..8fb72a0c 100644 --- a/driver/public/mikroe/uv_ml8511a/config/brd4108a/mikroe_ml8511a_config.h +++ b/driver/public/mikroe/uv_ml8511a/config/brd4108a/mikroe_ml8511a_config.h @@ -39,12 +39,50 @@ #ifndef MIKROE_ML8511A_CONFIG_H_ #define MIKROE_ML8511A_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +#define ADC_MODE 0 +#define AN_MODE 1 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE_ML8511A SPI Configuration + +// MIKROE_ML8511A SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_ML8511A_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_ML8511A_SPI_BITRATE 10000000 + +// +// + +//MIKROE ML8511A Configuration +// Operation mode +// Analog mode +// ADC mode +// Default: AN_MODE +#define MIKROE_ML8511A_OPERATION_MODE AN_MODE + +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// ML8511A_CS +// $[GPIO_ML8511A_CS] +// #define ML8511A_CS_PORT 0 +// #define ML8511A_CS_PIN 0 +// [GPIO_ML8511A_CS]$ + // ML8511A_AN // $[GPIO_ML8511A_AN] #define ML8511A_AN_PORT gpioPortB diff --git a/driver/public/mikroe/uv_ml8511a/config/brd4314a/mikroe_ml8511a_config.h b/driver/public/mikroe/uv_ml8511a/config/brd4314a/mikroe_ml8511a_config.h index 7d19951f..d6ebef49 100644 --- a/driver/public/mikroe/uv_ml8511a/config/brd4314a/mikroe_ml8511a_config.h +++ b/driver/public/mikroe/uv_ml8511a/config/brd4314a/mikroe_ml8511a_config.h @@ -39,22 +39,60 @@ #ifndef MIKROE_ML8511A_CONFIG_H_ #define MIKROE_ML8511A_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif +#define ADC_MODE 0 +#define AN_MODE 1 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE_ML8511A SPI Configuration + +// MIKROE_ML8511A SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_ML8511A_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_ML8511A_SPI_BITRATE 10000000 + +// +// + +//MIKROE ML8511A Configuration +// Operation mode +// Analog mode +// ADC mode +// Default: AN_MODE +#define MIKROE_ML8511A_OPERATION_MODE AN_MODE + +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// ML8511A_CS +// $[GPIO_ML8511A_CS] +// #define ML8511A_CS_PORT 0 +// #define ML8511A_CS_PIN 0 +// [GPIO_ML8511A_CS]$ + // ML8511A_AN // $[GPIO_ML8511A_AN] -#define ML8511A_AN_PORT gpioPortB -#define ML8511A_AN_PIN 0 +#define ML8511A_AN_PORT gpioPortB +#define ML8511A_AN_PIN 0 // [GPIO_ML8511A_AN]$ // ML8511A_EN // $[GPIO_ML8511A_EN] -#define ML8511A_EN_PORT gpioPortC -#define ML8511A_EN_PIN 6 +#define ML8511A_EN_PORT gpioPortC +#define ML8511A_EN_PIN 6 // [GPIO_ML8511A_EN]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/uv_ml8511a/config/brd4338a/mikroe_ml8511a_config.h b/driver/public/mikroe/uv_ml8511a/config/brd4338a/mikroe_ml8511a_config.h new file mode 100644 index 00000000..b92f0e6b --- /dev/null +++ b/driver/public/mikroe/uv_ml8511a/config/brd4338a/mikroe_ml8511a_config.h @@ -0,0 +1,96 @@ +/***************************************************************************//** + * @file mikroe_ml8511a_config.h + * @brief SCL ML8511A Configuration File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_ML8511A_CONFIG_H_ +#define MIKROE_ML8511A_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define ADC_MODE 0 +#define AN_MODE 1 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE_ML8511A SPI Configuration + +// MIKROE_ML8511A SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_ML8511A_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_ML8511A_SPI_BITRATE 10000000 + +// +// + +//MIKROE ML8511A Configuration +// Operation mode +// Analog mode +// ADC mode +// Default: AN_MODE +#define MIKROE_ML8511A_OPERATION_MODE AN_MODE + +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ML8511A_CS +// $[GPIO_ML8511A_CS] +// #define ML8511A_CS_PORT 0 +// #define ML8511A_CS_PIN 0 +// [GPIO_ML8511A_CS]$ + +// ML8511A_EN +// $[GPIO_ML8511A_EN] +#define ML8511A_EN_PORT HP +#define ML8511A_EN_PIN 46 +// [GPIO_ML8511A_EN]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* MIKROE_ML8511A_CONFIG_H_ */ diff --git a/driver/public/mikroe/uv_ml8511a/config/other/mikroe_ml8511a_config.h b/driver/public/mikroe/uv_ml8511a/config/other/mikroe_ml8511a_config.h index a4492d4f..6d999284 100644 --- a/driver/public/mikroe/uv_ml8511a/config/other/mikroe_ml8511a_config.h +++ b/driver/public/mikroe/uv_ml8511a/config/other/mikroe_ml8511a_config.h @@ -39,12 +39,52 @@ #ifndef MIKROE_ML8511A_CONFIG_H_ #define MIKROE_ML8511A_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif +#define ADC_MODE 0 +#define ANALOG_MODE 1 + +// <<< Use Configuration Wizard in Context Menu >>> + +// MIKROE_ML8511A SPI Configuration + +// MIKROE_ML8511A SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_ML8511A_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_ML8511A_SPI_BITRATE 10000000 + +// +// + +//MIKROE ML8511A Configuration +// Operation mode +// Analog mode +// ADC mode +// Default: AN_MODE +#define MIKROE_ML8511A_OPERATION_MODE AN_MODE + +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> +// ML8511A_CS +// $[GPIO_ML8511A_CS] +// #define ML8511A_CS_PORT 0 +// #define ML8511A_CS_PIN 0 +// [GPIO_ML8511A_CS]$ + // ML8511A_AN #warning "GPIO_ML8511A_AN is not configured" // $[GPIO_ML8511A_AN] diff --git a/driver/public/mikroe/uv_ml8511a/inc/mikroe_ml8511a.h b/driver/public/mikroe/uv_ml8511a/inc/mikroe_ml8511a.h index b7381c81..581d8b2d 100644 --- a/driver/public/mikroe/uv_ml8511a/inc/mikroe_ml8511a.h +++ b/driver/public/mikroe/uv_ml8511a/inc/mikroe_ml8511a.h @@ -44,7 +44,9 @@ // ----------------------------------------------------------------------------- #include "uv.h" -#include "spidrv.h" +#include "sl_status.h" +#include "drv_analog_in.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -65,7 +67,8 @@ extern "C" { * SL_STATUS_OK Successful initialization. * SL_STATUS_FAIL Initialization failed. ******************************************************************************/ -sl_status_t mikroe_ml8511a_init(SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_ml8511a_init(mikroe_spi_handle_t spi_instance, + mikroe_adc_handle_t adc_instance); /***************************************************************************//** * @brief diff --git a/driver/public/mikroe/uv_ml8511a/src/mikroe_ml8511a.c b/driver/public/mikroe/uv_ml8511a/src/mikroe_ml8511a.c index a46fbc73..cb94cee8 100644 --- a/driver/public/mikroe/uv_ml8511a/src/mikroe_ml8511a.c +++ b/driver/public/mikroe/uv_ml8511a/src/mikroe_ml8511a.c @@ -42,7 +42,6 @@ // ----------------------------------------------------------------------------- #include "mikroe_ml8511a.h" -#include "third_party_hw_drivers_helpers.h" #include "mikroe_ml8511a_config.h" // ----------------------------------------------------------------------------- @@ -60,28 +59,50 @@ static bool initialized = false; /**************************************************************************//** * ML8511A initialization. ******************************************************************************/ -sl_status_t mikroe_ml8511a_init(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_ml8511a_init(mikroe_spi_handle_t spi_instance, + mikroe_adc_handle_t adc_instance) { - THIRD_PARTY_HW_DRV_RETCODE_INIT(); - if (spi_instance == NULL) { return SL_STATUS_INVALID_PARAMETER; } + if (adc_instance == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + if (initialized) { return SL_STATUS_ALREADY_INITIALIZED; } uv_ctx.spi.handle = spi_instance; + uv_ctx.an.handle = adc_instance; uv_cfg_setup(&uv_cfg); +#if defined(ML8511A_AN_PORT) && defined(ML8511A_AN_PIN) uv_cfg.an = hal_gpio_pin_name(ML8511A_AN_PORT, ML8511A_AN_PIN); +#endif + +#if MIKROE_ML8511A_OPERATION_MODE == ADC_MODE +#if defined(ML8511A_CS_PORT) && defined(ML8511A_CS_PIN) + uv_cfg.cs = hal_gpio_pin_name(ML8511A_CS_PORT, ML8511A_CS_PIN); + // CS pin need to init here since the mikroe_sdk_v2 missed this step + digital_out_t struct_cs; + digital_out_init(&struct_cs, uv_cfg.cs); +#endif + +#if (MIKROE_ML8511A_SPI_UC == 1) + uv_cfg.spi_speed = MIKROE_ML8511A_SPI_BITRATE; +#endif +#endif + uv_cfg.en = hal_gpio_pin_name(ML8511A_EN_PORT, ML8511A_EN_PIN); - THIRD_PARTY_HW_DRV_RETCODE_TEST(uv_init(&uv_ctx, &uv_cfg)); + if (uv_init(&uv_ctx, &uv_cfg) != SPI_MASTER_SUCCESS) { + return SL_STATUS_INITIALIZATION; + } initialized = true; - return THIRD_PARTY_HW_DRV_RETCODE_VALUE; + return SL_STATUS_OK; } /**************************************************************************//** diff --git a/driver/public/mikroe/uwb_dwm1000/config/brd2703a/mikroe_uwb_dwm1000_config.h b/driver/public/mikroe/uwb_dwm1000/config/brd2703a/mikroe_uwb_dwm1000_config.h index 70298fac..00e01158 100644 --- a/driver/public/mikroe/uwb_dwm1000/config/brd2703a/mikroe_uwb_dwm1000_config.h +++ b/driver/public/mikroe/uwb_dwm1000/config/brd2703a/mikroe_uwb_dwm1000_config.h @@ -38,13 +38,27 @@ ******************************************************************************/ #ifndef DWM1000_CONFIG_H_ #define DWM1000_CONFIG_H_ +#include "em_gpio.h" #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +//UWB_DWM1000 SPI Configuration +// UWB_DWM1000 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define UWB_DWM1000_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define UWB_DWM1000_SPI_BITRATE 10000000 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> diff --git a/driver/public/mikroe/uwb_dwm1000/config/brd4108a/mikroe_uwb_dwm1000_config.h b/driver/public/mikroe/uwb_dwm1000/config/brd4108a/mikroe_uwb_dwm1000_config.h index 70298fac..109bb8c4 100644 --- a/driver/public/mikroe/uwb_dwm1000/config/brd4108a/mikroe_uwb_dwm1000_config.h +++ b/driver/public/mikroe/uwb_dwm1000/config/brd4108a/mikroe_uwb_dwm1000_config.h @@ -38,13 +38,27 @@ ******************************************************************************/ #ifndef DWM1000_CONFIG_H_ #define DWM1000_CONFIG_H_ +#include "em_gpio.h" #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +//UWB_DWM1000 SPI Configuration +// UWB_DWM1000 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define UWB_DWM1000_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define UWB_DWM1000_SPI_BITRATE 10000000 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -52,13 +66,13 @@ extern "C" { // DWM1000_RESET // $[GPIO_DWM1000_RESET] #define DWM1000_RESET_PORT gpioPortC -#define DWM1000_RESET_PIN 8 +#define DWM1000_RESET_PIN 6 // [GPIO_DWM1000_RESET]$ // DWM1000_INT // $[GPIO_DWM1000_INT] #define DWM1000_INT_PORT gpioPortB -#define DWM1000_INT_PIN 1 +#define DWM1000_INT_PIN 3 // [GPIO_DWM1000_INT]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/uwb_dwm1000/config/brd4314a/mikroe_uwb_dwm1000_config.h b/driver/public/mikroe/uwb_dwm1000/config/brd4314a/mikroe_uwb_dwm1000_config.h index 70298fac..109bb8c4 100644 --- a/driver/public/mikroe/uwb_dwm1000/config/brd4314a/mikroe_uwb_dwm1000_config.h +++ b/driver/public/mikroe/uwb_dwm1000/config/brd4314a/mikroe_uwb_dwm1000_config.h @@ -38,13 +38,27 @@ ******************************************************************************/ #ifndef DWM1000_CONFIG_H_ #define DWM1000_CONFIG_H_ +#include "em_gpio.h" #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +//UWB_DWM1000 SPI Configuration +// UWB_DWM1000 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define UWB_DWM1000_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define UWB_DWM1000_SPI_BITRATE 10000000 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -52,13 +66,13 @@ extern "C" { // DWM1000_RESET // $[GPIO_DWM1000_RESET] #define DWM1000_RESET_PORT gpioPortC -#define DWM1000_RESET_PIN 8 +#define DWM1000_RESET_PIN 6 // [GPIO_DWM1000_RESET]$ // DWM1000_INT // $[GPIO_DWM1000_INT] #define DWM1000_INT_PORT gpioPortB -#define DWM1000_INT_PIN 1 +#define DWM1000_INT_PIN 3 // [GPIO_DWM1000_INT]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/mikroe/uwb_dwm1000/config/brd4338a/mikroe_uwb_dwm1000_config.h b/driver/public/mikroe/uwb_dwm1000/config/brd4338a/mikroe_uwb_dwm1000_config.h new file mode 100644 index 00000000..9bc8860a --- /dev/null +++ b/driver/public/mikroe/uwb_dwm1000/config/brd4338a/mikroe_uwb_dwm1000_config.h @@ -0,0 +1,102 @@ +/***************************************************************************//** + * @file dwm1000_config.h + * @brief DWM1000 UWB config. + * @version 0.0.1 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef DWM1000_CONFIG_H_ +#define DWM1000_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +//UWB_DWM1000 SPI Configuration + +// UWB_DWM1000 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define UWB_DWM1000_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define UWB_DWM1000_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DWM1000_RESET +// $[GPIO_DWM1000_RESET] +#ifndef DWM1000_RESET_PORT +#define DWM1000_RESET_PORT HP +#endif +#ifndef DWM1000_RESET_PIN +#define DWM1000_RESET_PIN 46 +#endif +// [GPIO_DWM1000_RESET]$ + +// DWM1000_INT +// $[GPIO_DWM1000_INT] +#ifndef DWM1000_INT_PORT +#define DWM1000_INT_PORT HP +#endif +#ifndef DWM1000_INT_PIN +#define DWM1000_INT_PIN 47 +#endif +// [GPIO_DWM1000_INT]$ + +// DWM1000_SPI_CS +// $[GPIO_DWM1000_SPI_CS] +#ifndef DWM1000_SPI_CS_PORT +#define DWM1000_SPI_CS_PORT HP +#endif +#ifndef DWM1000_SPI_CS_PIN +#define DWM1000_SPI_CS_PIN 48 +#endif +// [GPIO_DWM1000_SPI_CS]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif /* DWM1000_CONFIG_H_ */ + diff --git a/driver/public/mikroe/uwb_dwm1000/config/other/mikroe_uwb_dwm1000_config.h b/driver/public/mikroe/uwb_dwm1000/config/other/mikroe_uwb_dwm1000_config.h index 70298fac..532269c1 100644 --- a/driver/public/mikroe/uwb_dwm1000/config/other/mikroe_uwb_dwm1000_config.h +++ b/driver/public/mikroe/uwb_dwm1000/config/other/mikroe_uwb_dwm1000_config.h @@ -44,23 +44,44 @@ extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> +//UWB_DWM1000 SPI Configuration +// UWB_DWM1000 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define UWB_DWM1000_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define UWB_DWM1000_SPI_BITRATE 10000000 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> // DWM1000_RESET // $[GPIO_DWM1000_RESET] -#define DWM1000_RESET_PORT gpioPortC -#define DWM1000_RESET_PIN 8 +#warning "GPIO_DWM1000_RESET pin for DWM1000 is not configured" +// #define DWM1000_RESET_PORT gpioPortC +// #define DWM1000_RESET_PIN 8 // [GPIO_DWM1000_RESET]$ // DWM1000_INT // $[GPIO_DWM1000_INT] -#define DWM1000_INT_PORT gpioPortB -#define DWM1000_INT_PIN 1 +#warning "GPIO_DWM1000_INT pin for DWM1000 is not configured" +// #define DWM1000_INT_PORT gpioPortB +// #define DWM1000_INT_PIN 1 // [GPIO_DWM1000_INT]$ +// DWM1000_SPI_CS +// $[DWM1000_SPI_CS] +#warning "DWM1000_SPI_CS pin for DWM1000 is not configured" +// #define DWM1000_SPI_CS_PORT 0 +// #define DWM1000_SPI_CS_PIN 48 +// [DWM1000_SPI_CS]$ // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/mikroe/uwb_dwm1000/inc/mikroe_uwb_dwm1000.h b/driver/public/mikroe/uwb_dwm1000/inc/mikroe_uwb_dwm1000.h index 90c7ea83..a87440a6 100644 --- a/driver/public/mikroe/uwb_dwm1000/inc/mikroe_uwb_dwm1000.h +++ b/driver/public/mikroe/uwb_dwm1000/inc/mikroe_uwb_dwm1000.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_l9958.h - * @brief SCL L9958 Prototypes + * @file mikroe_uwb_dwm1000.h + * @brief mikroe uwb dwm1000 header file * @version 1.0.0 ******************************************************************************* * # License @@ -41,8 +41,8 @@ #define _MIKROE_MIKROE_DWM1000_DWM1000_H #include "sl_status.h" -#include "spidrv.h" #include "stdint.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -289,7 +289,7 @@ extern const uint8_t MIKROE_DWM1000_TMODE_SHORTDATA_FAST_ACCURACY[3]; * SL_STATUS_FAIL Initialization failed. * SL_STATUS_NULL_POINTER if spi_instance is null. ******************************************************************************/ -sl_status_t mikroe_dwm1000_init (SPIDRV_Handle_t spi_instance); +sl_status_t mikroe_dwm1000_init (mikroe_spi_handle_t spi_instance); /** * @brief Function for writing data to register diff --git a/driver/public/mikroe/uwb_dwm1000/src/mikroe_uwb_dwm1000.c b/driver/public/mikroe/uwb_dwm1000/src/mikroe_uwb_dwm1000.c index cdd49f99..8a86d090 100644 --- a/driver/public/mikroe/uwb_dwm1000/src/mikroe_uwb_dwm1000.c +++ b/driver/public/mikroe/uwb_dwm1000/src/mikroe_uwb_dwm1000.c @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_l9958.C - * @brief SCL L9958 Driver + * @file mikroe_uwb_dwm1000.c + * @brief mikroe uwb dwm1000 source file * @version 1.0.0 ******************************************************************************* * # License @@ -42,6 +42,10 @@ #include "mikroe_uwb_dwm1000_config.h" #include "third_party_hw_drivers_helpers.h" +#if (defined(SLI_SI917)) +#else +#include "sl_spidrv_mikroe_config.h" +#endif // ------------------------------------------------------------- PRIVATE MACROS #define MIKROE_DWM1000_DUMMY 0 @@ -76,8 +80,9 @@ const uint8_t MIKROE_DWM1000_TMODE_SHORTDATA_FAST_ACCURACY[3] static uwb_t uwb; static uwb_cfg_t uwb_cfg; static bool initialized = false; +static digital_out_t cs_out; -sl_status_t mikroe_dwm1000_init(SPIDRV_Handle_t spi_instance) +sl_status_t mikroe_dwm1000_init(mikroe_spi_handle_t spi_instance) { THIRD_PARTY_HW_DRV_RETCODE_INIT(); @@ -97,6 +102,10 @@ sl_status_t mikroe_dwm1000_init(SPIDRV_Handle_t spi_instance) // Call basic setup functions uwb_cfg_setup(&uwb_cfg); +#if (UWB_DWM1000_SPI_UC == 1) + uwb_cfg.spi_speed = UWB_DWM1000_SPI_BITRATE; +#endif + #if defined(DWM1000_RESET_PORT) && defined(DWM1000_RESET_PIN) uwb_cfg.rst = hal_gpio_pin_name(DWM1000_RESET_PORT, DWM1000_RESET_PIN); @@ -106,13 +115,21 @@ sl_status_t mikroe_dwm1000_init(SPIDRV_Handle_t spi_instance) uwb_cfg.irq = hal_gpio_pin_name(DWM1000_INT_PORT, DWM1000_INT_PIN); #endif - uwb_cfg.cs = hal_gpio_pin_name(spi_instance->portCs, - spi_instance->pinCs); - GPIO_PinModeSet(spi_instance->portCs, - spi_instance->pinCs, - gpioModePushPull, - 1); +#if (defined(SLI_SI917)) +#if defined(DWM1000_SPI_CS_PORT) && defined(DWM1000_SPI_CS_PIN) + uwb_cfg.cs = hal_gpio_pin_name(DWM1000_SPI_CS_PORT, + DWM1000_SPI_CS_PIN); +#endif +#else +#if defined(SL_SPIDRV_MIKROE_CS_PORT) && defined(SL_SPIDRV_MIKROE_CS_PIN) + uwb_cfg.cs = hal_gpio_pin_name(SL_SPIDRV_MIKROE_CS_PORT, + SL_SPIDRV_MIKROE_CS_PIN); +#endif +#endif + + digital_out_init(&cs_out, uwb_cfg.cs); + digital_out_high(&cs_out); THIRD_PARTY_HW_DRV_RETCODE_TEST(uwb_init(&uwb, &uwb_cfg)); diff --git a/driver/public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h b/driver/public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h index 5f3d6feb..a48ea15f 100644 --- a/driver/public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h +++ b/driver/public/mikroe/water_detect/config/brd4338a/mikroe_water_detect_config.h @@ -48,7 +48,7 @@ extern "C" { // WATER_DETECT_INT // $[GPIO_WATER_DETECT_INT] -#define WATER_DETECT_INT_PORT 0 +#define WATER_DETECT_INT_PORT HP #define WATER_DETECT_INT_PIN 46 // [GPIO_WATER_DETECT_INT]$ diff --git a/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_i2c_config.h b/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_i2c_config.h index 51bfe41b..8662cf52 100644 --- a/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_i2c_config.h +++ b/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_i2c_config.h @@ -49,6 +49,24 @@ extern "C" { // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +//MIKROE BMA400 I2C Configuration + +// MIKROE BMA400 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_BMA400_I2C_SPEED_MODE 0 + +// +// + // BMA400 I2C ADDRESS // <0x14=> 0x14 // <0x15=> 0x15 diff --git a/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_spi_config.h b/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_spi_config.h index 36240cea..8bdd577c 100644 --- a/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_spi_config.h +++ b/driver/public/silabs/accel5_bma400/config/brd2703a/mikroe_bma400_spi_config.h @@ -46,6 +46,24 @@ extern "C" { #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BMA400 SPI Configuration + +// MIKROE BMA400 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_BMA400_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // MIKROE_BMA400_INT1 diff --git a/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_i2c_config.h b/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_i2c_config.h index 337b2173..8701e11e 100644 --- a/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_i2c_config.h +++ b/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_i2c_config.h @@ -49,6 +49,24 @@ extern "C" { // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +//MIKROE BMA400 I2C Configuration + +// MIKROE BMA400 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_BMA400_I2C_SPEED_MODE 0 + +// +// + // BMA400 I2C ADDRESS // <0x14=> 0x14 // <0x15=> 0x15 diff --git a/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_spi_config.h b/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_spi_config.h index bd2800fe..21a1da35 100644 --- a/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_spi_config.h +++ b/driver/public/silabs/accel5_bma400/config/brd4108a/mikroe_bma400_spi_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** * @file mikroe_bma400_spi_config.h - * @brief Configuration file for Sparkfun VLX53L1X + * @brief Configuration file for BMA400 * @version 1.0.0 ******************************************************************************* * # License @@ -46,6 +46,24 @@ extern "C" { #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BMA400 SPI Configuration + +// MIKROE BMA400 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_BMA400_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // MIKROE_BMA400_INT1 diff --git a/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_i2c_config.h b/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_i2c_config.h index 7214c074..8701e11e 100644 --- a/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_i2c_config.h +++ b/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_i2c_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** * @file mikroe_bma400_i2c_config.h - * @brief Configuration file for Sparkfun VLX53L1X + * @brief Configuration file for BMA400 * @version 1.0.0 ******************************************************************************* * # License @@ -49,6 +49,24 @@ extern "C" { // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +//MIKROE BMA400 I2C Configuration + +// MIKROE BMA400 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_BMA400_I2C_SPEED_MODE 0 + +// +// + // BMA400 I2C ADDRESS // <0x14=> 0x14 // <0x15=> 0x15 diff --git a/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_spi_config.h b/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_spi_config.h index ba3fa93b..21a1da35 100644 --- a/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_spi_config.h +++ b/driver/public/silabs/accel5_bma400/config/brd4314a/mikroe_bma400_spi_config.h @@ -46,6 +46,24 @@ extern "C" { #include "em_gpio.h" +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BMA400 SPI Configuration + +// MIKROE BMA400 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_BMA400_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // MIKROE_BMA400_INT1 diff --git a/driver/public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_i2c_config.h b/driver/public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_i2c_config.h new file mode 100644 index 00000000..5475e2b7 --- /dev/null +++ b/driver/public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_i2c_config.h @@ -0,0 +1,98 @@ +/***************************************************************************//** + * @file mikroe_bma400_i2c_config.h + * @brief Configuration file for BMA400 + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_BMA400_CONFIG_H_ +#define MIKROE_BMA400_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BMA400 I2C Configuration + +// MIKROE BMA400 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_BMA400_I2C_SPEED_MODE 0 + +// +// + +// BMA400 I2C ADDRESS +// <0x14=> 0x14 +// <0x15=> 0x15 +// Default: 0x15 +#define MIKROE_BMA400_ADDR 0x15 + +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_BMA400_INT1 +// $[GPIO_MIKROE_BMA400_INT1] +#define MIKROE_BMA400_INT1_PORT HP +#define MIKROE_BMA400_INT1_PIN 46 +// [GPIO_MIKROE_BMA400_INT1]$ + +// MIKROE_BMA400_INT2 +// $[GPIO_MIKROE_BMA400_INT2] +#define MIKROE_BMA400_INT2_PORT HP +#define MIKROE_BMA400_INT2_PIN 47 +// [GPIO_MIKROE_BMA400_INT2]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* MIKROE_BMA400_CONFIG_H_ */ diff --git a/driver/public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_spi_config.h b/driver/public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_spi_config.h new file mode 100644 index 00000000..72ea3a4b --- /dev/null +++ b/driver/public/silabs/accel5_bma400/config/brd4338a/mikroe_bma400_spi_config.h @@ -0,0 +1,85 @@ +/***************************************************************************//** + * @file mikroe_bma400_spi_config.h + * @brief Configuration file for BMA400 + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_BMA400_CONFIG_H_ +#define MIKROE_BMA400_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BMA400 SPI Configuration + +// MIKROE BMA400 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_BMA400_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_BMA400_INT1 +// $[GPIO_MIKROE_BMA400_INT1] +#define MIKROE_BMA400_INT1_PORT HP +#define MIKROE_BMA400_INT1_PIN 46 +// [GPIO_MIKROE_BMA400_INT1]$ + +// MIKROE_BMA400_INT2 +// $[GPIO_MIKROE_BMA400_INT2] +#define MIKROE_BMA400_INT2_PORT HP +#define MIKROE_BMA400_INT2_PIN 47 +// [GPIO_MIKROE_BMA400_INT2]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* MIKROE_BMA400_CONFIG_H_ */ diff --git a/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_i2c_config.h b/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_i2c_config.h index eaa54eaa..c4da24ee 100644 --- a/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_i2c_config.h +++ b/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_i2c_config.h @@ -44,11 +44,31 @@ extern "C" { #endif +#ifndef SLI_SI917 #include "em_gpio.h" +#endif // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +//MIKROE BMA400 I2C Configuration + +// MIKROE BMA400 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_BMA400_I2C_SPEED_MODE 0 + +// +// + // BMA400 I2C ADDRESS // <0x14=> 0x14 // <0x15=> 0x15 @@ -62,14 +82,14 @@ extern "C" { // MIKROE_BMA400_INT1 // $[GPIO_MIKROE_BMA400_INT1] -#warning "Interrupt pin for MAX30101 is not configured" +#warning "Interrupt pin 1 for BMA400 is not configured" // #define MIKROE_BMA400_INT1_PORT gpioPortB // #define MIKROE_BMA400_INT1_PIN 1 // [GPIO_MIKROE_BMA400_INT1]$ // MIKROE_BMA400_INT2 // $[GPIO_MIKROE_BMA400_INT2] -#warning "Interrupt pin for MAX30101 is not configured" +#warning "Interrupt pin 2 for BMA400 is not configured" // #define MIKROE_BMA400_INT2_PORT gpioPortA // #define MIKROE_BMA400_INT2_PIN 0 // [GPIO_MIKROE_BMA400_INT2]$ diff --git a/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_spi_config.h b/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_spi_config.h index 73a09b50..efef300a 100644 --- a/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_spi_config.h +++ b/driver/public/silabs/accel5_bma400/config/other/mikroe_bma400_spi_config.h @@ -44,20 +44,40 @@ extern "C" { #endif +#ifndef SLI_SI917 #include "em_gpio.h" +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BMA400 SPI Configuration + +// MIKROE BMA400 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BMA400_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_BMA400_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> // <<< sl:start pin_tool >>> // MIKROE_BMA400_INT1 // $[GPIO_MIKROE_BMA400_INT1] -#warning "Interrupt pin for MAX30101 is not configured" +#warning "Interrupt pin 1 for BMA400 is not configured" // #define MIKROE_BMA400_INT1_PORT gpioPortB // #define MIKROE_BMA400_INT1_PIN 1 // [GPIO_MIKROE_BMA400_INT1]$ // MIKROE_BMA400_INT2 // $[GPIO_MIKROE_BMA400_INT2] -#warning "Interrupt pin for MAX30101 is not configured" +#warning "Interrupt pin 2 for BMA400 is not configured" // #define MIKROE_BMA400_INT2_PORT gpioPortA // #define MIKROE_BMA400_INT2_PIN 0 // [GPIO_MIKROE_BMA400_INT2]$ diff --git a/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_i2c.h b/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_i2c.h index 125ad38d..9ed82e18 100644 --- a/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_i2c.h +++ b/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_i2c.h @@ -36,9 +36,8 @@ #define MIKROE_BMA400_I2C_H #include "sl_status.h" -#include "sl_i2cspm.h" -#include "sl_udelay.h" - +#include "drv_i2c_master.h" +#include "drv_digital_in.h" #include "bma400.h" #ifdef __cplusplus @@ -125,7 +124,7 @@ extern "C" { * @ref BMA400_OK on success. * @ref On failure, BMA400_E_NULL_PTR is returned. ******************************************************************************/ -int8_t bma400_i2c_init(sl_i2cspm_t *i2cspm, +int8_t bma400_i2c_init(mikroe_i2c_handle_t i2cspm, uint8_t bma400_i2c_addr, struct bma400_dev *bma400); diff --git a/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_spi.h b/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_spi.h index 712ea2d9..2bdd5ac2 100644 --- a/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_spi.h +++ b/driver/public/silabs/accel5_bma400/inc/mikroe_bma400_spi.h @@ -36,10 +36,9 @@ #define MIKROE_BMA400_SPI_H #include "sl_status.h" -#include "spidrv.h" -#include "sl_udelay.h" - +#include "mikroe_bma400_spi_config.h" #include "bma400.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -123,7 +122,8 @@ extern "C" { * @ref BMA400_OK on success. * @ref On failure, BMA400_E_NULL_PTR is returned. ******************************************************************************/ -int8_t bma400_spi_init(SPIDRV_Handle_t spidrv, struct bma400_dev *bma400); +int8_t bma400_spi_init(mikroe_spi_handle_t spidrv, + struct bma400_dev *bma400); /** @} (end addtogroup BMA400) */ diff --git a/driver/public/silabs/accel5_bma400/src/mikroe_bma400_i2c.c b/driver/public/silabs/accel5_bma400/src/mikroe_bma400_i2c.c index 60606988..52b25658 100644 --- a/driver/public/silabs/accel5_bma400/src/mikroe_bma400_i2c.c +++ b/driver/public/silabs/accel5_bma400/src/mikroe_bma400_i2c.c @@ -34,14 +34,21 @@ ******************************************************************************/ #include "mikroe_bma400_i2c.h" +#include "mikroe_bma400_i2c_config.h" // Read write length varies based on user requirement #define READ_WRITE_LENGTH UINT8_C(46) -// Variable to store the device address -static uint8_t dev_addr; // Variable to store the i2cspm instance -static sl_i2cspm_t *i2c_handle; +typedef struct +{ + i2c_master_t i2c; + digital_in_t interrupt_pin_1; + digital_in_t interrupt_pin_2; + uint8_t intf_ref; +} bma400_handle_t; + +static bma400_handle_t bma400_handle; // Local prototypes static int8_t bma400_i2c_read(uint8_t reg_addr, @@ -69,30 +76,54 @@ static void bma400_delay_us(uint32_t period, void *intf_ptr); * @ref BMA400_OK on success. * @ref On failure, BMA400_E_NULL_PTR is returned. ******************************************************************************/ -int8_t bma400_i2c_init(sl_i2cspm_t *i2cspm, +int8_t bma400_i2c_init(mikroe_i2c_handle_t i2cspm, uint8_t bma400_i2c_addr, struct bma400_dev *bma400) { - if (bma400 == NULL) { + if ((bma400 == NULL) || (NULL == i2cspm)) { return BMA400_E_NULL_PTR; } // The device needs startup time - sl_udelay_wait(10000); + sl_sleeptimer_delay_millisecond(10); + + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); - // Update i2cspm instance - i2c_handle = i2cspm; - // Update device addr - dev_addr = bma400_i2c_addr; + i2c_cfg.addr = bma400_i2c_addr; + bma400_handle.i2c.handle = i2cspm; + +#if (MIKROE_BMA400_I2C_UC == 1) + i2c_cfg.speed = MIKROE_BMA400_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&bma400_handle.i2c, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&bma400_handle.i2c, i2c_cfg.speed); + i2c_master_set_timeout(&bma400_handle.i2c, 0); bma400->read = bma400_i2c_read; bma400->write = bma400_i2c_write; bma400->intf = BMA400_I2C_INTF; - bma400->intf_ptr = &dev_addr; + bma400->intf_ptr = &bma400_handle.intf_ref; bma400->delay_us = bma400_delay_us; bma400->read_write_len = READ_WRITE_LENGTH; +#ifdef MIKROE_BMA400_INT1_PORT + pin_name_t int_pin_1 = hal_gpio_pin_name(MIKROE_BMA400_INT1_PORT, + MIKROE_BMA400_INT1_PIN); + digital_in_init(&bma400_handle.interrupt_pin_1, int_pin_1); +#endif + +#ifdef MIKROE_BMA400_INT2_PORT + pin_name_t int_pin_2 = hal_gpio_pin_name(MIKROE_BMA400_INT2_PORT, + MIKROE_BMA400_INT2_PIN); + digital_in_init(&bma400_handle.interrupt_pin_2, int_pin_2); +#endif + return BMA400_OK; } @@ -105,22 +136,12 @@ static int8_t bma400_i2c_read(uint8_t reg_addr, void *intf_ptr) { (void) intf_ptr; - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_write_data[1]; - seq.addr = dev_addr << 1; - seq.flags = I2C_FLAG_WRITE_READ; - - i2c_write_data[0] = reg_addr; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - - // Select length of data to be read - seq.buf[1].data = reg_data; - seq.buf[1].len = (uint16_t)len; - ret = I2CSPM_Transfer(i2c_handle, &seq); - if (ret != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&bma400_handle.i2c, + ®_addr, + 1, + reg_data, + len)) { return BMA400_E_COM_FAIL; } @@ -136,27 +157,18 @@ static int8_t bma400_i2c_write(uint8_t reg_addr, void *intf_ptr) { (void) intf_ptr; - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_write_data[len + 1]; - uint8_t i2c_read_data[1]; - seq.addr = dev_addr << 1; - seq.flags = I2C_FLAG_WRITE; + uint8_t i2c_write_data[len + 1]; // Select register and data to write i2c_write_data[0] = reg_addr; for (uint16_t i = 0; i < (uint16_t)len; i++) { i2c_write_data[i + 1] = reg_data[i]; } - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = (uint16_t)len + 1; - - // Select length of data to be read - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - ret = I2CSPM_Transfer(i2c_handle, &seq); - if (ret != i2cTransferDone) { + + if (I2C_MASTER_SUCCESS != i2c_master_write(&bma400_handle.i2c, + i2c_write_data, + len + 1)) { return BMA400_E_COM_FAIL; } @@ -169,5 +181,11 @@ static int8_t bma400_i2c_write(uint8_t reg_addr, static void bma400_delay_us(uint32_t period, void *intf_ptr) { (void) intf_ptr; - sl_udelay_wait(period); + uint32_t delay_ms = 1; + + if (period > 1000) { + delay_ms = (period / 1000) + 1; + } + + sl_sleeptimer_delay_millisecond(delay_ms); } diff --git a/driver/public/silabs/accel5_bma400/src/mikroe_bma400_spi.c b/driver/public/silabs/accel5_bma400/src/mikroe_bma400_spi.c index fb0fa872..e5b18c1a 100644 --- a/driver/public/silabs/accel5_bma400/src/mikroe_bma400_spi.c +++ b/driver/public/silabs/accel5_bma400/src/mikroe_bma400_spi.c @@ -34,14 +34,22 @@ ******************************************************************************/ #include "mikroe_bma400_spi.h" +#include "sl_sleeptimer.h" +#include "drv_spi_master.h" +#include "drv_digital_in.h" // Read write length varies based on user requirement #define READ_WRITE_LENGTH UINT8_C(46) -// Variable to store the device address -static uint8_t dev_addr; -// Variable to store the spidrv instance -static SPIDRV_Handle_t spi_handle; +typedef struct +{ + spi_master_t spi; + digital_in_t interrupt_pin_1; + digital_in_t interrupt_pin_2; + uint8_t intf_ref; +} bma400_handle_t; + +static bma400_handle_t bma400_handle; // Local prototypes static int8_t bma400_spi_read(uint8_t reg_addr, @@ -67,27 +75,52 @@ static void bma400_delay_us(uint32_t period, void *intf_ptr); * @ref BMA400_OK on success. * @ref On failure, BMA400_E_NULL_PTR is returned. ******************************************************************************/ -int8_t bma400_spi_init(SPIDRV_Handle_t spidrv, struct bma400_dev *bma400) +int8_t bma400_spi_init(mikroe_spi_handle_t spidrv, + struct bma400_dev *bma400) { - if (bma400 == NULL) { + if ((bma400 == NULL) || (NULL == spidrv)) { return BMA400_E_NULL_PTR; } + // The device needs startup time + sl_sleeptimer_delay_millisecond(10); + // Update the spidrv instance - spi_handle = spidrv; + spi_master_config_t spi_cfg; + spi_master_configure_default(&spi_cfg); + spi_cfg.mode = SPI_MASTER_MODE_0; + spi_cfg.speed = 1000000; - /* The device needs startup time */ - sl_udelay_wait(10000); +#if (MIKROE_BMA400_SPI_UC == 1) + spi_cfg.speed = MIKROE_BMA400_SPI_BITRATE; +#endif + + bma400_handle.spi.handle = spidrv; + + if (spi_master_open(&bma400_handle.spi, &spi_cfg) == SPI_MASTER_ERROR) { + return BMA400_E_INVALID_CONFIG; + } bma400->read = bma400_spi_read; bma400->write = bma400_spi_write; bma400->intf = BMA400_SPI_INTF; - dev_addr = 0xff; - bma400->intf_ptr = &dev_addr; + bma400->intf_ptr = &bma400_handle.intf_ref; bma400->delay_us = bma400_delay_us; bma400->read_write_len = READ_WRITE_LENGTH; +#ifdef MIKROE_BMA400_INT1_PORT + pin_name_t int_pin_1 = hal_gpio_pin_name(MIKROE_BMA400_INT1_PORT, + MIKROE_BMA400_INT1_PIN); + digital_in_init(&bma400_handle.interrupt_pin_1, int_pin_1); +#endif + +#ifdef MIKROE_BMA400_INT2_PORT + pin_name_t int_pin_2 = hal_gpio_pin_name(MIKROE_BMA400_INT2_PORT, + MIKROE_BMA400_INT2_PIN); + digital_in_init(&bma400_handle.interrupt_pin_2, int_pin_2); +#endif + return BMA400_OK; } @@ -100,25 +133,17 @@ static int8_t bma400_spi_read(uint8_t reg_addr, void *intf_ptr) { (void) intf_ptr; - Ecode_t ret_code; - uint8_t txBuffer[len + 1]; - uint8_t rxBuffer[len + 1]; + err_t ret_code; - txBuffer[0] = reg_addr; - - // Fullfill the remaining elements of the txBuffer with dummy - for (uint16_t i = 0; i < (uint16_t)len; i++) { - txBuffer[i + 1] = 0xff; - } + ret_code = spi_master_write_then_read(&bma400_handle.spi, + ®_addr, + 1, + reg_data, + len); - ret_code = SPIDRV_MTransferB(spi_handle, txBuffer, rxBuffer, len + 1); - if (ret_code != ECODE_EMDRV_SPIDRV_OK) { + if (ret_code != SPI_MASTER_SUCCESS) { return BMA400_E_COM_FAIL; } - // Copy the receive payload (without the dummy byte) to the output buffer data - for (uint16_t i = 0; i < len; i++) { - reg_data[i] = rxBuffer[i + 1]; - } return BMA400_OK; } @@ -132,18 +157,17 @@ static int8_t bma400_spi_write(uint8_t reg_addr, void *intf_ptr) { (void) intf_ptr; - Ecode_t ret_code; + sl_status_t ret_code; uint8_t txBuffer[len + 1]; txBuffer[0] = reg_addr; - // Fullfill the remaining elements of the txBuffer with dummy for (uint16_t i = 0; i < (uint16_t)len; i++) { txBuffer[i + 1] = reg_data[i]; } - ret_code = SPIDRV_MTransmitB(spi_handle, txBuffer, len + 1); - if (ret_code != ECODE_EMDRV_SPIDRV_OK) { + ret_code = spi_master_write(&bma400_handle.spi, txBuffer, len + 1); + if (ret_code != SPI_MASTER_SUCCESS) { return BMA400_E_COM_FAIL; } @@ -156,5 +180,11 @@ static int8_t bma400_spi_write(uint8_t reg_addr, static void bma400_delay_us(uint32_t period, void *intf_ptr) { (void) intf_ptr; - sl_udelay_wait(period); + uint32_t delay_ms = 1; + + if (period > 1000) { + delay_ms = (period / 1000) + 1; + } + + sl_sleeptimer_delay_millisecond(delay_ms); } diff --git a/driver/public/silabs/accelerometer_mma8452q/config/mma8452q_config.h b/driver/public/silabs/accelerometer_mma8452q/config/mma8452q_config.h new file mode 100644 index 00000000..af8c6998 --- /dev/null +++ b/driver/public/silabs/accelerometer_mma8452q/config/mma8452q_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file mma8452q_config.h + * @brief sparkfun mma8452q configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SPARKFUN_MMA8452Q_CONFIG_H +#define SPARKFUN_MMA8452Q_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//SPARKFUN MMA8452Q I2C Configuration + +// SPARKFUN MMA8452Q I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_MMA8452Q_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_MMA8452Q_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // SPARKFUN_MMA8452Q_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/accelerometer_mma8452q/inc/mma8452q.h b/driver/public/silabs/accelerometer_mma8452q/inc/mma8452q.h index 89261846..6b6aa470 100644 --- a/driver/public/silabs/accelerometer_mma8452q/inc/mma8452q.h +++ b/driver/public/silabs/accelerometer_mma8452q/inc/mma8452q.h @@ -43,7 +43,7 @@ #include #include #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -79,9 +79,9 @@ extern "C" { #define SL_MMA8452Q_I2C_BUS_ADDRESS1 0x1C /**< I2C address of the * MMA8452Q chip: SA0 * low-logic */ -#define SL_MMA8452Q_I2C_BUS_ADDRESS2 0x1D /**< I2C address of the - * MMA8452Q chip: SA0 - * hi-logic */ +#define SL_MMA8452Q_I2C_BUS_ADDRESS2 0x1D /**< I2C address of the + * MMA8452Q chip: SA0 + * hi-logic */ /***************************************************************************//** * @brief @@ -617,7 +617,7 @@ sl_status_t mma8452q_get_pulse_status(uint8_t *pulse_status); * @li @ref SL_STATUS_INVALID_PARAMETER invalid parameters. * ******************************************************************************/ -sl_status_t mma8452q_init(sl_i2cspm_t *i2cspm); +sl_status_t mma8452q_init(mikroe_i2c_handle_t inst); /***************************************************************************//** * @brief diff --git a/driver/public/silabs/accelerometer_mma8452q/src/mma8452q.c b/driver/public/silabs/accelerometer_mma8452q/src/mma8452q.c index be7b8de3..22d1803f 100644 --- a/driver/public/silabs/accelerometer_mma8452q/src/mma8452q.c +++ b/driver/public/silabs/accelerometer_mma8452q/src/mma8452q.c @@ -37,8 +37,8 @@ ******************************************************************************/ #include -#include -#include +#include "sl_sleeptimer.h" +#include "mma8452q_config.h" /***************************************************************************//** * Definition @@ -91,7 +91,7 @@ * Local Variables ******************************************************************************/ static mma8452q_sensor_config_t mma8452q_cfg = { - .dev_addr = SL_MMA8452Q_I2C_BUS_ADDRESS1, + .dev_addr = SL_MMA8452Q_I2C_BUS_ADDRESS2, .scale = MMA8452Q_SCALE_2G, .odr = MMA8452Q_ODR_800, .alsp_rate = MMA8452Q_ASLP_ODR_50, @@ -165,7 +165,14 @@ static mma8452q_sensor_config_t mma8452q_cfg = { }, .enable = true }; /* Structure to hold MMA8452Q driver config */ -static sl_i2cspm_t *_mma8452q_i2cspm_instance = NULL; + +typedef struct +{ + i2c_master_t i2c; +} mma8452q_handle_t; + +static mma8452q_handle_t mma8452q_handle; + static bool mma8452q_is_initialized = false; /***************************************************************************//** @@ -182,25 +189,43 @@ void mma8452q_get_core_version(mma8542q_core_version_t *core_version) /***************************************************************************//** * Initialize the MMA8452Q. *******************************************************************************/ -sl_status_t mma8452q_init(sl_i2cspm_t *i2cspm) +sl_status_t mma8452q_init(mikroe_i2c_handle_t inst) { sl_status_t status = SL_STATUS_OK; + i2c_master_config_t i2c_cfg; uint8_t temp = 0; + // If already initialized, return status if (mma8452q_is_initialized == true) { return SL_STATUS_ALREADY_INITIALIZED; } // Check for Null pointer - if (i2cspm == NULL) { + if (inst == NULL) { return SL_STATUS_INVALID_PARAMETER; } - // Update i2cspm instance - _mma8452q_i2cspm_instance = i2cspm; + mma8452q_handle.i2c.handle = inst; + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = SL_MMA8452Q_I2C_BUS_ADDRESS2; + +#if (SPARKFUN_MMA8452Q_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_MMA8452Q_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&mma8452q_handle.i2c, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&mma8452q_handle.i2c, i2c_cfg.speed); + i2c_master_set_timeout(&mma8452q_handle.i2c, 0); + + mma8452q_is_initialized = true; // Check WHO_AM_I register status = mma8452q_read_register(MMA8452Q_WHO_AM_I, &temp); + if (status == SL_STATUS_TRANSMIT) { return SL_STATUS_INVALID_PARAMETER; } @@ -211,7 +236,6 @@ sl_status_t mma8452q_init(sl_i2cspm_t *i2cspm) if (status != SL_STATUS_OK) { return SL_STATUS_TRANSMIT; } - mma8452q_is_initialized = true; return SL_STATUS_OK; } @@ -231,7 +255,7 @@ sl_status_t mma8452q_deinit(void) status = mma8452q_write_register(MMA8452Q_CTRL_REG2, 0x40); // Must to wait after reset device - sl_udelay_wait(1000); + sl_sleeptimer_delay_millisecond(1); status |= mma8452q_active(false); mma8452q_is_initialized = false; @@ -258,14 +282,25 @@ sl_status_t mma8452q_set_address(uint8_t i2c_address) prev_addr = mma8452q_cfg.dev_addr; mma8452q_cfg.dev_addr = i2c_address; + if (I2C_MASTER_SUCCESS != i2c_master_set_slave_address(&mma8452q_handle.i2c, + mma8452q_cfg.dev_addr)) + { + return SL_STATUS_FAIL; + } + status |= mma8452q_read_register(MMA8452Q_WHO_AM_I, &temp); if (status == SL_STATUS_TRANSMIT) { mma8452q_cfg.dev_addr = prev_addr; + i2c_master_set_slave_address(&mma8452q_handle.i2c, + mma8452q_cfg.dev_addr); return status; } + if (temp != SL_MMA8452Q_DEVICE_ID) { mma8452q_cfg.dev_addr = prev_addr; + i2c_master_set_slave_address(&mma8452q_handle.i2c, + mma8452q_cfg.dev_addr); return SL_STATUS_NOT_FOUND; } @@ -281,7 +316,7 @@ sl_status_t mma8452q_set_address(uint8_t i2c_address) sl_status_t mma8452q_active(bool enable) { sl_status_t status = SL_STATUS_OK; - uint8_t temp; + uint8_t temp = 0x00; status |= mma8452q_read_register(MMA8452Q_CTRL_REG1, &temp); @@ -308,8 +343,8 @@ sl_status_t mma8452q_active(bool enable) sl_status_t mma8452q_auto_calibrate(void) { sl_status_t status = SL_STATUS_OK; - int16_t data[3]; - uint8_t offset[3]; + int16_t data[3] = { 0x00, 0x00, 0x00 }; + uint8_t offset[3] = { 0x00, 0x00, 0x00 }; mma8452q_odr_t prev_odr = mma8452q_cfg.odr; mma8452q_scale_t prev_scale = mma8452q_cfg.scale; uint8_t is_data_ready = 0; @@ -355,7 +390,8 @@ sl_status_t mma8452q_auto_calibrate(void) sl_status_t sl_mma8452q_get_acceleration(int16_t avec[3]) { sl_status_t status = SL_STATUS_OK; - uint8_t raw_data[6]; // store x, y, z here + // store x, y, z here + uint8_t raw_data[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; if (mma8452q_cfg.en_fast_read == false) { status |= mma8452q_read_block(MMA8452Q_OUT_X_MSB, 6, raw_data); @@ -381,7 +417,8 @@ sl_status_t sl_mma8452q_get_acceleration(int16_t avec[3]) sl_status_t sl_mma8452q_get_calculated_acceleration(float avec[3]) { sl_status_t status = SL_STATUS_OK; - uint8_t raw_data[6]; // store x, y, z here + // store x, y, z here + uint8_t raw_data[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; if (mma8452q_cfg.en_fast_read == false) { int16_t acceleration[3]; // store raw data of acceleration here @@ -441,7 +478,7 @@ sl_status_t mma8452q_get_data_status(uint8_t *data_status) sl_status_t mma8452q_check_for_data_ready(uint8_t *is_data_ready) { sl_status_t status = SL_STATUS_OK; - uint8_t temp; + uint8_t temp = 0x00; // Check for Null pointer if (is_data_ready == NULL) { @@ -497,7 +534,7 @@ sl_status_t mma8452q_get_int_source(uint8_t *int_source) sl_status_t mma8452q_get_pl_status(uint8_t *pl_status) { sl_status_t status = SL_STATUS_OK; - uint8_t plStat; + uint8_t plStat = 0x00; // Check for Null pointer if (pl_status == NULL) { @@ -566,7 +603,7 @@ sl_status_t mma8452q_set_scale(mma8452q_scale_t scale) { sl_status_t status = SL_STATUS_OK; uint8_t sysmode = 0; - uint8_t cfg; + uint8_t cfg = 0x00; if ((scale != MMA8452Q_SCALE_2G) && (scale != MMA8452Q_SCALE_4G) && (scale != MMA8452Q_SCALE_8G)) { return SL_STATUS_INVALID_PARAMETER; @@ -601,7 +638,7 @@ sl_status_t mma8452q_set_odr(mma8452q_odr_t odr) { sl_status_t status = SL_STATUS_OK; uint8_t sysmode = 0; - uint8_t ctrl; + uint8_t ctrl = 0x00; if (odr > MMA8452Q_ODR_1) { return SL_STATUS_INVALID_PARAMETER; @@ -638,7 +675,7 @@ sl_status_t mma8452q_set_mods(mma8452q_mods_t mods) { sl_status_t status = SL_STATUS_OK; uint8_t sysmode = 0; - uint8_t ctrl; + uint8_t ctrl = 0x00; if (mods > MMA8452Q_LPWR) { return SL_STATUS_INVALID_PARAMETER; @@ -674,7 +711,7 @@ sl_status_t mma8452q_config_aslp(mma8452q_aslp_odr_t alsp_rate, { sl_status_t status = SL_STATUS_OK; uint8_t sysmode = 0; - uint8_t ctrl; + uint8_t ctrl = 0x00; if ((alsp_rate > MMA8452Q_ASLP_ODR_1p56) || (slp_mode_pwr > MMA8452Q_LPWR)) { return SL_STATUS_INVALID_PARAMETER; @@ -946,7 +983,7 @@ sl_status_t mma8452q_enable_low_noise(bool enable) { sl_status_t status = SL_STATUS_OK; uint8_t sysmode = 0; - uint8_t ctrl; + uint8_t ctrl = 0x00; // Change to standby if currently in other state status |= mma8452q_get_sysmode(&sysmode); @@ -980,7 +1017,7 @@ sl_status_t mma8452q_enable_fast_read(bool enable) { sl_status_t status = SL_STATUS_OK; uint8_t sysmode = 0; - uint8_t ctrl; + uint8_t ctrl = 0x00; // Change to standby if currently in other state status |= mma8452q_get_sysmode(&sysmode); @@ -1012,32 +1049,22 @@ sl_status_t mma8452q_enable_fast_read(bool enable) *******************************************************************************/ sl_status_t mma8452q_read_register(uint8_t addr, uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data; - - if (_mma8452q_i2cspm_instance == NULL) { + if (mma8452q_is_initialized == false) { return SL_STATUS_NOT_INITIALIZED; } if (data == NULL) { return SL_STATUS_INVALID_PARAMETER; } - seq.addr = mma8452q_cfg.dev_addr << 1; - seq.flags = (uint16_t)I2C_FLAG_WRITE_READ; - - i2c_write_data = addr; - - /*Write buffer*/ - seq.buf[0].data = &i2c_write_data; - seq.buf[0].len = 1; - - /*Read buffer*/ - seq.buf[1].data = data; - seq.buf[1].len = 1; - if (I2CSPM_Transfer(_mma8452q_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&mma8452q_handle.i2c, + &addr, + 1, + data, + 1)) { return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } @@ -1046,26 +1073,18 @@ sl_status_t mma8452q_read_register(uint8_t addr, uint8_t *data) *******************************************************************************/ sl_status_t mma8452q_write_register(uint8_t addr, uint8_t data) { - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data[2]; - - if (_mma8452q_i2cspm_instance == NULL) { + if (mma8452q_is_initialized == false) { return SL_STATUS_NOT_INITIALIZED; } - seq.addr = mma8452q_cfg.dev_addr << 1; - seq.flags = (uint16_t)I2C_FLAG_WRITE; - - i2c_write_data[0] = addr; - i2c_write_data[1] = data; - - /*Write buffer*/ - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 2; + uint8_t i2c_write_data[2] = { addr, data }; - if (I2CSPM_Transfer(_mma8452q_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&mma8452q_handle.i2c, + i2c_write_data, + 2)) { return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } @@ -1074,32 +1093,22 @@ sl_status_t mma8452q_write_register(uint8_t addr, uint8_t data) *******************************************************************************/ sl_status_t mma8452q_read_block(uint8_t addr, uint8_t num_bytes, uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data; - - if (_mma8452q_i2cspm_instance == NULL) { + if (mma8452q_is_initialized == false) { return SL_STATUS_NOT_INITIALIZED; } if (data == NULL) { return SL_STATUS_INVALID_PARAMETER; } - seq.addr = mma8452q_cfg.dev_addr << 1; - seq.flags = (uint16_t)I2C_FLAG_WRITE_READ; - - i2c_write_data = addr; - - /*Write buffer*/ - seq.buf[0].data = &i2c_write_data; - seq.buf[0].len = 1; - /*Read buffer*/ - seq.buf[1].data = data; - seq.buf[1].len = num_bytes; - - if (I2CSPM_Transfer(_mma8452q_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&mma8452q_handle.i2c, + &addr, + 1, + data, + num_bytes)) { return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } @@ -1108,22 +1117,29 @@ sl_status_t mma8452q_read_block(uint8_t addr, uint8_t num_bytes, uint8_t *data) *******************************************************************************/ sl_status_t mma8452q_write_block(uint8_t addr, uint8_t num_bytes, uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data[num_bytes + 1]; + if (mma8452q_is_initialized == false) { + return SL_STATUS_NOT_INITIALIZED; + } - seq.addr = mma8452q_cfg.dev_addr << 1; - seq.flags = (uint16_t)I2C_FLAG_WRITE; + if (NULL == data) { + return SL_STATUS_INVALID_PARAMETER; + } + uint8_t i2c_write_data[num_bytes + 1]; i2c_write_data[0] = addr; - memcpy(&i2c_write_data[1], data, num_bytes); + for (uint8_t i = 0; i < num_bytes; i++) + { + i2c_write_data[i + 1] = *(data + i); + } - /*Write buffer*/ - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = num_bytes; + err_t stt = i2c_master_write(&mma8452q_handle.i2c, + i2c_write_data, + num_bytes + 1); - if (I2CSPM_Transfer(_mma8452q_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != stt) { return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } diff --git a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/config/adafruit_neotrellis_config.h b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/config/adafruit_neotrellis_config.h index 610bec67..7f38144c 100644 --- a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/config/adafruit_neotrellis_config.h +++ b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/config/adafruit_neotrellis_config.h @@ -42,14 +42,31 @@ extern "C" #endif // <<< Use Configuration Wizard in Context Menu >>> -// Trellis Keypad Setting - -// Number NeoTrellis boards by column -// Default: 1 -#define NEOTRELLIS_NUM_COLUMN_BOARDS 1 -// Number NeoTrellis boards by row -// Default: 1 -#define NEOTRELLIS_NUM_ROW_BOARDS 1 +//ADAFRUIT NEO TRELLIS I2C Configuration + +// ADAFRUIT NEO TRELLIS I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define ADAFRUIT_NEO_TRELLIS_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define ADAFRUIT_NEO_TRELLIS_I2C_SPEED_MODE 0 +// +// + +// ADAFRUIT NEO TRELLIS Setting +// Number NeoTrellis boards by column +// 1 +#define NEOTRELLIS_NUM_COLUMN_BOARDS 1U + +// Number NeoTrellis boards by row +// 1 +#define NEOTRELLIS_NUM_ROW_BOARDS 1U // // <<< end of configuration section >>> @@ -58,4 +75,4 @@ extern "C" } #endif -#endif /* ADAFRUIT_NEO_TRELLIS_CONFIG_H */ +#endif // ADAFRUIT_NEO_TRELLIS_CONFIG_H diff --git a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neopixel.h b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neopixel.h index aa8e43e1..00b6b7c9 100644 --- a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neopixel.h +++ b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neopixel.h @@ -1,6 +1,46 @@ +/***************************************************************************//** + * @file adafruit_neopixel.h + * @brief adafruit_neopixel header file for Adafruit NeoTrellis 4x4 keypad. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ + #ifndef _ADAFRUIT_NEOPIXEL_H_ #define _ADAFRUIT_NEOPIXEL_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include "sl_status.h" #include "adafruit_seesaw.h" @@ -93,7 +133,7 @@ sl_status_t adafruit_neopixel_init(neopixel_t *pixel, uint8_t pixel_pin, neoPixelType pixel_type, uint8_t i2c_addr, - sl_i2cspm_t *i2c_inst); + mikroe_i2c_handle_t i2c_inst); /**************************************************************************/ @@ -274,4 +314,8 @@ uint32_t adafruit_neopixel_getPixelColor(neopixel_t *pixel, uint16_t n); void adafruit_neopixel_set_brightness(neopixel_t *pixel, uint8_t b); -#endif /* _ADAFRUIT_NEOPIXEL_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // _ADAFRUIT_NEOPIXEL_H_ diff --git a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neotrellis.h b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neotrellis.h index 9b1f0108..eb3c9ea1 100644 --- a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neotrellis.h +++ b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_neotrellis.h @@ -1,6 +1,45 @@ +/***************************************************************************//** + * @file adafruit_neotrellis.h + * @brief adafruit_neotrellis header file for Adafruit NeoTrellis 4x4 keypad. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ #ifndef _ADAFRUIT_NEOTRELLIS_H_ #define _ADAFRUIT_NEOTRELLIS_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include "adafruit_seesaw.h" #include "adafruit_neopixel.h" @@ -51,7 +90,7 @@ typedef struct neotrellis_t { */ /**************************************************************************/ -sl_status_t adafruit_neotrellis_init(sl_i2cspm_t *i2cspm, +sl_status_t adafruit_neotrellis_init(mikroe_i2c_handle_t i2cspm, uint8_t *trellis_addr, uint8_t addr_list_len); @@ -222,4 +261,8 @@ void adafruit_neotrellis_show(); void adafruit_neotrellis_read(); -#endif /* _ADAFRUIT_NEOTRELLIS_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // _ADAFRUIT_NEOTRELLIS_H_ diff --git a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_seesaw.h b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_seesaw.h index 8dd4b4b6..a7cb7365 100644 --- a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_seesaw.h +++ b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/inc/adafruit_seesaw.h @@ -1,10 +1,48 @@ +/***************************************************************************//** + * @file adafruit_seesaw.h + * @brief adafruit_seesaw header file for Adafruit NeoTrellis 4x4 keypad. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ #ifndef _ADAFRUIT_SEESAW_H_ #define _ADAFRUIT_SEESAW_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include "sl_status.h" -#include "em_i2c.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" /***************************************************************************//** * // Macro @@ -82,24 +120,11 @@ typedef union keyState { }keyState; typedef struct seesaw_t { - uint8_t i2c_addr; - sl_i2cspm_t *i2c_instance; + i2c_master_t i2c_instance; }seesaw_t; /**************************************************************************/ -/*! - * @brief Seesaw chip Initialization. - * @param seesaw_dev seesaw instance - * @return SL_STATUS_OK if success, Error code if not. - */ - -/**************************************************************************/ - -sl_status_t adafruit_seesaw_i2c_init(seesaw_t seesaw_dev); - -/**************************************************************************/ - /*! * @brief I2C Read function. * @param seesaw_dev seesaw instance @@ -107,18 +132,18 @@ sl_status_t adafruit_seesaw_i2c_init(seesaw_t seesaw_dev); * @param reg_low Module function address * @param pdata Buffer to store data * @param len Length of data to be read - * @param delay Time to delay + * @param delay Time to delay ms * @return SL_STATUS_OK if success, Error code if not. */ /**************************************************************************/ -sl_status_t adafruit_seesaw_i2c_register_read(seesaw_t seesaw_dev, +sl_status_t adafruit_seesaw_i2c_register_read(seesaw_t *seesaw_dev, uint8_t reg_high, uint8_t reg_low, uint8_t *pdata, uint8_t len, - uint16_t delay); + uint16_t delay_ms); /**************************************************************************/ @@ -134,7 +159,7 @@ sl_status_t adafruit_seesaw_i2c_register_read(seesaw_t seesaw_dev, /**************************************************************************/ -sl_status_t adafruit_seesaw_i2c_register_write(seesaw_t seesaw_dev, +sl_status_t adafruit_seesaw_i2c_register_write(seesaw_t *seesaw_dev, uint8_t reg_high, uint8_t reg_low, uint8_t *pdata, @@ -150,7 +175,7 @@ sl_status_t adafruit_seesaw_i2c_register_write(seesaw_t seesaw_dev, /**************************************************************************/ -int8_t adafruit_seesaw_get_keypad_count(seesaw_t seesaw_dev); +int8_t adafruit_seesaw_get_keypad_count(seesaw_t *seesaw_dev); /**************************************************************************/ @@ -164,8 +189,12 @@ int8_t adafruit_seesaw_get_keypad_count(seesaw_t seesaw_dev); /**************************************************************************/ -sl_status_t adafruit_seesaw_read_keypad(seesaw_t seesaw_dev, +sl_status_t adafruit_seesaw_read_keypad(seesaw_t *seesaw_dev, keyEventRaw *buf, uint8_t count); -#endif /* _ADAFRUIT_SEESAW_H_ */ +#ifdef __cplusplus +} +#endif + +#endif // _ADAFRUIT_SEESAW_H_ diff --git a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neopixel.c b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neopixel.c index d526b2cf..b0a20777 100644 --- a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neopixel.c +++ b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neopixel.c @@ -1,8 +1,43 @@ +/***************************************************************************//** + * @file adafruit_neopixel.c + * @brief adafruit_neopixel source file for Adafruit NeoTrellis 4x4 keypad. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ #include "adafruit_neopixel.h" #include "sl_sleeptimer.h" #include #include -#include "app_assert.h" +#include "adafruit_neotrellis_config.h" static inline bool adafruit_neopixel_can_show(neopixel_t *pixel) { @@ -14,23 +49,37 @@ sl_status_t adafruit_neopixel_init(neopixel_t *pixel, uint8_t pixel_pin, neoPixelType pixel_type, uint8_t i2c_addr, - sl_i2cspm_t *i2c_inst) + mikroe_i2c_handle_t i2c_inst) { - sl_status_t sc; + if ((NULL == pixel) || (NULL == i2c_inst)) { + return SL_STATUS_NULL_POINTER; + } + + sl_status_t sc = SL_STATUS_OK; + i2c_master_config_t i2c_cfg; pixel->begun = false; pixel->brightness = 0; pixel->pixels = NULL; pixel->endTime = 0; - pixel->adafruit_seesaw.i2c_addr = i2c_addr; - pixel->adafruit_seesaw.i2c_instance = i2c_inst; + pixel->adafruit_seesaw.i2c_instance.handle = i2c_inst; - sc = adafruit_seesaw_i2c_init(pixel->adafruit_seesaw); + i2c_master_configure_default(&i2c_cfg); - if (sc != SL_STATUS_OK) { - return SL_STATUS_FAIL; + i2c_cfg.addr = i2c_addr; + +#if (ADAFRUIT_NEO_TRELLIS_I2C_UC == 1) + i2c_cfg.speed = ADAFRUIT_NEO_TRELLIS_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&pixel->adafruit_seesaw.i2c_instance, + &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; } + i2c_master_set_speed(&pixel->adafruit_seesaw.i2c_instance, i2c_cfg.speed); + i2c_master_set_timeout(&pixel->adafruit_seesaw.i2c_instance, 0); + sc |= adafruit_neopixel_update_type(pixel, pixel_type); sc |= adafruit_neopixel_update_length(pixel, num_led); sc |= adafruit_neopixel_set_pin(pixel, pixel_pin); @@ -52,7 +101,7 @@ sl_status_t adafruit_neopixel_show(neopixel_t *pixel) // rather than stalling for the latch. while (!adafruit_neopixel_can_show(pixel)) {} - sc = adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + sc = adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_SHOW, NULL, 0); @@ -68,7 +117,7 @@ sl_status_t adafruit_neopixel_show(neopixel_t *pixel) sl_status_t adafruit_neopixel_set_pin(neopixel_t *pixel, uint8_t p) { pixel->pin = p; - return adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + return adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_PIN, &p, 1); @@ -109,7 +158,7 @@ sl_status_t adafruit_neopixel_set_pixelColor_rgb(neopixel_t *pixel, writeBuf[1] = offset; memcpy(&writeBuf[2], p, len); - return adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + return adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_BUF, writeBuf, len + 2); @@ -153,7 +202,7 @@ sl_status_t adafruit_neopixel_set_pixelColor_rgbw(neopixel_t *pixel, writeBuf[1] = offset; memcpy(&writeBuf[2], p, len); - return adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + return adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_BUF, writeBuf, len + 2); @@ -192,7 +241,7 @@ sl_status_t adafruit_neopixel_set_pixelColor(neopixel_t *pixel, writeBuf[1] = offset; memcpy(&writeBuf[2], p, len); - return adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + return adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_BUF, writeBuf, len + 2); @@ -215,7 +264,7 @@ sl_status_t adafruit_neopixel_clear(neopixel_t *pixel) for (uint8_t offset = 0; offset < pixel->numBytes; offset += 32 - 4) { writeBuf[0] = (offset >> 8); writeBuf[1] = offset; - sc |= adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + sc |= adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_BUF, writeBuf, 32); @@ -239,7 +288,7 @@ sl_status_t adafruit_neopixel_update_length(neopixel_t *pixel, uint16_t n) uint8_t buf[] = { (uint8_t)(pixel->numBytes >> 8), (uint8_t)(pixel->numBytes & 0xFF) }; - return adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + return adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_BUF_LENGTH, buf, 2); @@ -258,7 +307,7 @@ sl_status_t adafruit_neopixel_update_type(neopixel_t *pixel, neoPixelType t) pixel->bOffset = t & 0b11; pixel->is800KHz = (t < 256); // 400 KHz flag is 1<<8 - sc = adafruit_seesaw_i2c_register_write(pixel->adafruit_seesaw, + sc = adafruit_seesaw_i2c_register_write(&pixel->adafruit_seesaw, SEESAW_NEOPIXEL_BASE, SEESAW_NEOPIXEL_SPEED, (uint8_t *)&(pixel->is800KHz), 1); @@ -301,11 +350,13 @@ uint32_t adafruit_neopixel_getPixelColor(neopixel_t *pixel, const uint16_t n) if (pixel->wOffset == pixel->rOffset) { // Is RGB-type device p = &(pixel->pixels[n * 3]); if (pixel->brightness) { - // Stored color was decimated by setBrightness(). Returned value - // attempts to scale back to an approximation of the original 24-bit - // value used when setting the pixel color, but there will always be - // some error -- those bits are simply gone. Issue is most - // pronounced at low brightness levels. + /* + * Stored color was decimated by setBrightness(). Returned value + * attempts to scale back to an approximation of the original 24-bit + * value used when setting the pixel color, but there will always be + * some error -- those bits are simply gone. Issue is most + * pronounced at low brightness levels. + */ return (((uint32_t)(p[pixel->rOffset] << 8) / pixel->brightness) << 16) | (((uint32_t)(p[pixel->gOffset] << 8) / pixel->brightness) << 8) | ((uint32_t)(p[pixel->bOffset] << 8) / pixel->brightness); diff --git a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neotrellis.c b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neotrellis.c index 9f2b18ae..b35ada8f 100644 --- a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neotrellis.c +++ b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_neotrellis.c @@ -1,7 +1,41 @@ +/***************************************************************************//** + * @file adafruit_neotrellis.c + * @brief adafruit_neotrellis source file for Adafruit NeoTrellis 4x4 keypad. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ #include "adafruit_neotrellis.h" #include "adafruit_neotrellis_config.h" #include "sl_sleeptimer.h" -#include "sl_udelay.h" #define TRELLIS_MAX_DEVICE_SUPPORT 31 #define NUM_NEOTRELLIS_DEVICE (NEOTRELLIS_NUM_COLUMN_BOARDS \ @@ -9,7 +43,7 @@ static neotrellis_t trellis_dev[NUM_NEOTRELLIS_DEVICE]; -sl_status_t adafruit_neotrellis_init(sl_i2cspm_t *i2cspm, +sl_status_t adafruit_neotrellis_init(mikroe_i2c_handle_t i2cspm, uint8_t *trellis_addr, uint8_t addr_list_len) { @@ -26,7 +60,7 @@ sl_status_t adafruit_neotrellis_init(sl_i2cspm_t *i2cspm, } } - for (int i = 0; i < NUM_NEOTRELLIS_DEVICE; i++) { + for (uint8_t i = 0; i < NUM_NEOTRELLIS_DEVICE; i++) { sc = adafruit_neopixel_init(&(trellis_dev[i].pixel), NEO_TRELLIS_NUM_KEYS, NEO_TRELLIS_NEOPIX_PIN, @@ -44,7 +78,7 @@ sl_status_t adafruit_neotrellis_init(sl_i2cspm_t *i2cspm, uint8_t enable_interrupt = 0x01; // enable keypad interrupt - sc = adafruit_seesaw_i2c_register_write(trellis_dev->pixel.adafruit_seesaw, + sc = adafruit_seesaw_i2c_register_write(&trellis_dev->pixel.adafruit_seesaw, SEESAW_KEYPAD_BASE, SEESAW_KEYPAD_INTENSET, &enable_interrupt, 1); @@ -75,7 +109,7 @@ void adafruit_neotrellis_registerCallback_xy(uint16_t x, int ykey = NEO_TRELLIS_Y(y % NEO_TRELLIS_NUM_ROWS * NEO_TRELLIS_NUM_COLS); int key = NEO_TRELLIS_XY(xkey, ykey); - printf("register_Callback: index %d key %d\n", index, key); + printf("register_Callback: index %d key %d\r\n", index, key); trellis_dev[index].callbacks[key] = cb; } @@ -125,7 +159,7 @@ sl_status_t adafruit_neotrellis_activateKey_xy(uint16_t x, uint16_t y, uint8_t cmd[] = { key, ks.reg }; return adafruit_seesaw_i2c_register_write( - trellis_dev[index].pixel.adafruit_seesaw, + &trellis_dev[index].pixel.adafruit_seesaw, SEESAW_KEYPAD_BASE, SEESAW_KEYPAD_EVENT, cmd, @@ -141,7 +175,7 @@ sl_status_t adafruit_neotrellis_setPixelColor_xy(uint16_t x, int xkey = NEO_TRELLIS_X(x); int ykey = NEO_TRELLIS_Y(y % NEO_TRELLIS_NUM_ROWS * NEO_TRELLIS_NUM_COLS); int key = NEO_TRELLIS_XY(xkey, ykey); - printf("pixel color: index %d key %d\n", index, key); + printf("pixel color: index %d key %d\r\n", index, key); return adafruit_neopixel_set_pixelColor(&(trellis_dev[index].pixel), key, color); @@ -166,12 +200,14 @@ void adafruit_neotrellis_read() { for (int n = 0; n < NUM_NEOTRELLIS_DEVICE; n++) { int8_t count = adafruit_seesaw_get_keypad_count( - trellis_dev[n].pixel.adafruit_seesaw); - sl_udelay_wait(500); + &trellis_dev[n].pixel.adafruit_seesaw); + + sl_sleeptimer_delay_millisecond(1); + if (count > 0) { count = count + 2; keyEventRaw e[count]; - adafruit_seesaw_read_keypad(trellis_dev[n].pixel.adafruit_seesaw, e, + adafruit_seesaw_read_keypad(&trellis_dev[n].pixel.adafruit_seesaw, e, count); for (int i = 0; i < count; i++) { // call any callbacks associated with the key diff --git a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_seesaw.c b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_seesaw.c index e5f84ed6..f1b989f1 100644 --- a/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_seesaw.c +++ b/driver/public/silabs/adafruit_neotrellis_keypad_atsamd09/src/adafruit_seesaw.c @@ -1,119 +1,114 @@ -#include "sl_udelay.h" +/***************************************************************************//** + * @file adafruit_seesaw.c + * @brief adafruit_seesaw source file for Adafruit NeoTrellis 4x4 keypad. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ +#include "sl_sleeptimer.h" #include "adafruit_seesaw.h" +#include "stdlib.h" -sl_status_t adafruit_seesaw_i2c_init(seesaw_t seesaw_dev) -{ - /// Variables and structures for transfer - uint8_t data = 0; - I2C_TransferSeq_TypeDef i2cTransfer; - /// if the parameter is over 7 bit return error code - if (seesaw_dev.i2c_addr > 0x4D) { - return SL_STATUS_FAIL; - } - - /// Initializing I2C transfer It supports 7-bit I2C follower address, - /// the value of the "address" here should be left shifted by one. - /// Use flag master write - - i2cTransfer.addr = seesaw_dev.i2c_addr << 1; - i2cTransfer.flags = I2C_FLAG_WRITE_READ; - - /// Transmit buffer, no data to send - i2cTransfer.buf[0].data = 0; - i2cTransfer.buf[0].len = 0; - - /// Receive buffer, two bytes to receive - i2cTransfer.buf[1].data = &data; - i2cTransfer.buf[1].len = 1; - - return I2CSPM_Transfer(seesaw_dev.i2c_instance, &i2cTransfer); -} - -sl_status_t adafruit_seesaw_i2c_register_read(seesaw_t seesaw_dev, +sl_status_t adafruit_seesaw_i2c_register_read(seesaw_t *seesaw_dev, uint8_t reg_high, uint8_t reg_low, uint8_t *pdata, uint8_t len, - uint16_t delay) + uint16_t delay_ms) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; uint8_t pos = 0; uint8_t i2c_write_data[2]; + uint8_t read_now; while (pos < len) { - uint8_t read_now; - if ((pos + 32) < len) { read_now = 32; } else { read_now = len; } - seq.addr = seesaw_dev.i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE; - i2c_write_data[0] = reg_high; i2c_write_data[1] = reg_low; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 2; - - result = I2CSPM_Transfer(seesaw_dev.i2c_instance, &seq); - if (result != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&seesaw_dev->i2c_instance, + i2c_write_data, + 2)) { return SL_STATUS_TRANSMIT; } - sl_udelay_wait(delay); - - seq.flags = I2C_FLAG_READ; + sl_sleeptimer_delay_millisecond(delay_ms); - seq.buf[0].data = pdata; - seq.buf[0].len = read_now; + if (I2C_MASTER_SUCCESS != i2c_master_read(&seesaw_dev->i2c_instance, + pdata, + read_now)) { + return SL_STATUS_TRANSMIT; + } - result = I2CSPM_Transfer(seesaw_dev.i2c_instance, &seq); pos += read_now; pdata += pos; - - if (result != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } } return SL_STATUS_OK; } -sl_status_t adafruit_seesaw_i2c_register_write(seesaw_t seesaw_dev, +sl_status_t adafruit_seesaw_i2c_register_write(seesaw_t *seesaw_dev, uint8_t reg_high, uint8_t reg_low, uint8_t *pdata, uint16_t len) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - uint8_t i2_reg_addr[2]; - - seq.addr = seesaw_dev.i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE_WRITE; - - i2_reg_addr[0] = reg_high; - i2_reg_addr[1] = reg_low; - - seq.buf[0].data = i2_reg_addr; - seq.buf[0].len = 2; + uint8_t data_buffer[len + 2]; + data_buffer[0] = reg_high; + data_buffer[1] = reg_low; + + if ((NULL != pdata) && (len > 0)) { + for (uint8_t i = 0; i < len; i++) + { + data_buffer[i + 2] = pdata[i]; + } + } - seq.buf[1].data = pdata; - seq.buf[1].len = len; + err_t stt = i2c_master_write(&seesaw_dev->i2c_instance, + data_buffer, + len + 2 + ); - result = I2CSPM_Transfer(seesaw_dev.i2c_instance, &seq); - if (result != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != stt) { return SL_STATUS_TRANSMIT; } return SL_STATUS_OK; } -int8_t adafruit_seesaw_get_keypad_count(seesaw_t seesaw_dev) +int8_t adafruit_seesaw_get_keypad_count(seesaw_t *seesaw_dev) { sl_status_t sc; int8_t count = 0; @@ -122,7 +117,7 @@ int8_t adafruit_seesaw_get_keypad_count(seesaw_t seesaw_dev) SEESAW_KEYPAD_BASE, SEESAW_KEYPAD_COUNT, (uint8_t *)&count, - 1, 500); + 1, 1); if (sc != SL_STATUS_OK) { return -1; @@ -139,7 +134,7 @@ int8_t adafruit_seesaw_get_keypad_count(seesaw_t seesaw_dev) * @param count the number of events to read * @returns True on I2C read success *****************************************************************************/ -sl_status_t adafruit_seesaw_read_keypad(seesaw_t seesaw_dev, +sl_status_t adafruit_seesaw_read_keypad(seesaw_t *seesaw_dev, keyEventRaw *buf, uint8_t count) { @@ -148,5 +143,5 @@ sl_status_t adafruit_seesaw_read_keypad(seesaw_t seesaw_dev, SEESAW_KEYPAD_FIFO, (uint8_t *)buf, count, - 1000); + 1); } diff --git a/driver/public/silabs/air_quality_sgp40/config/sparkfun_sgp40_config.h b/driver/public/silabs/air_quality_sgp40/config/sparkfun_sgp40_config.h new file mode 100644 index 00000000..5cf06a6d --- /dev/null +++ b/driver/public/silabs/air_quality_sgp40/config/sparkfun_sgp40_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file sparkfun_sgp40_config.h + * @brief sparkfun sgp40 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SPARKFUN_SGP40_CONFIG_H +#define SPARKFUN_SGP40_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//SPARKFUN SGP40 I2C Configuration + +// SPARKFUN SGP40 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_SGP40_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_SGP40_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // SPARKFUN_SGP40_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/air_quality_sgp40/inc/sparkfun_sgp40.h b/driver/public/silabs/air_quality_sgp40/inc/sparkfun_sgp40.h index 8207bcb4..3ab32985 100644 --- a/driver/public/silabs/air_quality_sgp40/inc/sparkfun_sgp40.h +++ b/driver/public/silabs/air_quality_sgp40/inc/sparkfun_sgp40.h @@ -35,16 +35,21 @@ #ifndef SPARKFUN_SGP40_H_ #define SPARKFUN_SGP40_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include - -#include "sl_i2cspm.h" #include "sl_status.h" +#include "drv_i2c_master.h" /***************************************************************************//** * @addtogroup SGP40 - Air Quality Sensor * @brief This file contains API for Air Quality Sensor SGP40 driver. ******************************************************************************/ +#define SGP40_ADDRESS 0x59 + /// @brief GSP40 Lookup table for CRC8. #define SGP40_LOOKUP_TABLE @@ -177,7 +182,7 @@ static const uint8_t CRC8LookupTable[16][16] = { * * @li @ref SL_STATUS_FAIL Failure. ******************************************************************************/ -sl_status_t sparkfun_sgp40_init(sl_i2cspm_t *i2cspm); +sl_status_t sparkfun_sgp40_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -318,4 +323,8 @@ void sparkfun_sgp40_voc_algorithm_process(int32_t sraw, int32_t *voc_index); ******************************************************************************/ uint8_t sparkfun_sgp40_crc8(uint16_t data); +#ifdef __cplusplus +} +#endif + #endif diff --git a/driver/public/silabs/air_quality_sgp40/src/sparkfun_sgp40.c b/driver/public/silabs/air_quality_sgp40/src/sparkfun_sgp40.c index 98e8aa29..51af97fd 100644 --- a/driver/public/silabs/air_quality_sgp40/src/sparkfun_sgp40.c +++ b/driver/public/silabs/air_quality_sgp40/src/sparkfun_sgp40.c @@ -33,14 +33,14 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ #include "sparkfun_sgp40.h" -#include "sparkfun_sgp40_i2c.h" - #include "sl_sleeptimer.h" +#include "sparkfun_sgp40_config.h" + +typedef i2c_master_t sgp40_handle_t; // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- -static sl_i2cspm_t *sgp40_i2cpsm_instance; static uint8_t i2c_is_initialized = false; /// @brief Specified SGP40 commands of Air Quality Sensor driver. @@ -63,7 +63,7 @@ static fix16_t voc_algorithm_sigmoid_scaled_process(fix16_t sample); static fix16_t voc_algorithm_adaptive_lowpass_process(fix16_t sample); static fix16_t voc_algorithm_mean_variance_estimator_sigmoid_process( - fix16_t sample); + fix16_t sample); static void voc_algorithm_mean_variance_estimator_calculate_gamma( fix16_t voc_index_from_prior); @@ -118,6 +118,15 @@ static fix16_t fix16_sqrt(fix16_t x); static fix16_t fix16_exp(fix16_t x); +static sgp40_handle_t sgp40_handle; + +static sl_status_t i2c_read_blocking(sgp40_handle_t *handle, + uint8_t *dest, + uint32_t len); +static sl_status_t i2c_write_blocking(sgp40_handle_t *handle, + uint8_t *src, + uint32_t len); + // ----------------------------------------------------------------------------- // Global Function // ----------------------------------------------------------------------------- @@ -125,11 +134,11 @@ static fix16_t fix16_exp(fix16_t x); /**************************************************************************//** * This function Initialize the sensor I2C instance. *****************************************************************************/ -sl_status_t sparkfun_sgp40_init(sl_i2cspm_t *i2cspm) +sl_status_t sparkfun_sgp40_init(mikroe_i2c_handle_t i2cspm_instance) { - sl_status_t sc; + i2c_master_config_t i2c_cfg; - if (i2cspm == NULL) { + if (i2cspm_instance == NULL) { return SL_STATUS_NULL_POINTER; } @@ -138,12 +147,18 @@ sl_status_t sparkfun_sgp40_init(sl_i2cspm_t *i2cspm) return SL_STATUS_ALREADY_INITIALIZED; } - // Update i2cspm instance - sgp40_i2cpsm_instance = i2cspm; + sgp40_handle.handle = i2cspm_instance; - sc = i2c_write_blocking(sgp40_i2cpsm_instance, NULL, 0); - if (sc != SL_STATUS_OK) { - return sc; + i2c_master_configure_default(&i2c_cfg); + i2c_cfg.addr = SGP40_ADDRESS; + i2c_cfg.timeout_pass_count = 0; + +#if (SPARKFUN_SGP40_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_SGP40_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&sgp40_handle, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; } i2c_is_initialized = true; @@ -160,13 +175,13 @@ sl_status_t sparkfun_sgp40_measure_test(uint16_t *results) uint8_t check_sum; sl_status_t sc; - sc = i2c_write_blocking(sgp40_i2cpsm_instance, sgp40_measure_test, 2); + sc = i2c_write_blocking(&sgp40_handle, sgp40_measure_test, 2); if (sc != SL_STATUS_OK) { return sc; } sl_sleeptimer_delay_millisecond(320); - sc = i2c_read_blocking(sgp40_i2cpsm_instance, data_to_read, 3); + sc = i2c_read_blocking(&sgp40_handle, data_to_read, 3); if (sc != SL_STATUS_OK) { return sc; } @@ -188,7 +203,7 @@ sl_status_t sparkfun_sgp40_soft_reset(void) { sl_status_t sc; - sc = i2c_write_blocking(sgp40_i2cpsm_instance, sgp40_soft_reset, 2); + sc = i2c_write_blocking(&sgp40_handle, sgp40_soft_reset, 2); if (sc != SL_STATUS_OK) { return sc; } @@ -202,7 +217,7 @@ sl_status_t sparkfun_sgp40_heater_off(void) { sl_status_t sc; - sc = i2c_write_blocking(sgp40_i2cpsm_instance, sgp40_heater_off, 2); + sc = i2c_write_blocking(&sgp40_handle, sgp40_heater_off, 2); sl_sleeptimer_delay_millisecond(1); if (sc != SL_STATUS_OK) { @@ -243,7 +258,7 @@ sl_status_t sparkfun_sgp40_measure_raw(uint16_t *sraw_ticks, float rh, float t) t_ticks = (uint16_t)((t + 45) * 65535 / 175); // Perform a raw measurement - sc = i2c_write_blocking(sgp40_i2cpsm_instance, sgp40_measure_raw, 2); + sc = i2c_write_blocking(&sgp40_handle, sgp40_measure_raw, 2); data_to_write[0] = sgp40_measure_raw[0]; data_to_write[1] = sgp40_measure_raw[1]; @@ -254,13 +269,13 @@ sl_status_t sparkfun_sgp40_measure_raw(uint16_t *sraw_ticks, float rh, float t) data_to_write[6] = ((uint8_t)(t_ticks & 0xFF)); data_to_write[7] = (sparkfun_sgp40_crc8(t_ticks)); - sc = i2c_write_blocking(sgp40_i2cpsm_instance, data_to_write, 8); + sc = i2c_write_blocking(&sgp40_handle, data_to_write, 8); if (sc != SL_STATUS_OK) { return sc; } sl_sleeptimer_delay_millisecond(30); - sc = i2c_read_blocking(sgp40_i2cpsm_instance, data_to_read, 3); + sc = i2c_read_blocking(&sgp40_handle, data_to_read, 3); if (sc != SL_STATUS_OK) { return sc; } @@ -416,9 +431,11 @@ void sparkfun_sgp40_voc_algorithm_process(int32_t sraw, int32_t *voc_index) static fix16_t voc_algorithm_mox_model_process(fix16_t sraw) { - return fix16_mul((fix16_div((sraw- voc_algorithm_parameters->m_Mox_Model_Sraw_Mean), - (-(voc_algorithm_parameters->m_Mox_Model_Sraw_Std + F16(VOC_ALGORITHM_SRAW_STD_BONUS))))), - F16(VOC_ALGORITHM_VOC_INDEX_GAIN)); + return fix16_mul((fix16_div((sraw + - voc_algorithm_parameters->m_Mox_Model_Sraw_Mean), + (-(voc_algorithm_parameters->m_Mox_Model_Sraw_Std + + F16(VOC_ALGORITHM_SRAW_STD_BONUS))))), + F16(VOC_ALGORITHM_VOC_INDEX_GAIN)); } static fix16_t voc_algorithm_sigmoid_scaled_process(fix16_t sample) @@ -427,24 +444,27 @@ static fix16_t voc_algorithm_sigmoid_scaled_process(fix16_t sample) fix16_t shift; x = fix16_mul(F16(VOC_ALGORITHM_SIGMOID_K), - (sample - F16(VOC_ALGORITHM_SIGMOID_X0))); + (sample - F16(VOC_ALGORITHM_SIGMOID_X0))); if ((x < F16(-50.))) { return F16(VOC_ALGORITHM_SIGMOID_L); } else if ((x > F16(50.))) { return F16(0.); } else { if ((sample >= F16(0.))) { - shift = fix16_div(F16(VOC_ALGORITHM_SIGMOID_L) - - (fix16_mul(F16(5.), voc_algorithm_parameters->m_Sigmoid_Scaled_Offset)), + shift = fix16_div(F16(VOC_ALGORITHM_SIGMOID_L) + - (fix16_mul(F16(5.), + voc_algorithm_parameters-> + m_Sigmoid_Scaled_Offset)), F16(4.)); return ((fix16_div(F16(VOC_ALGORITHM_SIGMOID_L) + shift, F16(1.) + fix16_exp(x)))) - shift; } else { - return fix16_mul(fix16_div(voc_algorithm_parameters->m_Sigmoid_Scaled_Offset, - F16(VOC_ALGORITHM_VOC_INDEX_OFFSET_DEFAULT)), + return fix16_mul(fix16_div(voc_algorithm_parameters-> + m_Sigmoid_Scaled_Offset, + F16(VOC_ALGORITHM_VOC_INDEX_OFFSET_DEFAULT)), fix16_div(F16(VOC_ALGORITHM_SIGMOID_L), - F16(1.) + fix16_exp(x))); + F16(1.) + fix16_exp(x))); } } } @@ -468,10 +488,10 @@ static fix16_t voc_algorithm_adaptive_lowpass_process(fix16_t sample) + fix16_mul(voc_algorithm_parameters->m_Adaptive_Lowpass_A1, sample); voc_algorithm_parameters->m_Adaptive_Lowpass_X2 = (fix16_mul((F16(1.) - voc_algorithm_parameters->m_Adaptive_Lowpass_A2), - voc_algorithm_parameters->m_Adaptive_Lowpass_X2)) - + fix16_mul(voc_algorithm_parameters->m_Adaptive_Lowpass_A2, sample); + voc_algorithm_parameters->m_Adaptive_Lowpass_X2)) + + fix16_mul(voc_algorithm_parameters->m_Adaptive_Lowpass_A2, sample); abs_delta = voc_algorithm_parameters->m_Adaptive_Lowpass_X1 - - voc_algorithm_parameters->m_Adaptive_Lowpass_X2; + - voc_algorithm_parameters->m_Adaptive_Lowpass_X2; if ((abs_delta < F16(0.))) { abs_delta = (-abs_delta); } @@ -483,7 +503,7 @@ static fix16_t voc_algorithm_adaptive_lowpass_process(fix16_t sample) F16(VOC_ALGORITHM_SAMPLING_INTERVAL) + tau_a); voc_algorithm_parameters->m_Adaptive_Lowpass_X3 = fix16_mul(F16(1.) - a3, - voc_algorithm_parameters->m_Adaptive_Lowpass_X3) + voc_algorithm_parameters->m_Adaptive_Lowpass_X3) + fix16_mul(a3, sample); return voc_algorithm_parameters->m_Adaptive_Lowpass_X3; @@ -495,14 +515,16 @@ static fix16_t voc_algorithm_mean_variance_estimator_sigmoid_process( fix16_t x; x = fix16_mul(voc_algorithm_parameters->m_Mean_Variance_Estimator_Sigmoid_K, - sample - voc_algorithm_parameters->m_Mean_Variance_Estimator_Sigmoid_X0); + sample + - voc_algorithm_parameters->m_Mean_Variance_Estimator_Sigmoid_X0); if ((x < F16(-50.))) { return voc_algorithm_parameters->m_Mean_Variance_Estimator_Sigmoid_L; } else if ((x > F16(50.))) { return F16(0.); } else { - return fix16_div(voc_algorithm_parameters->m_Mean_Variance_Estimator_Sigmoid_L, - F16(1.) + fix16_exp(x)); + return fix16_div( + voc_algorithm_parameters->m_Mean_Variance_Estimator_Sigmoid_L, + F16(1.) + fix16_exp(x)); } } @@ -522,12 +544,14 @@ static void voc_algorithm_mean_variance_estimator_calculate_gamma( uptime_limit = F16((VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_FIX16_MAX - VOC_ALGORITHM_SAMPLING_INTERVAL)); - if (voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gamma < uptime_limit) { + if (voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gamma + < uptime_limit) { voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gamma = voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gamma + F16(VOC_ALGORITHM_SAMPLING_INTERVAL); } - if (voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gating < uptime_limit) { + if (voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gating + < uptime_limit) { voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gating = voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gating + F16(VOC_ALGORITHM_SAMPLING_INTERVAL); @@ -539,41 +563,51 @@ static void voc_algorithm_mean_variance_estimator_calculate_gamma( sigmoid_gamma_mean = voc_algorithm_mean_variance_estimator_sigmoid_process( voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gamma); gamma_mean = voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma - + fix16_mul(voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Initial_Mean - - voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma, - sigmoid_gamma_mean); + + fix16_mul(voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Initial_Mean + - voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma, + sigmoid_gamma_mean); gating_threshold_mean = F16(VOC_ALGORITHM_GATING_THRESHOLD) - + fix16_mul(F16((VOC_ALGORITHM_GATING_THRESHOLD_INITIAL - - VOC_ALGORITHM_GATING_THRESHOLD)), - voc_algorithm_mean_variance_estimator_sigmoid_process( - voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gating)); - voc_algorithm_mean_variance_estimator_sigmoid_set_parameters(F16(1.), + + fix16_mul(F16(( + VOC_ALGORITHM_GATING_THRESHOLD_INITIAL + - VOC_ALGORITHM_GATING_THRESHOLD)), + voc_algorithm_mean_variance_estimator_sigmoid_process( + voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Uptime_Gating)); + voc_algorithm_mean_variance_estimator_sigmoid_set_parameters(F16( + 1.), gating_threshold_mean, - F16(VOC_ALGORITHM_GATING_THRESHOLD_TRANSITION)); + F16( + VOC_ALGORITHM_GATING_THRESHOLD_TRANSITION)); sigmoid_gating_mean = voc_algorithm_mean_variance_estimator_sigmoid_process(voc_index_from_prior); voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Mean = fix16_mul(sigmoid_gating_mean, gamma_mean); voc_algorithm_mean_variance_estimator_sigmoid_set_parameters(F16(1.), - F16(VOC_ALGORITHM_INIT_DURATION_VARIANCE), - F16(VOC_ALGORITHM_INIT_TRANSITION_VARIANCE)); + F16( + VOC_ALGORITHM_INIT_DURATION_VARIANCE), + F16( + VOC_ALGORITHM_INIT_TRANSITION_VARIANCE)); sigmoid_gamma_variance = voc_algorithm_mean_variance_estimator_sigmoid_process( voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gamma); gamma_variance = (voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma - + fix16_mul((voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Initial_Variance - - voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma), - sigmoid_gamma_variance - sigmoid_gamma_mean)); + + fix16_mul((voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Gamma_Initial_Variance + - voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma), + sigmoid_gamma_variance - sigmoid_gamma_mean)); gating_threshold_variance = F16(VOC_ALGORITHM_GATING_THRESHOLD) - + fix16_mul(F16((VOC_ALGORITHM_GATING_THRESHOLD_INITIAL - - VOC_ALGORITHM_GATING_THRESHOLD)), - voc_algorithm_mean_variance_estimator_sigmoid_process( - voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gating)); - voc_algorithm_mean_variance_estimator_sigmoid_set_parameters(F16(1.), + + fix16_mul(F16((VOC_ALGORITHM_GATING_THRESHOLD_INITIAL + - VOC_ALGORITHM_GATING_THRESHOLD)), + voc_algorithm_mean_variance_estimator_sigmoid_process( + voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Uptime_Gating)); + voc_algorithm_mean_variance_estimator_sigmoid_set_parameters(F16( + 1.), gating_threshold_variance, - F16(VOC_ALGORITHM_GATING_THRESHOLD_TRANSITION)); + F16( + VOC_ALGORITHM_GATING_THRESHOLD_TRANSITION)); sigmoid_gating_variance = voc_algorithm_mean_variance_estimator_sigmoid_process(voc_index_from_prior); voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Variance = @@ -582,13 +616,17 @@ static void voc_algorithm_mean_variance_estimator_calculate_gamma( (voc_algorithm_parameters->m_Mean_Variance_Estimator_Gating_Duration_Minutes + fix16_mul(F16((VOC_ALGORITHM_SAMPLING_INTERVAL / 60.)), ((fix16_mul((F16(1.) - sigmoid_gating_mean), - F16((1. + VOC_ALGORITHM_GATING_MAX_RATIO)))) + F16((1. + VOC_ALGORITHM_GATING_MAX_RATIO)))) - F16(VOC_ALGORITHM_GATING_MAX_RATIO)))); - if (voc_algorithm_parameters->m_Mean_Variance_Estimator_Gating_Duration_Minutes < F16(0.)) { - voc_algorithm_parameters->m_Mean_Variance_Estimator_Gating_Duration_Minutes= F16(0.); + if (voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Gating_Duration_Minutes < F16(0.)) { + voc_algorithm_parameters->m_Mean_Variance_Estimator_Gating_Duration_Minutes + = F16(0.); } - if (voc_algorithm_parameters->m_Mean_Variance_Estimator_Gating_Duration_Minutes - > voc_algorithm_parameters->m_Mean_Variance_Estimator_Gating_Max_Duration_Minutes) { + if (voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Gating_Duration_Minutes + > voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Gating_Max_Duration_Minutes) { voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gating = F16(0.); } } @@ -607,9 +645,9 @@ static void voc_algorithm_mean_variance_estimator_process(fix16_t sraw, voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean = F16(0.); } else { if ((voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean - >= F16(100.)) - || (voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean - <= F16(-100.))) { + >= F16(100.)) + || (voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean + <= F16(-100.))) { voc_algorithm_parameters->m_Mean_Variance_Estimator_Sraw_Offset = (voc_algorithm_parameters->m_Mean_Variance_Estimator_Sraw_Offset + voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean); @@ -632,19 +670,28 @@ static void voc_algorithm_mean_variance_estimator_process(fix16_t sraw, } voc_algorithm_parameters->m_Mean_Variance_Estimator_Std = fix16_mul(fix16_sqrt(fix16_mul(additional_scaling, - F16(VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING) - - voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Variance)), - fix16_sqrt(fix16_mul(voc_algorithm_parameters->m_Mean_Variance_Estimator_Std, - fix16_div(voc_algorithm_parameters->m_Mean_Variance_Estimator_Std, - fix16_mul(F16(VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING), + F16( + VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING) + - voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Gamma_Variance)), + fix16_sqrt(fix16_mul(voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Std, + fix16_div(voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Std, + fix16_mul(F16( + VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING), additional_scaling)) - + fix16_mul(fix16_div(fix16_mul(voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Variance, - delta_sgp), - additional_scaling), - delta_sgp)))); + + fix16_mul(fix16_div(fix16_mul( + voc_algorithm_parameters + -> + m_Mean_Variance_Estimator_Gamma_Variance, + delta_sgp), + additional_scaling), + delta_sgp)))); voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean = (voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean - + fix16_mul(voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Mean, + + fix16_mul(voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Gamma_Mean, delta_sgp)); } } @@ -661,7 +708,8 @@ static void voc_algorithm_mean_variance_estimator_set_parameters( fix16_t tau_mean_variance_hours, fix16_t gating_max_duration_minutes) { - voc_algorithm_parameters->m_Mean_Variance_Estimator_Gating_Max_Duration_Minutes = + voc_algorithm_parameters-> + m_Mean_Variance_Estimator_Gating_Max_Duration_Minutes = gating_max_duration_minutes; voc_algorithm_parameters->m_Mean_Variance_Estimator_Initialized = false; voc_algorithm_parameters->m_Mean_Variance_Estimator_Mean = F16(0.); @@ -669,18 +717,18 @@ static void voc_algorithm_mean_variance_estimator_set_parameters( voc_algorithm_parameters->m_Mean_Variance_Estimator_Std = std_initial; voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma = fix16_div(F16((VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING - * (VOC_ALGORITHM_SAMPLING_INTERVAL / 3600.))), + * (VOC_ALGORITHM_SAMPLING_INTERVAL / 3600.))), tau_mean_variance_hours - + F16((VOC_ALGORITHM_SAMPLING_INTERVAL / 3600.))); + + F16((VOC_ALGORITHM_SAMPLING_INTERVAL / 3600.))); voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Initial_Mean = F16(((VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING - * VOC_ALGORITHM_SAMPLING_INTERVAL) + * VOC_ALGORITHM_SAMPLING_INTERVAL) / (VOC_ALGORITHM_TAU_INITIAL_MEAN + VOC_ALGORITHM_SAMPLING_INTERVAL))); voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Initial_Variance = F16(((VOC_ALGORITHM_MEAN_VARIANCE_ESTIMATOR_GAMMA_SCALING - * VOC_ALGORITHM_SAMPLING_INTERVAL) + * VOC_ALGORITHM_SAMPLING_INTERVAL) / (VOC_ALGORITHM_TAU_INITIAL_VARIANCE - + VOC_ALGORITHM_SAMPLING_INTERVAL))); + + VOC_ALGORITHM_SAMPLING_INTERVAL))); voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Mean = F16(0.); voc_algorithm_parameters->m_Mean_Variance_Estimator_Gamma_Variance = F16(0.); voc_algorithm_parameters->m_Mean_Variance_Estimator_Uptime_Gamma = F16(0.); @@ -970,3 +1018,29 @@ static fix16_t fix16_exp(fix16_t x) } return res; } + +static sl_status_t i2c_read_blocking(sgp40_handle_t *handle, + uint8_t *dest, + uint32_t len) +{ + if (I2C_MASTER_SUCCESS != i2c_master_read(handle, + dest, + len)) { + return SL_STATUS_TRANSMIT; + } + + return SL_STATUS_OK; +} + +static sl_status_t i2c_write_blocking(sgp40_handle_t *handle, + uint8_t *src, + uint32_t len) +{ + if (I2C_MASTER_SUCCESS != i2c_master_write(handle, + src, + len)) { + return SL_STATUS_TRANSMIT; + } + + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/distance_vl53l1x/config/sparkfun_vl53l1x_config.h b/driver/public/silabs/distance_vl53l1x/config/sparkfun_vl53l1x_config.h index 0f6c2b3f..8f691a3a 100644 --- a/driver/public/silabs/distance_vl53l1x/config/sparkfun_vl53l1x_config.h +++ b/driver/public/silabs/distance_vl53l1x/config/sparkfun_vl53l1x_config.h @@ -47,8 +47,29 @@ extern "C" { // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// VL53L1X I2C Configuration + +// VL53L1X I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define VL53L1X_I2C__UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define VL53L1X_I2C_SPEED_MODE 0 + +// +// + +// Connection // I2C Address <0x1..0x7E:0x1> -#define VL53L1X_ADDR 0x29 +// Default: 0x29 +#define VL53L1X_ADDR 0x29 +// // The block ends with the following line or at the end of the file: // <<< end of configuration section >>> @@ -57,4 +78,4 @@ extern "C" { } #endif -#endif /* SPARKFUN_VL53L1X_CONFIG_H_ */ +#endif // SPARKFUN_VL53L1X_CONFIG_H_ diff --git a/driver/public/silabs/distance_vl53l1x/inc/sparkfun_vl53l1x.h b/driver/public/silabs/distance_vl53l1x/inc/sparkfun_vl53l1x.h index 85506666..107780fc 100644 --- a/driver/public/silabs/distance_vl53l1x/inc/sparkfun_vl53l1x.h +++ b/driver/public/silabs/distance_vl53l1x/inc/sparkfun_vl53l1x.h @@ -41,7 +41,7 @@ #define VL53L1X_H_ #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -99,25 +99,27 @@ typedef struct { * @param[in] dev * Device address. (Default: 0x29[0x52]) * + * @param[in] i2c_instance + * I2C instance * * @return * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t vl53l1x_init(uint16_t dev, sl_i2cspm_t *i2cspm_instance); +sl_status_t vl53l1x_init(uint16_t dev, mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief * This function sets the IC2SPM instance used by platform functions. * - * @param[in] i2cspm_instance - * I2CSPM instance, default: VL53L1X_CONFIG_I2C_INSTANCE + * @param[in] i2c_instance + * I2C instance * * @return * SL_STATUS_OK if there are no errors. * SL_STATUS_INVALID_PARAMETER if int_pol is invalid. ******************************************************************************/ -sl_status_t vl53l1x_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance); +sl_status_t vl53l1x_set_i2cspm_instance(mikroe_i2c_handle_t i2c_instance); /***************************************************************************//** * @brief @@ -915,4 +917,4 @@ sl_status_t vl53l1x_calibrate_xtalk(uint16_t dev, /** @} */ -#endif /* VL53L1X_H_ */ +#endif // VL53L1X_H_ diff --git a/driver/public/silabs/distance_vl53l1x/src/sparkfun_vl53l1x.c b/driver/public/silabs/distance_vl53l1x/src/sparkfun_vl53l1x.c index 883f3a1e..25393a1f 100644 --- a/driver/public/silabs/distance_vl53l1x/src/sparkfun_vl53l1x.c +++ b/driver/public/silabs/distance_vl53l1x/src/sparkfun_vl53l1x.c @@ -41,30 +41,49 @@ #include "sparkfun_vl53l1x_calibration.h" #include "sparkfun_vl53l1_platform.h" #include "sparkfun_vl53l1x.h" +#include "sparkfun_vl53l1x_config.h" -#ifdef __cplusplus -extern "C" { -#endif +static i2c_master_t vl53l1x_inst; -sl_status_t vl53l1x_init(uint16_t dev, sl_i2cspm_t *i2cspm_instance) +sl_status_t vl53l1x_init(uint16_t dev, mikroe_i2c_handle_t i2c_instance) { - sl_status_t ret; + i2c_master_config_t i2c_cfg; + + if (NULL == i2c_instance) { + return SL_STATUS_INVALID_PARAMETER; + } + + // Configure default i2csmp instance + vl53l1x_inst.handle = i2c_instance; + + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = VL53L1X_ADDR; - ret = vl53l1x_set_i2cspm_instance(i2cspm_instance); - if (ret != SL_STATUS_OK) { - return ret; +#if (VL53L1X_I2C__UC == 1) + i2c_cfg.speed = VL53L1X_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&vl53l1x_inst, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; } + i2c_master_set_speed(&vl53l1x_inst, i2c_cfg.speed); + i2c_master_set_timeout(&vl53l1x_inst, 0); + + vl53l1x_platform_set_i2cspm_instance(&vl53l1x_inst); + return VL53L1X_SensorInit(dev); } -sl_status_t vl53l1x_set_i2cspm_instance(sl_i2cspm_t *i2cspm_instance) +sl_status_t vl53l1x_set_i2cspm_instance(mikroe_i2c_handle_t i2c_instance) { - if (NULL == i2cspm_instance) { + if (NULL == i2c_instance) { return SL_STATUS_INVALID_PARAMETER; } - vl53l1x_platform_set_i2cspm_instance(i2cspm_instance); + vl53l1x_inst.handle = i2c_instance; + vl53l1x_platform_set_i2cspm_instance(&vl53l1x_inst); return SL_STATUS_OK; } @@ -401,7 +420,3 @@ sl_status_t vl53l1x_calibrate_xtalk(uint16_t dev, } return VL53L1X_CalibrateXtalk(dev, target_distance_in_mm, xtalk); } - -#ifdef __cplusplus -} -#endif diff --git a/driver/public/silabs/dosimeter_type5/config/brd2601b/sparkfun_type5_config.h b/driver/public/silabs/dosimeter_type5/config/brd2601b/sparkfun_type5_config.h index 5d798e53..259c3e68 100644 --- a/driver/public/silabs/dosimeter_type5/config/brd2601b/sparkfun_type5_config.h +++ b/driver/public/silabs/dosimeter_type5/config/brd2601b/sparkfun_type5_config.h @@ -39,8 +39,7 @@ #include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> @@ -83,4 +82,4 @@ extern "C" } #endif -#endif /* SPARKFUN_TYPE5_CONFIG_H_ */ +#endif // SPARKFUN_TYPE5_CONFIG_H_ diff --git a/driver/public/silabs/dosimeter_type5/config/brd2703a/sparkfun_type5_config.h b/driver/public/silabs/dosimeter_type5/config/brd2703a/sparkfun_type5_config.h index 49735027..d9106577 100644 --- a/driver/public/silabs/dosimeter_type5/config/brd2703a/sparkfun_type5_config.h +++ b/driver/public/silabs/dosimeter_type5/config/brd2703a/sparkfun_type5_config.h @@ -39,8 +39,7 @@ #include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> @@ -83,4 +82,4 @@ extern "C" } #endif -#endif /* SPARKFUN_TYPE5_CONFIG_H_ */ +#endif // SPARKFUN_TYPE5_CONFIG_H_ diff --git a/driver/public/silabs/dosimeter_type5/config/brd2704a/sparkfun_type5_config.h b/driver/public/silabs/dosimeter_type5/config/brd2704a/sparkfun_type5_config.h index 8b960fee..5cdafa6d 100644 --- a/driver/public/silabs/dosimeter_type5/config/brd2704a/sparkfun_type5_config.h +++ b/driver/public/silabs/dosimeter_type5/config/brd2704a/sparkfun_type5_config.h @@ -39,8 +39,7 @@ #include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> @@ -83,4 +82,4 @@ extern "C" } #endif -#endif /* SPARKFUN_TYPE5_CONFIG_H_ */ +#endif // SPARKFUN_TYPE5_CONFIG_H_ diff --git a/driver/public/silabs/dosimeter_type5/config/brd4108a/sparkfun_type5_config.h b/driver/public/silabs/dosimeter_type5/config/brd4108a/sparkfun_type5_config.h index 4463f823..9f3460af 100644 --- a/driver/public/silabs/dosimeter_type5/config/brd4108a/sparkfun_type5_config.h +++ b/driver/public/silabs/dosimeter_type5/config/brd4108a/sparkfun_type5_config.h @@ -39,8 +39,7 @@ #include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> @@ -83,4 +82,4 @@ extern "C" } #endif -#endif /* SPARKFUN_TYPE5_CONFIG_H_ */ +#endif // SPARKFUN_TYPE5_CONFIG_H_ diff --git a/driver/public/silabs/dosimeter_type5/config/brd4314a/sparkfun_type5_config.h b/driver/public/silabs/dosimeter_type5/config/brd4314a/sparkfun_type5_config.h index 4463f823..9f3460af 100644 --- a/driver/public/silabs/dosimeter_type5/config/brd4314a/sparkfun_type5_config.h +++ b/driver/public/silabs/dosimeter_type5/config/brd4314a/sparkfun_type5_config.h @@ -39,8 +39,7 @@ #include "em_gpio.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> @@ -83,4 +82,4 @@ extern "C" } #endif -#endif /* SPARKFUN_TYPE5_CONFIG_H_ */ +#endif // SPARKFUN_TYPE5_CONFIG_H_ diff --git a/driver/public/silabs/pir_ira_s210st01/config/pir_ira_s210st01_config.h b/driver/public/silabs/dosimeter_type5/config/brd4338a/sparkfun_type5_config.h similarity index 63% rename from driver/public/silabs/pir_ira_s210st01/config/pir_ira_s210st01_config.h rename to driver/public/silabs/dosimeter_type5/config/brd4338a/sparkfun_type5_config.h index 4b48c5c6..2858e637 100644 --- a/driver/public/silabs/pir_ira_s210st01/config/pir_ira_s210st01_config.h +++ b/driver/public/silabs/dosimeter_type5/config/brd4338a/sparkfun_type5_config.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file pir_ira_s210st01_config.h + * @file sparkfun_type5_config.h * @brief Configuration file for Sparkfun dosimeter type5. ******************************************************************************* * # License @@ -33,35 +33,46 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ -#ifndef PIR_IRA_S210ST01_CONFIG_H_ -#define PIR_IRA_S210ST01_CONFIG_H_ - -#include "em_gpio.h" +#ifndef SPARKFUN_TYPE5_CONFIG_H_ +#define SPARKFUN_TYPE5_CONFIG_H_ #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif -// <<< sl:start pin_tool >>> +// <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN TYPE5 configuration + +// Process period [MS] +// Default: 160 +#define SPARKFUN_TYPE5_PROCESS_PERIOD 160 + +// History length +// Default: 200 +#define SPARKFUN_TYPE5_HISTORY_LENGTH 200 -// PIR_IRA_S210ST01_ADC_P -// $[GPIO_PIR_IRA_S210ST01_ADC_P] -#define PIR_IRA_S210ST01_ADC_P_PORT gpioPortD -#define PIR_IRA_S210ST01_ADC_P_PIN 8 -// [GPIO_PIR_IRA_S210ST01_ADC_P]$ +// History unit +// Default: 6 +#define SPARKFUN_TYPE5_HISTORY_UNIT 6 + +// end SPARKFUN TYPE5 configuration + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> -// PIR_IRA_S210ST01_ADC_N -// $[GPIO_PIR_IRA_S210ST01_ADC_N] -#define PIR_IRA_S210ST01_ADC_N_PORT gpioPortA -#define PIR_IRA_S210ST01_ADC_N_PIN 6 -// [GPIO_PIR_IRA_S210ST01_ADC_N]$ +// SPARKFUN_TYPE5_SIG +// $[GPIO_SPARKFUN_TYPE5_SIG] +#define SPARKFUN_TYPE5_SIG_PORT HP +#define SPARKFUN_TYPE5_SIG_PIN 46 +// [GPIO_SPARKFUN_TYPE5_SIG]$ -// PIR_IRA_S210ST01_LDO_SHDN_B -// $[GPIO_PIR_IRA_S210ST01_LDO_SHDN_B] -#define PIR_IRA_S210ST01_LDO_SHDN_B_PORT gpioPortC -#define PIR_IRA_S210ST01_LDO_SHDN_B_PIN 9 -// [GPIO_PIR_IRA_S210ST01_LDO_SHDN_B]$ +// SPARKFUN_TYPE5_NS +// $[GPIO_SPARKFUN_TYPE5_NS] +#define SPARKFUN_TYPE5_NS_PORT HP +#define SPARKFUN_TYPE5_NS_PIN 47 +// [GPIO_SPARKFUN_TYPE5_NS]$ // <<< sl:end pin_tool >>> @@ -69,4 +80,4 @@ extern "C" } #endif -#endif /* PIR_IRA_S210ST01_CONFIG_H_ */ +#endif // SPARKFUN_TYPE5_CONFIG_H_ diff --git a/driver/public/silabs/dosimeter_type5/config/other/sparkfun_type5_config.h b/driver/public/silabs/dosimeter_type5/config/other/sparkfun_type5_config.h index 18e61834..eae2ede4 100644 --- a/driver/public/silabs/dosimeter_type5/config/other/sparkfun_type5_config.h +++ b/driver/public/silabs/dosimeter_type5/config/other/sparkfun_type5_config.h @@ -36,11 +36,12 @@ #ifndef SPARKFUN_TYPE5_CONFIG_H_ #define SPARKFUN_TYPE5_CONFIG_H_ +#ifndef SLI_SI917 #include "em_gpio.h" +#endif #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> @@ -85,4 +86,4 @@ extern "C" } #endif -#endif /* SPARKFUN_TYPE5_CONFIG_H_ */ +#endif // SPARKFUN_TYPE5_CONFIG_H_ diff --git a/driver/public/silabs/dosimeter_type5/inc/sparkfun_type5.h b/driver/public/silabs/dosimeter_type5/inc/sparkfun_type5.h index a8e2cbab..00c0ccf6 100644 --- a/driver/public/silabs/dosimeter_type5/inc/sparkfun_type5.h +++ b/driver/public/silabs/dosimeter_type5/inc/sparkfun_type5.h @@ -38,6 +38,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /***************************************************************************//** * @brief * Sparkfun Type5 callback function; @@ -46,7 +50,7 @@ * This callback function is executed whenever noise or radiation is detected. * ******************************************************************************/ -typedef void(*sparkfun_type5_callback_t)(void); +typedef void (*sparkfun_type5_callback_t)(void); // ----------------------------------------------------------------------------- // Public Function @@ -162,4 +166,7 @@ double sparkfun_type5_get_usvh(void); ******************************************************************************/ double sparkfun_type5_get_usvh_error(void); -#endif /* SPARKFUN_TYPE5_H_ */ +#ifdef __cplusplus +} +#endif +#endif // SPARKFUN_TYPE5_H_ diff --git a/driver/public/silabs/dosimeter_type5/src/sparkfun_type5.c b/driver/public/silabs/dosimeter_type5/src/sparkfun_type5.c index ff2ce497..857ac6fe 100644 --- a/driver/public/silabs/dosimeter_type5/src/sparkfun_type5.c +++ b/driver/public/silabs/dosimeter_type5/src/sparkfun_type5.c @@ -39,20 +39,23 @@ #include #include #include "sl_sleeptimer.h" + #include "sparkfun_type5_config.h" -#include "gpiointerrupt.h" #include "sparkfun_type5.h" +#include "drv_digital_in.h" + +#if (defined(SLI_SI917)) +#include "sl_driver_gpio.h" +#define GPIO_M4_INTR 0 // M4 Pin interrupt number +#define AVL_INTR_NO 0 // available interrupt number +#else +#include "gpiointerrupt.h" +#endif // ----------------------------------------------------------------------------- // Macros // ----------------------------------------------------------------------------- -// Enable/Disable Interrupt -#define IntEnable() (GPIO_IntEnable(SPARKFUN_TYPE5_SIG_PIN \ - | SPARKFUN_TYPE5_NS_PIN)) -#define IntDisable() (GPIO_IntDisable(SPARKFUN_TYPE5_SIG_PIN \ - | SPARKFUN_TYPE5_NS_PIN)) - // Convert tick to millisecond #define TICK_TO_MS(x) (sl_sleeptimer_tick_to_ms(x)) @@ -112,6 +115,34 @@ static void sparkfun_type5_on_noise_handler(uint8_t ns_pin) noise_count++; } +// Enable/Disable Interrupt +static void IntEnable(void) +{ +#if (defined(SLI_SI917)) + sl_gpio_driver_clear_interrupts(PIN_INTR_0); + sl_gpio_driver_clear_interrupts(PIN_INTR_1); + sl_gpio_driver_enable_interrupts( + (PIN_INTR_0 << 16) | SL_GPIO_INTERRUPT_FALL_EDGE); + sl_gpio_driver_enable_interrupts( + (PIN_INTR_1 << 16) | SL_GPIO_INTERRUPT_FALL_EDGE); +#else + GPIO_IntClear((1 << SPARKFUN_TYPE5_SIG_PIN) | (1 << SPARKFUN_TYPE5_NS_PIN)); + GPIO_IntEnable((1 << SPARKFUN_TYPE5_SIG_PIN) | (1 << SPARKFUN_TYPE5_NS_PIN)); +#endif +} + +static void IntDisable(void) +{ +#if (defined(SLI_SI917)) + sl_gpio_driver_disable_interrupts( + (PIN_INTR_0 << 16) | SL_GPIO_INTERRUPT_FALL_EDGE); + sl_gpio_driver_disable_interrupts( + (PIN_INTR_1 << 16) | SL_GPIO_INTERRUPT_FALL_EDGE); +#else + GPIO_IntDisable((1 << SPARKFUN_TYPE5_SIG_PIN) | (1 << SPARKFUN_TYPE5_NS_PIN)); +#endif +} + // ----------------------------------------------------------------------------- // Public Function // ----------------------------------------------------------------------------- @@ -125,17 +156,34 @@ void sparkfun_type5_init(void) return; } - initialized = true; - GPIO_PinModeSet(SPARKFUN_TYPE5_SIG_PORT, - SPARKFUN_TYPE5_SIG_PIN, - gpioModeInputPull, - 1); - - GPIO_PinModeSet(SPARKFUN_TYPE5_NS_PORT, - SPARKFUN_TYPE5_NS_PIN, - gpioModeInputPull, - 1); - + digital_in_t sig; + digital_in_t ns; + + pin_name_t sig_pin = hal_gpio_pin_name(SPARKFUN_TYPE5_SIG_PORT, + SPARKFUN_TYPE5_SIG_PIN); + pin_name_t ns_pin = hal_gpio_pin_name(SPARKFUN_TYPE5_NS_PORT, + SPARKFUN_TYPE5_NS_PIN); + + digital_in_init(&sig, sig_pin); + digital_in_init(&ns, ns_pin); + +#if (defined(SLI_SI917)) + sl_gpio_t sig_port_pin = { SPARKFUN_TYPE5_SIG_PIN / 16, + SPARKFUN_TYPE5_SIG_PIN % 16 }; + sl_gpio_t ns_port_pin = { SPARKFUN_TYPE5_SIG_PIN / 16, + SPARKFUN_TYPE5_NS_PIN % 16 }; + + sl_gpio_driver_configure_interrupt(&sig_port_pin, + PIN_INTR_0, + SL_GPIO_INTERRUPT_FALLING_EDGE, + (void *)&sparkfun_type5_on_radiation_handler, + AVL_INTR_NO); + sl_gpio_driver_configure_interrupt(&ns_port_pin, + PIN_INTR_1, + SL_GPIO_INTERRUPT_FALLING_EDGE, + (void *)&sparkfun_type5_on_noise_handler, + AVL_INTR_NO); +#else // None Si91x device GPIO_ExtIntConfig(SPARKFUN_TYPE5_SIG_PORT, SPARKFUN_TYPE5_SIG_PIN, SPARKFUN_TYPE5_SIG_PIN, @@ -155,6 +203,9 @@ void sparkfun_type5_init(void) GPIOINT_CallbackRegister(SPARKFUN_TYPE5_NS_PIN, sparkfun_type5_on_noise_handler); +#endif + + initialized = true; } /**************************************************************************//** diff --git a/driver/public/silabs/environment3_bme688/config/mikroe_bme688_i2c_config.h b/driver/public/silabs/environment3_bme688/config/mikroe_bme688_i2c_config.h new file mode 100644 index 00000000..496ac836 --- /dev/null +++ b/driver/public/silabs/environment3_bme688/config/mikroe_bme688_i2c_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file mikroe_bme688_i2c_config.h + * @brief Configuration file for BME688 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_BME688_CONFIG_H +#define MIKROE_BME688_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BME688 I2C Configuration + +// MIKROE BME688 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BME688_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_BME688_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // MIKROE_BME688_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/environment3_bme688/config/mikroe_bme688_spi_config.h b/driver/public/silabs/environment3_bme688/config/mikroe_bme688_spi_config.h new file mode 100644 index 00000000..1529c279 --- /dev/null +++ b/driver/public/silabs/environment3_bme688/config/mikroe_bme688_spi_config.h @@ -0,0 +1,68 @@ +/***************************************************************************//** + * @file mikroe_bme688_spi_config.h + * @brief Configuration file for BME688 + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef MIKROE_BME688_CONFIG_H_ +#define MIKROE_BME688_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//MIKROE BME688 SPI Configuration + +// MIKROE BME688 SPI UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_BME688_SPI_UC 0 + +// Bit Rate (Bits/Second) <1-116000000> +// Default: 10000000 +#define MIKROE_BME688_SPI_BITRATE 10000000 + +// +// +// <<< end of configuration section >>> +#ifdef __cplusplus +} +#endif + +#endif // MIKROE_BME688_CONFIG_H_ \ No newline at end of file diff --git a/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_i2c.h b/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_i2c.h index 346bae2b..339277a6 100644 --- a/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_i2c.h +++ b/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_i2c.h @@ -34,12 +34,9 @@ ******************************************************************************/ #ifndef MIKROE_BME688_I2C_H #define MIKROE_BME688_I2C_H - -#include "sl_i2cspm.h" -#include "sl_udelay.h" - #include "bme68x.h" #include "bme68x_defs.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -49,10 +46,6 @@ typedef struct bme68x_conf bme68x_conf_t; typedef struct bme68x_data bme68x_data_t; typedef struct bme68x_heatr_conf bme68x_heatr_conf_t; typedef struct bme68x_dev bme68x_dev_t; -typedef struct { - sl_i2cspm_t *handle; - uint8_t addr; -} bme68x_i2c_t; /***************************************************************************//** * @addtogroup BME688 - GAS Sensor @@ -127,7 +120,8 @@ typedef struct { * @ref BME68X_OK on success. * @ref On failure, BME68X_E_NULL_PTR is returned. ******************************************************************************/ -int8_t mikroe_bme688_i2c_init(bme68x_dev_t *bme688); +int8_t mikroe_bme688_i2c_init(bme68x_dev_t *bme688, + mikroe_i2c_handle_t i2c_instance); /** @} (end addtogroup BME680) */ diff --git a/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_spi.h b/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_spi.h index 0b3b7bdc..3ccec88f 100644 --- a/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_spi.h +++ b/driver/public/silabs/environment3_bme688/inc/mikroe_bme688_spi.h @@ -34,12 +34,9 @@ ******************************************************************************/ #ifndef MIKROE_BME688_SPI_H #define MIKROE_BME688_SPI_H - -#include "spidrv.h" -#include "sl_udelay.h" - #include "bme68x_defs.h" #include "bme68x.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -49,9 +46,6 @@ typedef struct bme68x_conf bme68x_conf_t; typedef struct bme68x_data bme68x_data_t; typedef struct bme68x_heatr_conf bme68x_heatr_conf_t; typedef struct bme68x_dev bme68x_dev_t; -typedef struct { - SPIDRV_Handle_t handle; -} bme68x_spi_t; /***************************************************************************//** * @addtogroup BME688 - GAS Sensor @@ -125,7 +119,8 @@ typedef struct { * @ref BME68X_OK on success. * @ref On failure, BME68X_E_NULL_PTR is returned. ******************************************************************************/ -int8_t mikroe_bme688_spi_init(bme68x_dev_t *bme688); +int8_t mikroe_bme688_spi_init(bme68x_dev_t *bme688, + mikroe_spi_handle_t spi_handle); /** @} (end addtogroup BME688) */ diff --git a/driver/public/silabs/environment3_bme688/src/mikroe_bme688_i2c.c b/driver/public/silabs/environment3_bme688/src/mikroe_bme688_i2c.c index 14839a6b..9152e739 100644 --- a/driver/public/silabs/environment3_bme688/src/mikroe_bme688_i2c.c +++ b/driver/public/silabs/environment3_bme688/src/mikroe_bme688_i2c.c @@ -34,6 +34,8 @@ ******************************************************************************/ #include "mikroe_bme688_i2c.h" +#include "sl_sleeptimer.h" +#include "mikroe_bme688_i2c_config.h" // Local prototypes static int8_t mikroe_bme688_i2c_read(uint8_t reg_addr, @@ -47,15 +49,32 @@ static int8_t mikroe_bme688_i2c_write(uint8_t reg_addr, static void mikroe_bme688_i2c_delay_us(uint32_t period, void *intf_ptr); +static i2c_master_t bme68x; + /***************************************************************************//** * Initializes an I2C interface for BME688. * As entry point, call this API before using other APIs. ******************************************************************************/ -int8_t mikroe_bme688_i2c_init(bme68x_dev_t *bme688) +int8_t mikroe_bme688_i2c_init(bme68x_dev_t *bme688, + mikroe_i2c_handle_t i2c_instance) { - if (bme688 == NULL) { + if ((bme688 == NULL) || (NULL == i2c_instance)) { return BME68X_E_NULL_PTR; } + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + + bme68x.handle = i2c_instance; + i2c_cfg.addr = BME68X_I2C_ADDR_LOW; + i2c_cfg.timeout_pass_count = 0; + +#if (MIKROE_BME688_I2C_UC == 1) + i2c_cfg.speed = MIKROE_BME688_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&bme68x, &i2c_cfg) == I2C_MASTER_ERROR) { + return BME68X_E_COM_FAIL; + } bme688->read = mikroe_bme688_i2c_read; bme688->write = mikroe_bme688_i2c_write; @@ -93,25 +112,13 @@ static int8_t mikroe_bme688_i2c_read(uint8_t reg_addr, uint32_t len, void *intf_ptr) { - sl_i2cspm_t *i2c_handle = ((bme68x_i2c_t *)intf_ptr)->handle; - uint8_t device_addr = ((bme68x_i2c_t *)intf_ptr)->addr; - - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_write_data[1]; - - seq.addr = device_addr << 1; - seq.flags = I2C_FLAG_WRITE_READ; + (void)intf_ptr; - i2c_write_data[0] = reg_addr; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - - // Select length of data to be read - seq.buf[1].data = reg_data; - seq.buf[1].len = (uint16_t)len; - ret = I2CSPM_Transfer(i2c_handle, &seq); - if (ret != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&bme68x, + ®_addr, + 1, + reg_data, + len)) { return BME68X_E_COM_FAIL; } @@ -140,30 +147,18 @@ static int8_t mikroe_bme688_i2c_write(uint8_t reg_addr, uint32_t len, void *intf_ptr) { - sl_i2cspm_t *i2c_handle = ((bme68x_i2c_t *)intf_ptr)->handle; - uint8_t device_addr = ((bme68x_i2c_t *)intf_ptr)->addr; - - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_write_data[len + 1]; - uint8_t i2c_read_data[1]; + (void)intf_ptr; + uint8_t write_buff[len + 1]; - seq.addr = device_addr << 1; - seq.flags = I2C_FLAG_WRITE; - - // Select register and data to write - i2c_write_data[0] = reg_addr; - for (uint16_t i = 0; i < (uint16_t)len; i++) { - i2c_write_data[i + 1] = reg_data[i]; + write_buff[0] = reg_addr; + for (uint32_t i = 0; i < len; i++) + { + *(write_buff + i + 1) = *(reg_data + i); } - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = (uint16_t)len + 1; - - // Select length of data to be read - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - ret = I2CSPM_Transfer(i2c_handle, &seq); - if (ret != i2cTransferDone) { + + if (I2C_MASTER_SUCCESS != i2c_master_write(&bme68x, + write_buff, + 1 + len)) { return BME68X_E_COM_FAIL; } @@ -183,5 +178,11 @@ static int8_t mikroe_bme688_i2c_write(uint8_t reg_addr, static void mikroe_bme688_i2c_delay_us(uint32_t period, void *intf_ptr) { (void) intf_ptr; - sl_udelay_wait(period); + uint32_t delay_ms = 1; + + if (period > 1000) { + delay_ms = (period / 1000) + 1; + } + + sl_sleeptimer_delay_millisecond(delay_ms); } diff --git a/driver/public/silabs/environment3_bme688/src/mikroe_bme688_spi.c b/driver/public/silabs/environment3_bme688/src/mikroe_bme688_spi.c index cce82c9b..11af9010 100644 --- a/driver/public/silabs/environment3_bme688/src/mikroe_bme688_spi.c +++ b/driver/public/silabs/environment3_bme688/src/mikroe_bme688_spi.c @@ -33,6 +33,8 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ #include "mikroe_bme688_spi.h" +#include "sl_sleeptimer.h" +#include "mikroe_bme688_spi_config.h" // Local prototypes static int8_t mikroe_bme688_spi_read(uint8_t reg_addr, @@ -46,16 +48,34 @@ static int8_t mikroe_bme688_spi_write(uint8_t reg_addr, static void mikroe_bme688_spi_delay_us(uint32_t period, void *intf_ptr); +spi_master_t bme68x; + /***************************************************************************//** * Initializes an SPI interface for BME688. * As entry point, call this API before using other APIs. ******************************************************************************/ -int8_t mikroe_bme688_spi_init(bme68x_dev_t *bme688) +int8_t mikroe_bme688_spi_init(bme68x_dev_t *bme688, + mikroe_spi_handle_t spi_handle) { - if (bme688 == NULL) { + if ((bme688 == NULL) || (NULL == spi_handle)) { return BME68X_E_NULL_PTR; } + spi_master_config_t spi_cfg; + spi_master_configure_default(&spi_cfg); + spi_cfg.mode = SPI_MASTER_MODE_0; + spi_cfg.speed = 1000000; + +#if (MIKROE_BME688_SPI_UC == 1) + spi_cfg.speed = MIKROE_BME688_SPI_BITRATE; +#endif + + bme68x.handle = spi_handle; + + if (spi_master_open(&bme68x, &spi_cfg) == SPI_MASTER_ERROR) { + return BME68X_E_COM_FAIL; + } + bme688->read = mikroe_bme688_spi_read; bme688->write = mikroe_bme688_spi_write; bme688->intf = BME68X_SPI_INTF; @@ -92,26 +112,16 @@ static int8_t mikroe_bme688_spi_read(uint8_t reg_addr, uint32_t len, void *intf_ptr) { - SPIDRV_Handle_t spi_handle = ((bme68x_spi_t *)intf_ptr)->handle; - Ecode_t ret_code; - uint8_t txBuffer[len + 1]; - uint8_t rxBuffer[len + 1]; - - txBuffer[0] = reg_addr; - - // Fullfill the remaining elements of the txBuffer with dummy - for (uint16_t i = 0; i < (uint16_t)len; i++) { - txBuffer[i + 1] = 0xff; - } - - ret_code = SPIDRV_MTransferB(spi_handle, txBuffer, rxBuffer, len + 1); - if (ret_code != ECODE_EMDRV_SPIDRV_OK) { + (void)intf_ptr; + err_t ret_code = spi_master_write_then_read(&bme68x, + ®_addr, + 1, + reg_data, + len); + + if (ret_code != SPI_MASTER_SUCCESS) { return BME68X_E_COM_FAIL; } - // Copy the receive payload (without the dummy byte) to the output buffer data - for (uint16_t i = 0; i < len; i++) { - reg_data[i] = rxBuffer[i + 1]; - } return BME68X_OK; } @@ -138,22 +148,18 @@ static int8_t mikroe_bme688_spi_write(uint8_t reg_addr, uint32_t len, void *intf_ptr) { - SPIDRV_Handle_t spi_handle = ((bme68x_spi_t *)intf_ptr)->handle; - Ecode_t ret_code; + (void) intf_ptr; uint8_t txBuffer[len + 1]; txBuffer[0] = reg_addr; - - // Fullfill the remaining elements of the txBuffer with dummy - for (uint16_t i = 0; i < (uint16_t)len; i++) { + for (uint32_t i = 0; i < len; i++) { txBuffer[i + 1] = reg_data[i]; } - ret_code = SPIDRV_MTransmitB(spi_handle, txBuffer, len + 1); - if (ret_code != ECODE_EMDRV_SPIDRV_OK) { + sl_status_t ret_code = spi_master_write(&bme68x, txBuffer, len + 1); + if (ret_code != SPI_MASTER_SUCCESS) { return BME68X_E_COM_FAIL; } - return BME68X_OK; } @@ -170,5 +176,11 @@ static int8_t mikroe_bme688_spi_write(uint8_t reg_addr, static void mikroe_bme688_spi_delay_us(uint32_t period, void *intf_ptr) { (void) intf_ptr; - sl_udelay_wait(period); + uint32_t delay_ms = 1; + + if (period > 1000) { + delay_ms = (period / 1000) + 1; + } + + sl_sleeptimer_delay_millisecond(delay_ms); } diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/brd2601b/sparkfun_ccs811_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/brd2601b/sparkfun_ccs811_config.h index eb2594be..bacc24ef 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/config/brd2601b/sparkfun_ccs811_config.h +++ b/driver/public/silabs/environmental_bme280_ccs811/config/brd2601b/sparkfun_ccs811_config.h @@ -1,24 +1,69 @@ /***************************************************************************//** - * @file + * @file sparkfun_ccs811_config.c * @brief CCS811 Driver Configuration ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef SPARKFUN_CCS811_CONFIG_H #define SPARKFUN_CCS811_CONFIG_H +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN CCS811 I2C Configuration + +// SPARKFUN CCS811 Adress +// <0x5B=> 0x5B +// <0x5A=> 0x5A +// Default: 0x5B +#define SPARKFUN_CCS811_ADDR 0x5B + +// SPARKFUN CCS811 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_CCS811_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_CCS811_I2C_SPEED_MODE 0 + +// +// + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +76,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_CCS811_CONFIG_H*/ +#endif // SPARKFUN_CCS811_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/brd2703a/sparkfun_ccs811_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/brd2703a/sparkfun_ccs811_config.h index eb2594be..bacc24ef 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/config/brd2703a/sparkfun_ccs811_config.h +++ b/driver/public/silabs/environmental_bme280_ccs811/config/brd2703a/sparkfun_ccs811_config.h @@ -1,24 +1,69 @@ /***************************************************************************//** - * @file + * @file sparkfun_ccs811_config.c * @brief CCS811 Driver Configuration ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef SPARKFUN_CCS811_CONFIG_H #define SPARKFUN_CCS811_CONFIG_H +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN CCS811 I2C Configuration + +// SPARKFUN CCS811 Adress +// <0x5B=> 0x5B +// <0x5A=> 0x5A +// Default: 0x5B +#define SPARKFUN_CCS811_ADDR 0x5B + +// SPARKFUN CCS811 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_CCS811_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_CCS811_I2C_SPEED_MODE 0 + +// +// + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +76,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_CCS811_CONFIG_H*/ +#endif // SPARKFUN_CCS811_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/brd2704a/sparkfun_ccs811_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/brd2704a/sparkfun_ccs811_config.h index eb2594be..bacc24ef 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/config/brd2704a/sparkfun_ccs811_config.h +++ b/driver/public/silabs/environmental_bme280_ccs811/config/brd2704a/sparkfun_ccs811_config.h @@ -1,24 +1,69 @@ /***************************************************************************//** - * @file + * @file sparkfun_ccs811_config.c * @brief CCS811 Driver Configuration ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef SPARKFUN_CCS811_CONFIG_H #define SPARKFUN_CCS811_CONFIG_H +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN CCS811 I2C Configuration + +// SPARKFUN CCS811 Adress +// <0x5B=> 0x5B +// <0x5A=> 0x5A +// Default: 0x5B +#define SPARKFUN_CCS811_ADDR 0x5B + +// SPARKFUN CCS811 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_CCS811_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_CCS811_I2C_SPEED_MODE 0 + +// +// + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +76,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_CCS811_CONFIG_H*/ +#endif // SPARKFUN_CCS811_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/brd4108a/sparkfun_ccs811_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/brd4108a/sparkfun_ccs811_config.h index eb2594be..bacc24ef 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/config/brd4108a/sparkfun_ccs811_config.h +++ b/driver/public/silabs/environmental_bme280_ccs811/config/brd4108a/sparkfun_ccs811_config.h @@ -1,24 +1,69 @@ /***************************************************************************//** - * @file + * @file sparkfun_ccs811_config.c * @brief CCS811 Driver Configuration ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef SPARKFUN_CCS811_CONFIG_H #define SPARKFUN_CCS811_CONFIG_H +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN CCS811 I2C Configuration + +// SPARKFUN CCS811 Adress +// <0x5B=> 0x5B +// <0x5A=> 0x5A +// Default: 0x5B +#define SPARKFUN_CCS811_ADDR 0x5B + +// SPARKFUN CCS811 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_CCS811_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_CCS811_I2C_SPEED_MODE 0 + +// +// + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +76,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_CCS811_CONFIG_H*/ +#endif // SPARKFUN_CCS811_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/brd4314a/sparkfun_ccs811_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/brd4314a/sparkfun_ccs811_config.h index eb2594be..bacc24ef 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/config/brd4314a/sparkfun_ccs811_config.h +++ b/driver/public/silabs/environmental_bme280_ccs811/config/brd4314a/sparkfun_ccs811_config.h @@ -1,24 +1,69 @@ /***************************************************************************//** - * @file + * @file sparkfun_ccs811_config.c * @brief CCS811 Driver Configuration ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef SPARKFUN_CCS811_CONFIG_H #define SPARKFUN_CCS811_CONFIG_H +#include "em_gpio.h" + // <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN CCS811 I2C Configuration + +// SPARKFUN CCS811 Adress +// <0x5B=> 0x5B +// <0x5A=> 0x5A +// Default: 0x5B +#define SPARKFUN_CCS811_ADDR 0x5B + +// SPARKFUN CCS811 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_CCS811_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_CCS811_I2C_SPEED_MODE 0 + +// +// + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +76,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_CCS811_CONFIG_H*/ +#endif // SPARKFUN_CCS811_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/brd4338a/sparkfun_ccs811_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/brd4338a/sparkfun_ccs811_config.h new file mode 100644 index 00000000..139a1640 --- /dev/null +++ b/driver/public/silabs/environmental_bme280_ccs811/config/brd4338a/sparkfun_ccs811_config.h @@ -0,0 +1,77 @@ +/***************************************************************************//** + * @file sparkfun_ccs811_config.c + * @brief CCS811 Driver Configuration + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ + +#ifndef SPARKFUN_CCS811_CONFIG_H +#define SPARKFUN_CCS811_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN CCS811 I2C Configuration + +// SPARKFUN CCS811 Adress +// <0x5B=> 0x5B +// <0x5A=> 0x5A +// Default: 0x5B +#define SPARKFUN_CCS811_ADDR 0x5B + +// SPARKFUN CCS811 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_CCS811_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_CCS811_I2C_SPEED_MODE 0 + +// +// + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// SPARKFUN_CCS811_WAKE +// $[GPIO_SPARKFUN_CCS811_WAKE] +#define SPARKFUN_CCS811_WAKE_PORT HP +#define SPARKFUN_CCS811_WAKE_PIN 46 +// [GPIO_SPARKFUN_CCS811_WAKE]$ + +// <<< sl:end pin_tool >>> + +#endif // SPARKFUN_CCS811_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/other/sparkfun_ccs811_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/other/sparkfun_ccs811_config.h index b3898d0d..69470e94 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/config/other/sparkfun_ccs811_config.h +++ b/driver/public/silabs/environmental_bme280_ccs811/config/other/sparkfun_ccs811_config.h @@ -1,24 +1,71 @@ /***************************************************************************//** - * @file + * @file sparkfun_ccs811_config.c * @brief CCS811 Driver Configuration ******************************************************************************* * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef SPARKFUN_CCS811_CONFIG_H #define SPARKFUN_CCS811_CONFIG_H +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + // <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN CCS811 I2C Configuration + +// SPARKFUN CCS811 Adress +// <0x5B=> 0x5B +// <0x5A=> 0x5A +// Default: 0x5B +#define SPARKFUN_CCS811_ADDR 0x5B + +// SPARKFUN CCS811 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_CCS811_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_CCS811_I2C_SPEED_MODE 0 + +// +// + // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -32,4 +79,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_CCS811_CONFIG_H*/ +#endif // SPARKFUN_CCS811_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/config/sparkfun_bme280_config.h b/driver/public/silabs/environmental_bme280_ccs811/config/sparkfun_bme280_config.h new file mode 100644 index 00000000..6e45f97b --- /dev/null +++ b/driver/public/silabs/environmental_bme280_ccs811/config/sparkfun_bme280_config.h @@ -0,0 +1,67 @@ +/***************************************************************************//** + * @file sparkfun_bme280_config.c + * @brief BME280 Driver Configuration + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ + +#ifndef SPARKFUN_BME280_CONFIG_H +#define SPARKFUN_BME280_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN BME280 I2C Configuration + +// SPARKFUN BME280 Adress +// <0x76=> 0x76 +// <0x77=> 0x77 +// Default: 0x77 +#define SPARKFUN_BME280_ADDR 0x77 + +// SPARKFUN BME280 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_BME280_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_BME280_I2C_SPEED_MODE 0 + +// +// + +// <<< end of configuration section >>> + +#endif // SPARKFUN_BME280_CONFIG_H diff --git a/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_bme280.h b/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_bme280.h index 236959dc..9ab23271 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_bme280.h +++ b/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_bme280.h @@ -41,27 +41,14 @@ // ----------------------------------------------------------------------------- #include "sl_status.h" -#include "sl_i2cspm.h" +#include "sl_sleeptimer.h" +#include "drv_i2c_master.h" +#include "sparkfun_bme280_config.h" // ----------------------------------------------------------------------------- // Macros and Typedefs // ----------------------------------------------------------------------------- -#define BME_280_DEFAULT_I2C_ADDR 0x77 - -// Structure to configure the BME280 sensor. -typedef struct { - sl_i2cspm_t *i2c_sensor; - uint8_t i2c_address; // I2C address of the sensor -} sparkfun_bme280_i2c_t; - -// Default initialization structure for BME280 I2C driver. -#define BME280_I2C_DEFAULT \ - { \ - sl_i2cspm_qwiic, \ - BME_280_DEFAULT_I2C_ADDR, \ - } - #ifdef __cplusplus extern "C" { #endif @@ -145,10 +132,10 @@ sl_status_t sparkfun_bme280_ctrl_measure_set_to_sleep(void); * @return * Return value is STATUS_FAILED or STATUS_OK. ******************************************************************************/ -sl_status_t sparkfun_bme280_i2c(sparkfun_bme280_i2c_t *init); +sl_status_t sparkfun_bme280_i2c(mikroe_i2c_handle_t i2cspm, uint8_t addr); #ifdef __cplusplus } #endif -#endif /* SPARKFUN_BME280_H_ */ +#endif // SPARKFUN_BME280_H_ diff --git a/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_ccs811.h b/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_ccs811.h index 5692626c..3dc3584d 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_ccs811.h +++ b/driver/public/silabs/environmental_bme280_ccs811/inc/sparkfun_ccs811.h @@ -1,17 +1,16 @@ /***************************************************************************//** - * @file - * @brief Driver for the Cambridge CMOS Sensors CCS811 gas and indoor air - * quality sensor + * @file sparkfun_ccs811.h + * @brief header file for CCS811 sensor driver ******************************************************************************* * # License - * Copyright 2018 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib * * The licensor of this software is Silicon Laboratories Inc. * - * This software is provided 'as-is', without any express or implied + * This software is provided \'as-is\', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * @@ -27,21 +26,26 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #ifndef SPARKFUN_CCS811_H #define SPARKFUN_CCS811_H #include -#include "sl_i2cspm.h" #include "sl_status.h" +#include "sl_sleeptimer.h" +#include "drv_i2c_master.h" +#include "sparkfun_ccs811_config.h" #ifdef __cplusplus extern "C" { #endif -#define SPARKFUN_CCS811_DEFAULT_ADDR 0x5B - /**************************************************************************//** * @addtogroup ccs811 CCS811 - Gas Sensor * @brief Driver for the Cambridge CMOS Sensors CCS811 gas and indoor air @@ -192,15 +196,12 @@ extern "C" { * @retval SL_STATUS_OK Success * @retval SL_STATUS_INITIALIZATION Initialization was unsuccessful ******************************************************************************/ -sl_status_t sparkfun_ccs811_init(sl_i2cspm_t *i2cspm); +sl_status_t sparkfun_ccs811_init(mikroe_i2c_handle_t i2cspm); /***************************************************************************//** * @brief * Reads Hardware ID from the CCS811 sensor * - * @param[in] i2cspm - * The I2CSPM instance to use. - * * @param[out] hwID * The Hardware ID of the chip (should be 0x81) * @@ -208,17 +209,14 @@ sl_status_t sparkfun_ccs811_init(sl_i2cspm_t *i2cspm); * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_get_hardware_id(sl_i2cspm_t *i2cspm, uint8_t *hwID); +sl_status_t sparkfun_ccs811_get_hardware_id(uint8_t *hwID); /***************************************************************************//** * @brief * Set the measurement mode of the CCS811 sensor. * * @details - * This function must be called before reading measurements from the sensor. - * - * @param[in] i2cspm - * The I2CSPM instance to use. + * This function must be called before reading measurements from the sensor. * * @param[in] measMode * The desired measurement mode @@ -227,8 +225,7 @@ sl_status_t sparkfun_ccs811_get_hardware_id(sl_i2cspm_t *i2cspm, uint8_t *hwID); * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_set_measure_mode(sl_i2cspm_t *i2cspm, - uint8_t measMode); +sl_status_t sparkfun_ccs811_set_measure_mode(uint8_t measMode); /***************************************************************************//** * @brief @@ -236,11 +233,7 @@ sl_status_t sparkfun_ccs811_set_measure_mode(sl_i2cspm_t *i2cspm, * * @details * This function overwrites the existing firmware, irrespective of the - * version - * number. - * - * @param[in] i2cspm - * The I2CSPM instance to use. + * version number. * * @param[in] firmware * A buffer containing the contents of the firmware update @@ -252,17 +245,13 @@ sl_status_t sparkfun_ccs811_set_measure_mode(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Firmware upgrade successful * @retval SL_STATUS_FAIL Firmware upgrade failed ******************************************************************************/ -sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, - const uint8_t *firmware, +sl_status_t sparkfun_ccs811_update_firmware(const uint8_t *firmware, uint32_t length); /***************************************************************************//** * @brief * Read out current firmware of the CCS811 sensor. * - * @param[in] i2cspm - * The i2cspm instance to use - * * @param[out] fw_version * The current application firmware. The top 4 bits contain the major * firmware @@ -272,16 +261,12 @@ sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_read_firmware_version(sl_i2cspm_t *i2cspm, - uint16_t *fw_version); +sl_status_t sparkfun_ccs811_read_firmware_version(uint16_t *fw_version); /**************************************************************************//** * @brief * Read the status of the CCS811 sensor. * -* @param[in] i2cspm -* The I2CSPM instance to use. -* * @param[out] status * The content of the CCS811 Status Register * @@ -289,15 +274,12 @@ sl_status_t sparkfun_ccs811_read_firmware_version(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_get_status(sl_i2cspm_t *i2cspm, uint8_t *status); +sl_status_t sparkfun_ccs811_get_status(uint8_t *status); /***************************************************************************//** * @brief * Read data from a specific Mailbox address. * - * @param[in] i2cspm - * The I2CSPM instance to use. - * * @param[in] id * The address of the Mailbox register * @@ -311,8 +293,7 @@ sl_status_t sparkfun_ccs811_get_status(sl_i2cspm_t *i2cspm, uint8_t *status); * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_read_mailbox(sl_i2cspm_t *i2cspm, - uint8_t id, +sl_status_t sparkfun_ccs811_read_mailbox(uint8_t id, uint8_t length, uint8_t *data); @@ -320,9 +301,6 @@ sl_status_t sparkfun_ccs811_read_mailbox(sl_i2cspm_t *i2cspm, * @brief * Switch the CCS811 chip from boot to application mode. * - * @param[in] i2cspm - * The I2CSPM instance to use - * * @return * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission failure @@ -331,40 +309,31 @@ sl_status_t sparkfun_ccs811_read_mailbox(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_INVALID_STATE Chip firmware did not switch to * application mode ******************************************************************************/ -sl_status_t sparkfun_ccs811_start_application(sl_i2cspm_t *i2cspm); +sl_status_t sparkfun_ccs811_start_application(void); /***************************************************************************//** * @brief * Perform software reset on the CCS811. * - * @param[in] i2cspm - * The I2CSPM instance to use - * * @return * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_software_reset(sl_i2cspm_t *i2cspm); +sl_status_t sparkfun_ccs811_software_reset(void); /***************************************************************************//** * @brief * Check whether new measurement data is available. * - * @param[in] i2cspm - * The I2CSPM instance to use - * * @return * True if new data available, otherwise false ******************************************************************************/ -bool sparkfun_ccs811_is_data_available(sl_i2cspm_t *i2cspm); +bool sparkfun_ccs811_is_data_available(void); /***************************************************************************//** * @brief * Read measurement data (eCO2 and TVOC) from the CCS811 sensor. * - * @param[in] i2cspm - * The I2CSPM instance to use - * * @param[out] eco2 * The equivalent CO2 level (in ppm) read from the sensor * @@ -375,17 +344,13 @@ bool sparkfun_ccs811_is_data_available(sl_i2cspm_t *i2cspm); * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_get_measurement(sl_i2cspm_t *i2cspm, - uint16_t *eco2, +sl_status_t sparkfun_ccs811_get_measurement(uint16_t *eco2, uint16_t *tvoc); /***************************************************************************//** * @brief * Get the latest readings from the sense resistor of the CCS811 sensor. * - * @param[in] i2cspm - * The I2CSPM instance to use - * * @param[out] current * The value of current through the sensor * @@ -397,17 +362,13 @@ sl_status_t sparkfun_ccs811_get_measurement(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error *****************************************************************************/ -sl_status_t sparkfun_ccs811_get_raw_data(sl_i2cspm_t *i2cspm, - uint16_t *current, +sl_status_t sparkfun_ccs811_get_raw_data(uint16_t *current, uint16_t *rawData); /***************************************************************************//** * @brief * Write temperature and humidity values to the environmental data regs. * - * @param[in] i2cspm - * The I2CSPM instance to use. - * * @param[in] tempData * The environmental temperature in milliCelsius * @@ -418,8 +379,7 @@ sl_status_t sparkfun_ccs811_get_raw_data(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -sl_status_t sparkfun_ccs811_set_env_data(sl_i2cspm_t *i2cspm, - int32_t tempData, +sl_status_t sparkfun_ccs811_set_env_data(int32_t tempData, uint32_t rhData); /** @} (end addtogroup ccs811) */ diff --git a/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_bme280.c b/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_bme280.c index fa1ac64b..5ec303c0 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_bme280.c +++ b/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_bme280.c @@ -38,12 +38,8 @@ // ----------------------------------------------------------------------------- #include "sl_status.h" -#include "sl_sleeptimer.h" #include "sparkfun_bme280.h" -// Create an I2C Instance for BME280 -static sparkfun_bme280_i2c_t sparkfun_bme280; - // register addresses #define BME280_REGISTER_CONTROLHUMID 0xF2 #define BME280_REGISTER_CONTROL 0xF4 @@ -81,6 +77,12 @@ static sparkfun_bme280_i2c_t sparkfun_bme280; #define BME280_REGISTER_CAL26 0xE1 +// Structure to configure the BME280 sensor. +typedef struct { + i2c_master_t i2c; + uint8_t slave_address; // I2C address of the sensor +} atmospheric_t; + // variables for calibration uint16_t calib_t1 = 0; int16_t calib_t2 = 0; @@ -105,6 +107,8 @@ int16_t calib_p9 = 0; int32_t t_fine = 0; +// Create an I2C Instance for BME280 +static atmospheric_t atmospheric; // ----------------------------------------------------------------------------- // Local Function Definitions // ----------------------------------------------------------------------------- @@ -125,10 +129,26 @@ static sl_status_t read_factory_compensation(void); // Public Functions // ----------------------------------------------------------------------------- -sl_status_t sparkfun_bme280_i2c(sparkfun_bme280_i2c_t *init) +sl_status_t sparkfun_bme280_i2c(mikroe_i2c_handle_t i2cspm, uint8_t addr) { - sparkfun_bme280.i2c_sensor = init->i2c_sensor; - sparkfun_bme280.i2c_address = init->i2c_address; + i2c_master_config_t atmospheric_config; + atmospheric.i2c.handle = i2cspm; + atmospheric.slave_address = addr; + + i2c_master_configure_default(&atmospheric_config); + + if (i2c_master_open(&atmospheric.i2c, + &atmospheric_config) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + +#if (SPARKFUN_BME280_I2C_UC == 1) + atmospheric_config.speed = SPARKFUN_BME280_I2C_SPEED_MODE; +#endif + + i2c_master_set_slave_address(&atmospheric.i2c, atmospheric.slave_address); + i2c_master_set_speed(&atmospheric.i2c, atmospheric_config.speed); + i2c_master_set_timeout(&atmospheric.i2c, 0); return SL_STATUS_OK; } @@ -362,30 +382,14 @@ static sl_status_t read_factory_compensation(void) ******************************************************************************/ static sl_status_t read_one_byte(uint8_t registeraddress, uint8_t *returnbyte) { - sl_status_t ret_val = SL_STATUS_FAIL; - uint8_t data = 0; - // Transfer structure. - I2C_TransferSeq_TypeDef i2c_transfer; - - // Initializing I2C transfer. - i2c_transfer.addr = BME_280_DEFAULT_I2C_ADDR << 1; - /// Master write - i2c_transfer.flags = I2C_FLAG_WRITE_READ; - - // Transmit buffer, no data to send. - i2c_transfer.buf[0].data = ®isteraddress; - i2c_transfer.buf[0].len = 1; - - // Receive buffer, two bytes to receive. - i2c_transfer.buf[1].data = &data; - i2c_transfer.buf[1].len = 1; - - if (I2CSPM_Transfer(sparkfun_bme280.i2c_sensor, - &i2c_transfer) == i2cTransferDone) { - ret_val = SL_STATUS_OK; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&atmospheric.i2c, + ®isteraddress, + 1, + returnbyte, + 1)) { + return SL_STATUS_TRANSMIT; } - *returnbyte = data; - return ret_val; + return SL_STATUS_OK; } /***************************************************************************//** @@ -402,28 +406,14 @@ static sl_status_t read_one_byte(uint8_t registeraddress, uint8_t *returnbyte) ******************************************************************************/ static sl_status_t write_one_byte(uint8_t registeraddress, uint8_t writevalue) { - sl_status_t ret_val = SL_STATUS_FAIL; uint8_t data[2] = { registeraddress, writevalue }; - // Transfer structure. - I2C_TransferSeq_TypeDef i2c_transfer; - - // Initializing I2C transfer. - i2c_transfer.addr = BME_280_DEFAULT_I2C_ADDR << 1; - // Master write - i2c_transfer.flags = I2C_FLAG_WRITE; - - // Transmit buffer, 2 bytes to send. - i2c_transfer.buf[0].data = data; - i2c_transfer.buf[0].len = 2; - - i2c_transfer.buf[1].data = 0UL; - i2c_transfer.buf[1].len = 0; - if (I2CSPM_Transfer(sparkfun_bme280.i2c_sensor, - &i2c_transfer) == i2cTransferDone) { - ret_val = SL_STATUS_OK; + if (I2C_MASTER_SUCCESS != i2c_master_write(&atmospheric.i2c, + data, + 2)) { + return SL_STATUS_TRANSMIT; } - return ret_val; + return SL_STATUS_OK; } /***************************************************************************//** @@ -442,30 +432,15 @@ static sl_status_t write_one_byte(uint8_t registeraddress, uint8_t writevalue) static sl_status_t read_two_bytes(uint8_t registeraddress, uint16_t *returnbyte) { - sl_status_t ret_val = SL_STATUS_FAIL; - uint16_t data = 0; - - // Transfer structure. - I2C_TransferSeq_TypeDef i2c_transfer; - - // Initializing I2C transfer. - i2c_transfer.addr = BME_280_DEFAULT_I2C_ADDR << 1; - // Master write. - i2c_transfer.flags = I2C_FLAG_WRITE_READ; - // Transmit buffer, no data to send. - i2c_transfer.buf[0].data = ®isteraddress; - i2c_transfer.buf[0].len = 1; - - // Receive buffer, two bytes to receive. - i2c_transfer.buf[1].data = (uint8_t *)&data; - i2c_transfer.buf[1].len = 2; - - if (I2CSPM_Transfer(sparkfun_bme280.i2c_sensor, - &i2c_transfer) == i2cTransferDone) { - ret_val = SL_STATUS_OK; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&atmospheric.i2c, + ®isteraddress, + 1, + (uint8_t *)returnbyte, + 2)) { + return SL_STATUS_TRANSMIT; } - *returnbyte = data; - return ret_val; + + return SL_STATUS_OK; } /***************************************************************************//** diff --git a/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_ccs811.c b/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_ccs811.c index d6af3424..4a91fd51 100644 --- a/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_ccs811.c +++ b/driver/public/silabs/environmental_bme280_ccs811/src/sparkfun_ccs811.c @@ -4,7 +4,7 @@ * quality sensor ******************************************************************************* * # License - * Copyright 2018 Silicon Laboratories Inc. www.silabs.com + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -27,28 +27,37 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. ******************************************************************************/ #include #include #include #include - -#include "sl_i2cspm.h" +#include "drv_digital_out.h" #include "sparkfun_ccs811_config.h" #include "sparkfun_ccs811.h" -#include "sl_sleeptimer.h" #define SPARKFUN_CCS811_HW_ID (0x81) +typedef struct { + i2c_master_t i2c; + uint8_t slave_address; + digital_out_t wak_pin; +} air_quality_t; + +static air_quality_t air_quality; + /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */ // Local prototypes -static uint32_t sparkfun_ccs811_erase_application(sl_i2cspm_t *i2cspm); -static uint32_t sparkfun_ccs811_verify_application(sl_i2cspm_t *i2cspm, - bool *appValid); -static uint32_t sparkfun_ccs811_program_firmware(sl_i2cspm_t *i2cspm, - uint8_t buffer[]); -static uint32_t sparkfun_ccs811_set_app_start(sl_i2cspm_t *i2cspm); +static uint32_t sparkfun_ccs811_erase_application(void); +static uint32_t sparkfun_ccs811_verify_application(bool *appValid); +static uint32_t sparkfun_ccs811_program_firmware(uint8_t buffer[]); +static uint32_t sparkfun_ccs811_set_app_start(void); /** @endcond */ @@ -72,10 +81,10 @@ static uint32_t sparkfun_ccs811_set_app_start(sl_i2cspm_t *i2cspm); static uint32_t sparkfun_ccs811_wake(bool wake) { if (wake) { - GPIO_PinOutClear(SPARKFUN_CCS811_WAKE_PORT, SPARKFUN_CCS811_WAKE_PIN); + digital_out_low(&air_quality.wak_pin); sl_sleeptimer_delay_millisecond(1); } else { - GPIO_PinOutSet(SPARKFUN_CCS811_WAKE_PORT, SPARKFUN_CCS811_WAKE_PIN); + digital_out_high(&air_quality.wak_pin); sl_sleeptimer_delay_millisecond(1); } return SL_STATUS_OK; @@ -84,41 +93,62 @@ static uint32_t sparkfun_ccs811_wake(bool wake) /***************************************************************************//** * Initializes the chip ******************************************************************************/ -sl_status_t sparkfun_ccs811_init(sl_i2cspm_t *i2cspm) +sl_status_t sparkfun_ccs811_init(mikroe_i2c_handle_t i2cspm) { uint8_t id; sl_status_t status; + i2c_master_config_t air_quality_config; + + // Configure default i2csmp instance + air_quality.i2c.handle = i2cspm; - GPIO_PinModeSet(SPARKFUN_CCS811_WAKE_PORT, - SPARKFUN_CCS811_WAKE_PIN, - gpioModePushPull, - 1); + i2c_master_configure_default(&air_quality_config); - /* Set the wake pin low */ + air_quality_config.addr = SPARKFUN_CCS811_ADDR; + air_quality.slave_address = air_quality_config.addr; + +#if (SPARKFUN_CCS811_I2C_UC == 1) + air_quality_config.speed = SPARKFUN_CCS811_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&air_quality.i2c, + &air_quality_config) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_slave_address(&air_quality.i2c, air_quality.slave_address); + i2c_master_set_speed(&air_quality.i2c, air_quality_config.speed); + i2c_master_set_timeout(&air_quality.i2c, 0); + + digital_out_init(&air_quality.wak_pin, + hal_gpio_pin_name(SPARKFUN_CCS811_WAKE_PORT, + SPARKFUN_CCS811_WAKE_PIN)); + + // Set the wake pin low sparkfun_ccs811_wake(true); - /* About 80 ms required to reliably start the device, wait a bit more */ + // About 80 ms required to reliably start the device, wait a bit more sl_sleeptimer_delay_millisecond(100); - /* Check if the chip present and working by reading the hardware ID */ - status = sparkfun_ccs811_get_hardware_id(i2cspm, &id); + // Check if the chip present and working by reading the hardware ID + status = sparkfun_ccs811_get_hardware_id(&id); if ((status != SL_STATUS_OK) || (id != SPARKFUN_CCS811_HW_ID)) { return SL_STATUS_INITIALIZATION; } - /* Switch from boot mode to application mode */ - status = sparkfun_ccs811_start_application(i2cspm); + // Switch from boot mode to application mode + status = sparkfun_ccs811_start_application(); if (status != SL_STATUS_OK) { return status; } - status = sparkfun_ccs811_set_measure_mode(i2cspm, - SPARKFUN_CCS811_MEASURE_MODE_DRIVE_MODE_1SEC); + status = sparkfun_ccs811_set_measure_mode( + SPARKFUN_CCS811_MEASURE_MODE_DRIVE_MODE_1SEC); if (status != SL_STATUS_OK) { return status; } - /* Go back to sleep */ + // Go back to sleep sparkfun_ccs811_wake(false); return SL_STATUS_OK; @@ -127,9 +157,9 @@ sl_status_t sparkfun_ccs811_init(sl_i2cspm_t *i2cspm) /***************************************************************************//** * De-initializes the chip ******************************************************************************/ -sl_status_t sparkfun_ccs811_deinit(sl_i2cspm_t *i2cspm) +sl_status_t sparkfun_ccs811_deinit(i2c_master_t *i2cspm) { - /* Disable the sensor */ + // Disable the sensor (void)i2cspm; sparkfun_ccs811_wake(false); @@ -140,13 +170,11 @@ sl_status_t sparkfun_ccs811_deinit(sl_i2cspm_t *i2cspm) /***************************************************************************//** * Reads Hardware ID from the CCS811 sensor ******************************************************************************/ -sl_status_t sparkfun_ccs811_get_hardware_id(sl_i2cspm_t *i2cspm, - uint8_t *hardwareID) +sl_status_t sparkfun_ccs811_get_hardware_id(uint8_t *hardwareID) { sl_status_t result; - result = sparkfun_ccs811_read_mailbox(i2cspm, - SPARKFUN_CCS811_ADDR_HW_ID, + result = sparkfun_ccs811_read_mailbox(SPARKFUN_CCS811_ADDR_HW_ID, 1, hardwareID); @@ -156,12 +184,11 @@ sl_status_t sparkfun_ccs811_get_hardware_id(sl_i2cspm_t *i2cspm, /**************************************************************************//** * Reads the status of the CCS811 sensor ******************************************************************************/ -sl_status_t sparkfun_ccs811_get_status(sl_i2cspm_t *i2cspm, uint8_t *status) +sl_status_t sparkfun_ccs811_get_status(uint8_t *status) { sl_status_t result; - result = sparkfun_ccs811_read_mailbox(i2cspm, - SPARKFUN_CCS811_ADDR_STATUS, + result = sparkfun_ccs811_read_mailbox(SPARKFUN_CCS811_ADDR_STATUS, 1, status); @@ -171,7 +198,7 @@ sl_status_t sparkfun_ccs811_get_status(sl_i2cspm_t *i2cspm, uint8_t *status) /***************************************************************************//** * Checks if new measurement data available ******************************************************************************/ -bool sparkfun_ccs811_is_data_available(sl_i2cspm_t *i2cspm) +bool sparkfun_ccs811_is_data_available(void) { bool state; sl_status_t status; @@ -179,10 +206,10 @@ bool sparkfun_ccs811_is_data_available(sl_i2cspm_t *i2cspm) state = false; - /* Read the status register */ - status = sparkfun_ccs811_get_status(i2cspm, ®); + // Read the status register + status = sparkfun_ccs811_get_status(®); - /* Check if the DATA_READY bit is set */ + // Check if the DATA_READY bit is set if ((status == SL_STATUS_OK) && ((reg & 0x08) == 0x08)) { state = true; } @@ -193,40 +220,40 @@ bool sparkfun_ccs811_is_data_available(sl_i2cspm_t *i2cspm) /***************************************************************************//** * Switches the CCS811 chip from boot to application mode ******************************************************************************/ -sl_status_t sparkfun_ccs811_start_application(sl_i2cspm_t *i2cspm) +sl_status_t sparkfun_ccs811_start_application(void) { sl_status_t result; uint8_t status; - /* Read status */ - result = sparkfun_ccs811_read_mailbox(i2cspm, - SPARKFUN_CCS811_ADDR_STATUS, + // Read status + result = sparkfun_ccs811_read_mailbox(SPARKFUN_CCS811_ADDR_STATUS, 1, &status); /* If no application firmware present in the CCS811 then return an error - * message */ + * message + */ if ((status & 0x10) != 0x10) { return SL_STATUS_NOT_AVAILABLE; } - /* Issue APP_START */ - result = sparkfun_ccs811_set_app_start(i2cspm); + // Issue APP_START + result = sparkfun_ccs811_set_app_start(); if (result != SL_STATUS_OK) { return result; } - /* Wait 1 ms after app start to send new i2c commands */ + // Wait 1 ms after app start to send new i2c commands sl_sleeptimer_delay_millisecond(1); - /* Check status again */ - result = sparkfun_ccs811_read_mailbox(i2cspm, - SPARKFUN_CCS811_ADDR_STATUS, + // Check status again + result = sparkfun_ccs811_read_mailbox(SPARKFUN_CCS811_ADDR_STATUS, 1, &status); /* If the chip firmware did not switch to application mode then return with - * error */ + * error + */ if ((status & 0x90) != 0x90) { return SL_STATUS_INVALID_STATE; } @@ -237,213 +264,138 @@ sl_status_t sparkfun_ccs811_start_application(sl_i2cspm_t *i2cspm) /***************************************************************************//** * Reads data from a specific Mailbox address ******************************************************************************/ -sl_status_t sparkfun_ccs811_read_mailbox(sl_i2cspm_t *i2cspm, - uint8_t id, +sl_status_t sparkfun_ccs811_read_mailbox(uint8_t id, uint8_t length, uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_write_data[1]; - sl_status_t retval; - - retval = SL_STATUS_OK; - sparkfun_ccs811_wake(true); - /* Write data */ - i2c_write_data[0] = id; - - /* Configure I2C bus transaction */ - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE_READ; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - - /* Select length of data to be read */ - seq.buf[1].data = data; - seq.buf[1].len = length; - - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&air_quality.i2c, + &id, + 1, + data, + length)) { + return SL_STATUS_TRANSMIT; } sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** * Reads measurement data (eCO2 and TVOC) from the CCS811 sensor ******************************************************************************/ -sl_status_t sparkfun_ccs811_get_measurement(sl_i2cspm_t *i2cspm, - uint16_t *eco2, +sl_status_t sparkfun_ccs811_get_measurement(uint16_t *eco2, uint16_t *tvoc) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; uint8_t i2c_read_data[4]; - uint8_t i2c_write_data[1]; - sl_status_t retval; - - retval = SL_STATUS_OK; - - *eco2 = 0; - *tvoc = 0; + uint8_t i2c_write_data = SPARKFUN_CCS811_ADDR_ALG_RESULT_DATA; sparkfun_ccs811_wake(true); - /* Read four bytes from the ALG_RESULT_DATA mailbox register */ - i2c_write_data[0] = SPARKFUN_CCS811_ADDR_ALG_RESULT_DATA; - - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE_READ; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 4; - - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; - } else { - /* Convert the read bytes to 16 bit values */ - *eco2 = ((uint16_t) i2c_read_data[0] << 8) + (uint16_t) i2c_read_data[1]; - *tvoc = ((uint16_t) i2c_read_data[2] << 8) + (uint16_t) i2c_read_data[3]; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&air_quality.i2c, + &i2c_write_data, + 1, + i2c_read_data, + 4)) { + return SL_STATUS_TRANSMIT; } + // Convert the read bytes to 16 bit values + *eco2 = ((uint16_t) i2c_read_data[0] << 8) + (uint16_t) i2c_read_data[1]; + *tvoc = ((uint16_t) i2c_read_data[2] << 8) + (uint16_t) i2c_read_data[3]; + sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** * Gets the latest readings from the sense resistor of the CCS811 sensor *****************************************************************************/ -sl_status_t sparkfun_ccs811_get_raw_data(sl_i2cspm_t *i2cspm, - uint16_t *current, +sl_status_t sparkfun_ccs811_get_raw_data(uint16_t *current, uint16_t *rawData) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; uint8_t i2c_read_data[2]; - uint8_t i2c_write_data[1]; - sl_status_t retval; - - retval = SL_STATUS_OK; - - *current = 0; - *rawData = 0; + uint8_t i2c_write_data = SPARKFUN_CCS811_ADDR_RAW_DATA; sparkfun_ccs811_wake(true); - /* Read four bytes from the SPARKFUN_CCS811_ADDR_RAW_DATA mailbox register */ - i2c_write_data[0] = SPARKFUN_CCS811_ADDR_RAW_DATA; - - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE_READ; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 2; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&air_quality.i2c, + &i2c_write_data, + 1, + i2c_read_data, + 2)) { + return SL_STATUS_TRANSMIT; + } - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; - } else { - /* current: the upper six bits of Byte0 */ - *current = (uint16_t) ((i2c_read_data[0] >> 2) & 0x3F); + // current: the upper six bits of Byte0 + *current = (uint16_t) ((i2c_read_data[0] >> 2) & 0x3F); - /* raw ADC reading: the lower two bits of Byte0 is the MSB, Byte1 is the LSB - */ - *rawData = - (uint16_t) ((i2c_read_data[0] & 0x03) << 8) + (uint16_t) i2c_read_data[1]; - } + // raw ADC reading: the lower two bits of Byte0 is the MSB, Byte1 is the LSB + *rawData = + (uint16_t) ((i2c_read_data[0] & 0x03) << 8) + (uint16_t) i2c_read_data[1]; sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** * Performs software reset on the CCS811 ******************************************************************************/ -sl_status_t sparkfun_ccs811_software_reset(sl_i2cspm_t *i2cspm) +sl_status_t sparkfun_ccs811_software_reset(void) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_read_data[4]; uint8_t i2c_write_data[5]; - sl_status_t retval; - - retval = SL_STATUS_OK; sparkfun_ccs811_wake(true); - /* Write the 0x11 0xE5 0x72 0x8A key sequence to software reset register */ - /* The key sequence is used to prevent accidental reset */ + /* Write the 0x11 0xE5 0x72 0x8A key sequence to software reset register + * The key sequence is used to prevent accidental reset + */ i2c_write_data[0] = SPARKFUN_CCS811_ADDR_SW_RESET; i2c_write_data[1] = 0x11; i2c_write_data[2] = 0xE5; i2c_write_data[3] = 0x72; i2c_write_data[4] = 0x8A; - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 5; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; + if (I2C_MASTER_SUCCESS != i2c_master_write(&air_quality.i2c, + i2c_write_data, + 5)) { + return SL_STATUS_TRANSMIT; } sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** * Sets the measurement mode of the CCS811 sensor ******************************************************************************/ -sl_status_t sparkfun_ccs811_set_measure_mode(sl_i2cspm_t *i2cspm, - uint8_t measMode) +sl_status_t sparkfun_ccs811_set_measure_mode(uint8_t measMode) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_read_data[1]; uint8_t i2c_write_data[2]; - sl_status_t retval; - - retval = SL_STATUS_OK; sparkfun_ccs811_wake(true); - /* Bits 7,6,2,1 and 0 are reserved, clear them */ + // Bits 7,6,2,1 and 0 are reserved, clear them measMode = (measMode & 0x38); - /* Write to the measurement mode register */ + // Write to the measurement mode register i2c_write_data[0] = SPARKFUN_CCS811_ADDR_MEASURE_MODE; i2c_write_data[1] = measMode; - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 2; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; + if (I2C_MASTER_SUCCESS != i2c_master_write(&air_quality.i2c, + i2c_write_data, + 2)) { + return SL_STATUS_TRANSMIT; } sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** @@ -454,75 +406,62 @@ sl_status_t sparkfun_ccs811_set_measure_mode(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -static uint32_t sparkfun_ccs811_set_app_start(sl_i2cspm_t *i2cspm) +static uint32_t sparkfun_ccs811_set_app_start(void) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_read_data[2]; - uint8_t i2c_write_data[1]; - sl_status_t retval; - - retval = SL_STATUS_OK; + uint8_t i2c_write_data; sparkfun_ccs811_wake(true); - /* Perform a write with no data to the APP_START register to change the */ - /* state from boot mode to application mode */ - i2c_write_data[0] = SPARKFUN_CCS811_ADDR_APP_START; - - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; + /* Perform a write with no data to the APP_START register to change the + * state from boot mode to application mode + */ + i2c_write_data = SPARKFUN_CCS811_ADDR_APP_START; - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; + if (I2C_MASTER_SUCCESS != i2c_master_write(&air_quality.i2c, + &i2c_write_data, + 1)) { + return SL_STATUS_TRANSMIT; } sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** * Writes temperature and humidity values to the environmental data regs ******************************************************************************/ -sl_status_t sparkfun_ccs811_set_env_data(sl_i2cspm_t *i2cspm, - int32_t tempData, +sl_status_t sparkfun_ccs811_set_env_data(int32_t tempData, uint32_t rhData) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_read_data[4]; uint8_t i2c_write_data[5]; uint8_t humidityRegValue; uint8_t temperatureRegValue; - sl_status_t retval; sparkfun_ccs811_wake(true); - /* The CCS811 currently supports only 0.5% resolution */ - /* If the fraction greater than 0.7 then round up the value */ - /* Shift to the left by one to meet the required data format */ + /* The CCS811 currently supports only 0.5% resolution + * If the fraction greater than 0.7 then round up the value + * Shift to the left by one to meet the required data format + */ if (((rhData % 1000) / 100) > 7) { humidityRegValue = (rhData / 1000 + 1) << 1; } else { humidityRegValue = (rhData / 1000) << 1; } - /* If the fraction is greater than 0.2 or less than 0.8 set the */ - /* LSB bit, which is the most significant bit of the fraction 2^(-1) = 0.5 */ + /* If the fraction is greater than 0.2 or less than 0.8 set the + * LSB bit, which is the most significant bit of the fraction 2^(-1) = 0.5 + */ if ((((rhData % 1000) / 100) > 2) && (((rhData % 1000) / 100) < 8)) { humidityRegValue |= 0x01; } - /* Add +25 C to the temperature value */ - /* The CCS811 currently supports only 0.5C resolution */ - /* If the fraction greater than 0.7 then round up the value */ - /* Shift to the left by one to meet the required data format */ + /* Add +25 C to the temperature value + * The CCS811 currently supports only 0.5C resolution + * If the fraction greater than 0.7 then round up the value + * Shift to the left by one to meet the required data format + */ tempData += 25000; if (((tempData % 1000) / 100) > 7) { temperatureRegValue = (tempData / 1000 + 1) << 1; @@ -530,50 +469,42 @@ sl_status_t sparkfun_ccs811_set_env_data(sl_i2cspm_t *i2cspm, temperatureRegValue = (tempData / 1000) << 1; } - /* If the fraction is greater than 0.2 or less than 0.8 set the */ - /* LSB bit, which is the most significant bit of the fraction 2^(-1) = 0.5 */ + /* If the fraction is greater than 0.2 or less than 0.8 set the + * LSB bit, which is the most significant bit of the fraction 2^(-1) = 0.5 + */ if ((((tempData % 1000) / 100) > 2) && (((tempData % 1000) / 100) < 8)) { temperatureRegValue |= 0x01; } - /* Write the correctly formatted values to the environmental data register */ - /* The LSB bytes of the humidity and temperature data are 0x00 because */ - /* the current CCS811 supports only 0.5% and 0.5C resolution */ + /* Write the correctly formatted values to the environmental data register + * The LSB bytes of the humidity and temperature data are 0x00 because + * the current CCS811 supports only 0.5% and 0.5C resolution + */ i2c_write_data[0] = SPARKFUN_CCS811_ADDR_ENV_DATA; i2c_write_data[1] = humidityRegValue; i2c_write_data[2] = 0x00; i2c_write_data[3] = temperatureRegValue; i2c_write_data[4] = 0x00; - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 5; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - - retval = SL_STATUS_OK; - - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; + if (I2C_MASTER_SUCCESS != i2c_master_write(&air_quality.i2c, + i2c_write_data, + 5)) { + return SL_STATUS_TRANSMIT; } sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** * Read out current firmware of the CCS811 sensor ******************************************************************************/ -sl_status_t sparkfun_ccs811_read_firmware_version(sl_i2cspm_t *i2cspm, - uint16_t *fw_version) +sl_status_t sparkfun_ccs811_read_firmware_version(uint16_t *fw_version) { sl_status_t status; uint8_t buffer[2]; - status = sparkfun_ccs811_read_mailbox(i2cspm, - SPARKFUN_CCS811_ADDR_FW_APP_VERSION, + status = sparkfun_ccs811_read_mailbox(SPARKFUN_CCS811_ADDR_FW_APP_VERSION, 2, buffer); if (status != SL_STATUS_OK) { @@ -588,8 +519,7 @@ sl_status_t sparkfun_ccs811_read_firmware_version(sl_i2cspm_t *i2cspm, /***************************************************************************//** * Performs a firmware update of the CCS811 sensor ******************************************************************************/ -sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, - const uint8_t *firmware, +sl_status_t sparkfun_ccs811_update_firmware(const uint8_t *firmware, uint32_t length) { sl_status_t status; @@ -601,23 +531,22 @@ sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, /*************************************************************************/ /** Put CCS811 in BOOT mode **/ /*************************************************************************/ - status = sparkfun_ccs811_get_status(i2cspm, ®); + status = sparkfun_ccs811_get_status(®); if (status != SL_STATUS_OK) { return status; } if ((reg & 0x80) == 0x80) { - /* In APP mode - Go to BOOT mode */ - - status = sparkfun_ccs811_software_reset(i2cspm); + // In APP mode - Go to BOOT mode + status = sparkfun_ccs811_software_reset(); if ((status & 0x80) != 0x00) { return SL_STATUS_FAIL; } sl_sleeptimer_delay_millisecond(100); - /* Check for BOOT mode */ - status = sparkfun_ccs811_get_status(i2cspm, ®); + // Check for BOOT mode + status = sparkfun_ccs811_get_status(®); if ((reg & 0x80) != 0x00) { return SL_STATUS_FAIL; } @@ -626,10 +555,10 @@ sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, /*************************************************************************/ /** Erase **/ /*************************************************************************/ - status = sparkfun_ccs811_get_status(i2cspm, ®); + status = sparkfun_ccs811_get_status(®); if ((reg & 0x10) == 0x10) { - /* Valid application - Erase this */ - status = sparkfun_ccs811_erase_application(i2cspm); + // Valid application - Erase this + status = sparkfun_ccs811_erase_application(); sl_sleeptimer_delay_millisecond(500); if (status != SL_STATUS_OK) { return SL_STATUS_FAIL; @@ -637,8 +566,8 @@ sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, sl_sleeptimer_delay_millisecond(100); - /* Check APP_VALID flag again */ - status = sparkfun_ccs811_get_status(i2cspm, ®); + // Check APP_VALID flag again + status = sparkfun_ccs811_get_status(®); if ((reg & 0x10) != 0x00) { return SL_STATUS_FAIL; } @@ -648,11 +577,11 @@ sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, /** Program APP **/ /*************************************************************************/ for ( i = 0; i < length; i += 8 ) { - /* Read the next 8 bytes from the firmware file */ + // Read the next 8 bytes from the firmware file memcpy(&buffer, &firmware[i], 8); - /* Write 8 bytes to the device's flash memory */ - status = sparkfun_ccs811_program_firmware(i2cspm, buffer); + // Write 8 bytes to the device's flash memory + status = sparkfun_ccs811_program_firmware(buffer); if (status != SL_STATUS_OK) { return SL_STATUS_FAIL; } @@ -661,12 +590,12 @@ sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, /*************************************************************************/ /** Verify APP **/ /*************************************************************************/ - status = sparkfun_ccs811_verify_application(i2cspm, &valid); + status = sparkfun_ccs811_verify_application(&valid); if ((status != SL_STATUS_OK) || (valid == false)) { return false; } - /* Wait at least 70ms before issuing i2c transmissions to the CCS811 sensor */ + // Wait at least 70ms before issuing i2c transmissions to the CCS811 sensor sl_sleeptimer_delay_millisecond(70); return SL_STATUS_OK; @@ -683,20 +612,13 @@ sl_status_t sparkfun_ccs811_update_firmware(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -static uint32_t sparkfun_ccs811_program_firmware(sl_i2cspm_t *i2cspm, - uint8_t buffer[]) +static uint32_t sparkfun_ccs811_program_firmware(uint8_t buffer[]) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_read_data[2]; uint8_t i2c_write_data[9]; - sl_status_t retval; - - retval = SL_STATUS_OK; sparkfun_ccs811_wake(true); - /* Send the Write Data to FLASH command and 8 bytes of binary program code */ + // Send the Write Data to FLASH command and 8 bytes of binary program code i2c_write_data[0] = SPARKFUN_CCS811_ADDR_FW_PROGRAM; i2c_write_data[1] = buffer[0]; i2c_write_data[2] = buffer[1]; @@ -707,21 +629,15 @@ static uint32_t sparkfun_ccs811_program_firmware(sl_i2cspm_t *i2cspm, i2c_write_data[7] = buffer[6]; i2c_write_data[8] = buffer[7]; - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 9; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; + if (I2C_MASTER_SUCCESS != i2c_master_write(&air_quality.i2c, + i2c_write_data, + 9)) { + return SL_STATUS_TRANSMIT; } sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /***************************************************************************//** @@ -733,49 +649,36 @@ static uint32_t sparkfun_ccs811_program_firmware(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error *****************************************************************************/ -static uint32_t sparkfun_ccs811_verify_application(sl_i2cspm_t *i2cspm, - bool *appValid) +static uint32_t sparkfun_ccs811_verify_application(bool *appValid) { - sl_status_t status; uint8_t reg; - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_read_data[2]; - uint8_t i2c_write_data[2]; + uint8_t i2c_write_data = SPARKFUN_CCS811_ADDR_FW_VERIFY; *appValid = false; sparkfun_ccs811_wake(true); - /* Write (with no data) to the verify register to check if the firmware */ - /* programmed to the CCS811 was received error free */ - i2c_write_data[0] = SPARKFUN_CCS811_ADDR_FW_VERIFY; - - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - - status = SL_STATUS_OK; - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - status = SL_STATUS_TRANSMIT; - } else { - /* Wait until the Verify command finishes */ - sl_sleeptimer_delay_millisecond(100); + /* Write (with no data) to the verify register to check if the firmware + * programmed to the CCS811 was received error free + */ + if (I2C_MASTER_SUCCESS != i2c_master_write(&air_quality.i2c, + &i2c_write_data, + 1)) { + return SL_STATUS_TRANSMIT; + } - /* Check the status register to see if there were no errors */ - status = sparkfun_ccs811_get_status(i2cspm, ®); - if ((status == SL_STATUS_OK) && ((reg & 0x10) == 0x10)) { - *appValid = true; - } + // Wait until the Verify command finishes + sl_sleeptimer_delay_millisecond(100); + + // Check the status register to see if there were no errors + if ((sparkfun_ccs811_get_status(®) == SL_STATUS_OK) + && ((reg & 0x10) == 0x10)) { + *appValid = true; } sparkfun_ccs811_wake(false); - return status; + return SL_STATUS_OK; } /***************************************************************************//** @@ -786,41 +689,30 @@ static uint32_t sparkfun_ccs811_verify_application(sl_i2cspm_t *i2cspm, * @retval SL_STATUS_OK Success * @retval SL_STATUS_TRANSMIT I2C transmission error ******************************************************************************/ -static uint32_t sparkfun_ccs811_erase_application(sl_i2cspm_t *i2cspm) +static uint32_t sparkfun_ccs811_erase_application(void) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - uint8_t i2c_read_data[4]; uint8_t i2c_write_data[5]; - sl_status_t retval; - - retval = SL_STATUS_OK; sparkfun_ccs811_wake(true); - /* Write the 0xE7 0xA7 0xE6 0x09 key sequence to firmware erase register */ - /* The key sequence is used to prevent accidental erase */ + /* Write the 0xE7 0xA7 0xE6 0x09 key sequence to firmware erase register + * The key sequence is used to prevent accidental erase + */ i2c_write_data[0] = SPARKFUN_CCS811_ADDR_FW_ERASE; i2c_write_data[1] = 0xE7; i2c_write_data[2] = 0xA7; i2c_write_data[3] = 0xE6; i2c_write_data[4] = 0x09; - seq.addr = SPARKFUN_CCS811_DEFAULT_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 5; - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - - ret = I2CSPM_Transfer(i2cspm, &seq); - if (ret != i2cTransferDone) { - retval = SL_STATUS_TRANSMIT; + if (I2C_MASTER_SUCCESS != i2c_master_write(&air_quality.i2c, + i2c_write_data, + 5)) { + return SL_STATUS_TRANSMIT; } sparkfun_ccs811_wake(false); - return retval; + return SL_STATUS_OK; } /** @} (end defgroup CCS811) */ diff --git a/driver/public/silabs/epaper_ext3_1/config/brd2703a/epaper_display_config.h b/driver/public/silabs/epaper_ext3_1/config/brd2703a/epaper_display_config.h new file mode 100644 index 00000000..558cd013 --- /dev/null +++ b/driver/public/silabs/epaper_ext3_1/config/brd2703a/epaper_display_config.h @@ -0,0 +1,174 @@ +/***************************************************************************//** + * @file epd_config.h + * @brief E-Paper Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef EPD_CONFIG_H_ +#define EPD_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define EPD_TYPE 0x580B +#define EPD_VERTICAL 256 +#define EPD_HORIZONTAL 720 +#define EPD_DIAGONAL 581 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> +// SPIDRV settings + +// SPI bitrate +// Default: 1000000 +#define SPI_EPD_BITRATE 8000000 + +// SPI frame length <4-16> +// Default: 8 +#define SPI_EPD_FRAME_LENGTH 8 + +// SPI mode +// Master +// Slave +#define SPI_EPD_TYPE spidrvMaster + +// Bit order on the SPI bus +// LSB transmitted first +// MSB transmitted first +#define SPI_EPD_BIT_ORDER spidrvBitOrderMsbFirst + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define SPI_EPD_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define SPI_EPD_CS_CONTROL spidrvCsControlAuto + +// SPI slave transfer start scheme +// Transfer starts immediately +// Transfer starts when the bus is idle +// Only applies if instance type is spidrvSlave +#define SPI_EPD_SLAVE_START_MODE spidrvSlaveStartImmediate +// +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// SPI_EPD +// $[USART_SPI_EPD] +#ifndef SPI_EPD_PERIPHERAL +#define SPI_EPD_PERIPHERAL USART0 +#endif +#ifndef SPI_EPD_PERIPHERAL_NO +#define SPI_EPD_PERIPHERAL_NO 0 +#endif + +// USART0 TX on PC00 +#ifndef SPI_EPD_TX_PORT +#define SPI_EPD_TX_PORT gpioPortC +#endif +#ifndef SPI_EPD_TX_PIN +#define SPI_EPD_TX_PIN 3 +#endif + +// USART0 RX on PC01 +#ifndef SPI_EPD_RX_PORT +#define SPI_EPD_RX_PORT gpioPortC +#endif +#ifndef SPI_EPD_RX_PIN +#define SPI_EPD_RX_PIN 2 +#endif + +// USART0 CLK on PC02 +#ifndef SPI_EPD_CLK_PORT +#define SPI_EPD_CLK_PORT gpioPortC +#endif +#ifndef SPI_EPD_CLK_PIN +#define SPI_EPD_CLK_PIN 1 +#endif + +// USART0 CS on PC03 +#ifndef SPI_EPD_CS_PORT +#define SPI_EPD_CS_PORT gpioPortC +#endif +#ifndef SPI_EPD_CS_PIN +#define SPI_EPD_CS_PIN 0 +#endif +// [USART_SPI_EPD]$ +// EPD_DC +// $[GPIO_EPD_DC] +#ifndef EPD_DC_PORT +#define EPD_DC_PORT gpioPortA +#endif +#ifndef EPD_DC_PIN +#define EPD_DC_PIN 0 +#endif +// [GPIO_EPD_DC]$ + +// EPD_RST +// $[GPIO_EPD_RST] +#ifndef EPD_RST_PORT +#define EPD_RST_PORT gpioPortD +#endif +#ifndef EPD_RST_PIN +#define EPD_RST_PIN 5 +#endif +// [GPIO_EPD_RST]$ + +// EPD_BUSY +// $[GPIO_EPD_BUSY] +#ifndef EPD_BUSY_PORT +#define EPD_BUSY_PORT gpioPortB +#endif +#ifndef EPD_BUSY_PIN +#define EPD_BUSY_PIN 1 +#endif +// [GPIO_EPD_BUSY]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // EPD_CONFIG_H_ diff --git a/driver/public/silabs/epaper_ext3_1/config/brd4314a/epaper_display_config.h b/driver/public/silabs/epaper_ext3_1/config/brd4314a/epaper_display_config.h new file mode 100644 index 00000000..f0fa5cbd --- /dev/null +++ b/driver/public/silabs/epaper_ext3_1/config/brd4314a/epaper_display_config.h @@ -0,0 +1,174 @@ +/***************************************************************************//** + * @file epd_config.h + * @brief E-Paper Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef EPD_CONFIG_H_ +#define EPD_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define EPD_TYPE 0x580B +#define EPD_VERTICAL 256 +#define EPD_HORIZONTAL 720 +#define EPD_DIAGONAL 581 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> +// SPIDRV settings + +// SPI bitrate +// Default: 1000000 +#define SPI_EPD_BITRATE 8000000 + +// SPI frame length <4-16> +// Default: 8 +#define SPI_EPD_FRAME_LENGTH 8 + +// SPI mode +// Master +// Slave +#define SPI_EPD_TYPE spidrvMaster + +// Bit order on the SPI bus +// LSB transmitted first +// MSB transmitted first +#define SPI_EPD_BIT_ORDER spidrvBitOrderMsbFirst + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define SPI_EPD_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define SPI_EPD_CS_CONTROL spidrvCsControlAuto + +// SPI slave transfer start scheme +// Transfer starts immediately +// Transfer starts when the bus is idle +// Only applies if instance type is spidrvSlave +#define SPI_EPD_SLAVE_START_MODE spidrvSlaveStartImmediate +// +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// SPI_EPD +// $[USART_SPI_EPD] +#ifndef SPI_EPD_PERIPHERAL +#define SPI_EPD_PERIPHERAL USART0 +#endif +#ifndef SPI_EPD_PERIPHERAL_NO +#define SPI_EPD_PERIPHERAL_NO 0 +#endif + +// USART0 TX on PC00 +#ifndef SPI_EPD_TX_PORT +#define SPI_EPD_TX_PORT gpioPortC +#endif +#ifndef SPI_EPD_TX_PIN +#define SPI_EPD_TX_PIN 0 +#endif + +// USART0 RX on PC01 +#ifndef SPI_EPD_RX_PORT +#define SPI_EPD_RX_PORT gpioPortC +#endif +#ifndef SPI_EPD_RX_PIN +#define SPI_EPD_RX_PIN 1 +#endif + +// USART0 CLK on PC02 +#ifndef SPI_EPD_CLK_PORT +#define SPI_EPD_CLK_PORT gpioPortC +#endif +#ifndef SPI_EPD_CLK_PIN +#define SPI_EPD_CLK_PIN 2 +#endif + +// USART0 CS on PC03 +#ifndef SPI_EPD_CS_PORT +#define SPI_EPD_CS_PORT gpioPortC +#endif +#ifndef SPI_EPD_CS_PIN +#define SPI_EPD_CS_PIN 3 +#endif +// [USART_SPI_EPD]$ +// EPD_DC +// $[GPIO_EPD_DC] +#ifndef EPD_DC_PORT +#define EPD_DC_PORT gpioPortB +#endif +#ifndef EPD_DC_PIN +#define EPD_DC_PIN 4 +#endif +// [GPIO_EPD_DC]$ + +// EPD_RST +// $[GPIO_EPD_RST] +#ifndef EPD_RST_PORT +#define EPD_RST_PORT gpioPortB +#endif +#ifndef EPD_RST_PIN +#define EPD_RST_PIN 2 +#endif +// [GPIO_EPD_RST]$ + +// EPD_BUSY +// $[GPIO_EPD_BUSY] +#ifndef EPD_BUSY_PORT +#define EPD_BUSY_PORT gpioPortB +#endif +#ifndef EPD_BUSY_PIN +#define EPD_BUSY_PIN 3 +#endif +// [GPIO_EPD_BUSY]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // EPD_CONFIG_H_ diff --git a/driver/public/mikroe/e_paper_154_inch/config/brd4182a/mikroe_e_paper_154_inch_config.h b/driver/public/silabs/epaper_ext3_1/config/brd4338a/epaper_display_config.h similarity index 53% rename from driver/public/mikroe/e_paper_154_inch/config/brd4182a/mikroe_e_paper_154_inch_config.h rename to driver/public/silabs/epaper_ext3_1/config/brd4338a/epaper_display_config.h index b819a7ca..5d51555a 100644 --- a/driver/public/mikroe/e_paper_154_inch/config/brd4182a/mikroe_e_paper_154_inch_config.h +++ b/driver/public/silabs/epaper_ext3_1/config/brd4338a/epaper_display_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_e_paper_config.h - * @brief Mikroe E-Paper Configuration + * @file epd_config.h + * @brief E-Paper Display Configuration * @version 1.0.0 ******************************************************************************* * # License @@ -36,60 +36,78 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_E_PAPER_154_INCH_CONFIG_H_ -#define MIKROE_E_PAPER_154_INCH_CONFIG_H_ + +#ifndef EPD_CONFIG_H_ +#define EPD_CONFIG_H_ #ifdef __cplusplus extern "C" { #endif -#define MIKROE_E_PAPER_WIDTH 200 -#define MIKROE_E_PAPER_HEIGHT 200 +#define EPD_TYPE 0x580B +#define EPD_VERTICAL 256 +#define EPD_HORIZONTAL 720 +#define EPD_DIAGONAL 581 -// A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> - -// ESL MODE setting -// ESL_MODE> Enable Peripheral -// Macro for the ESL mode -#define ESL_MODE 0 -// -// - -// The block ends with the following line or at the end of the file: // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// E_PAPER_DC -// $[GPIO_E_PAPER_DC] -#ifndef E_PAPER_DC_PORT -#define E_PAPER_DC_PORT gpioPortD +// SPI_EPD_CS +// $[GPIO_SPI_EPD_CS] +#ifndef SPI_EPD_CS_PORT +#define SPI_EPD_CS_PORT HP +#endif +#ifndef SPI_EPD_CS_PIN +#define SPI_EPD_CS_PIN 49 +#endif +// [GPIO_SPI_EPD_CS]$ + +// EPD_DC +// $[GPIO_EPD_DC] +#ifndef EPD_DC_PORT +#define EPD_DC_PORT HP #endif -#ifndef E_PAPER_DC_PIN -#define E_PAPER_DC_PIN 2 +#ifndef EPD_DC_PIN +#define EPD_DC_PIN 50 #endif -// [GPIO_E_PAPER_DC]$ +// [GPIO_EPD_DC]$ -// E_PAPER_RST -// $[GPIO_E_PAPER_RST] -#ifndef E_PAPER_RST_PORT -#define E_PAPER_RST_PORT gpioPortD +// EPD_RST +// $[GPIO_EPD_RST] +#ifndef EPD_RST_PORT +#define EPD_RST_PORT HP #endif -#ifndef E_PAPER_RST_PIN -#define E_PAPER_RST_PIN 3 +#ifndef EPD_RST_PIN +#define EPD_RST_PIN 52 #endif -// [GPIO_E_PAPER_RST]$ +// [GPIO_EPD_RST]$ -// E_PAPER_BSY -// $[GPIO_E_PAPER_BSY] -#ifndef E_PAPER_BSY_PORT -#define E_PAPER_BSY_PORT gpioPortB +// EPD_BUSY +// $[GPIO_EPD_BUSY] +#ifndef EPD_BUSY_PORT +#define EPD_BUSY_PORT HP #endif -#ifndef E_PAPER_BSY_PIN -#define E_PAPER_BSY_PIN 1 +#ifndef EPD_BUSY_PIN +#define EPD_BUSY_PIN 51 #endif -// [GPIO_E_PAPER_BSY]$ +// [GPIO_EPD_BUSY]$ +// <<< sl:end pin_tool >>> + +#define SPI_EPD_CLK_PORT HP +#define SPI_EPD_CLK_PIN 46 + +#define SPI_EPD_TX_PORT HP +#define SPI_EPD_TX_PIN 48 + +#define SPI_EPD_RX_PORT HP +#define SPI_EPD_RX_PIN 47 + +#ifdef __cplusplus +} #endif + +#endif // EPD_CONFIG_H_ diff --git a/driver/public/silabs/epaper_ext3_1/config/other/epaper_display_config.h b/driver/public/silabs/epaper_ext3_1/config/other/epaper_display_config.h new file mode 100644 index 00000000..65e5d73a --- /dev/null +++ b/driver/public/silabs/epaper_ext3_1/config/other/epaper_display_config.h @@ -0,0 +1,187 @@ +/***************************************************************************//** + * @file epd_config.h + * @brief E-Paper Display Configuration + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef EPD_CONFIG_H_ +#define EPD_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define EPD_TYPE 0x580B +#define EPD_VERTICAL 256 +#define EPD_HORIZONTAL 720 +#define EPD_DIAGONAL 581 + +// A CMSIS annotation block starts with the following line: +// <<< Use Configuration Wizard in Context Menu >>> +// SPIDRV settings + +// SPI bitrate +// Default: 1000000 +#define SPI_EPD_BITRATE 8000000 + +// SPI frame length <4-16> +// Default: 8 +#define SPI_EPD_FRAME_LENGTH 8 + +// SPI mode +// Master +// Slave +#define SPI_EPD_TYPE spidrvMaster + +// Bit order on the SPI bus +// LSB transmitted first +// MSB transmitted first +#define SPI_EPD_BIT_ORDER spidrvBitOrderMsbFirst + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define SPI_EPD_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define SPI_EPD_CS_CONTROL spidrvCsControlAuto + +// SPI slave transfer start scheme +// Transfer starts immediately +// Transfer starts when the bus is idle +// Only applies if instance type is spidrvSlave +#define SPI_EPD_SLAVE_START_MODE spidrvSlaveStartImmediate +// +// The block ends with the following line or at the end of the file: +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// SPI_EPD +// $[USART_SPI_EPD] +#warning "E_PAPER_154_INCH_DC is not configured" +// #ifndef SPI_EPD_PERIPHERAL +// #define SPI_EPD_PERIPHERAL USART0 +// #endif +// #ifndef SPI_EPD_PERIPHERAL_NO +// #define SPI_EPD_PERIPHERAL_NO 0 +// #endif + +// SPI_EPD_TX +// $[SPI_EPD_TX] +#warning "SPI_EPD_TX is not configured" +// #ifndef SPI_EPD_TX_PORT +// #define SPI_EPD_TX_PORT gpioPortC +// #endif +// #ifndef SPI_EPD_TX_PIN +// #define SPI_EPD_TX_PIN 0 +// #endif + +// SPI_EPD_RX +// $[SPI_EPD_RX] +#warning "SPI_EPD_RX is not configured" +// #ifndef SPI_EPD_RX_PORT +// #define SPI_EPD_RX_PORT gpioPortC +// #endif +// #ifndef SPI_EPD_RX_PIN +// #define SPI_EPD_RX_PIN 1 +// #endif + +// SPI_EPD_CLK +// $[SPI_EPD_CLK] +#warning "SPI_EPD_CLK is not configured" +// #ifndef SPI_EPD_CLK_PORT +// #define SPI_EPD_CLK_PORT gpioPortC +// #endif +// #ifndef SPI_EPD_CLK_PIN +// #define SPI_EPD_CLK_PIN 2 +// #endif + +// SPI_EPD_CS +// $[SPI_EPD_CS] +#warning "SPI_EPD_CS is not configured" +// #ifndef SPI_EPD_CS_PORT +// #define SPI_EPD_CS_PORT gpioPortC +// #endif +// #ifndef SPI_EPD_CS_PIN +// #define SPI_EPD_CS_PIN 3 +// #endif +// [USART_SPI_EPD]$ + +// EPD_DC +// $[GPIO_EPD_DC] +#warning "EPD_DC is not configured" +// #ifndef EPD_DC_PORT +// #define EPD_DC_PORT gpioPortB +// #endif +// #ifndef EPD_DC_PIN +// #define EPD_DC_PIN 4 +// #endif +// [GPIO_EPD_DC]$ + +// EPD_RST +// $[GPIO_EPD_RST] +#warning "EPD_RST is not configured" +// #ifndef EPD_RST_PORT +// #define EPD_RST_PORT gpioPortB +// #endif +// #ifndef EPD_RST_PIN +// #define EPD_RST_PIN 2 +// #endif +// [GPIO_EPD_RST]$ + +// EPD_BUSY +// $[GPIO_EPD_BUSY] +#warning "EPD_BUSY is not configured" +// #ifndef EPD_BUSY_PORT +// #define EPD_BUSY_PORT gpioPortB +// #endif +// #ifndef EPD_BUSY_PIN +// #define EPD_BUSY_PIN 3 +// #endif +// [GPIO_EPD_BUSY]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif // EPD_CONFIG_H_ diff --git a/driver/public/silabs/ir_array_mlx90640/inc/sparkfun_mlx90640_i2c.h b/driver/public/silabs/epaper_ext3_1/inc/epaper_display.h similarity index 54% rename from driver/public/silabs/ir_array_mlx90640/inc/sparkfun_mlx90640_i2c.h rename to driver/public/silabs/epaper_ext3_1/inc/epaper_display.h index 382617f3..4ff9e80e 100644 --- a/driver/public/silabs/ir_array_mlx90640/inc/sparkfun_mlx90640_i2c.h +++ b/driver/public/silabs/epaper_ext3_1/inc/epaper_display.h @@ -1,6 +1,7 @@ /***************************************************************************//** - * @file sparkfun_mlx90640_i2c.h - * @brief SPARKFUN MLX90640 IR Array sensor I2C header file. + * @file epaper_display.h + * @brief E-Paper Display Header File + * @version 1.0.0 ******************************************************************************* * # License * Copyright 2022 Silicon Laboratories Inc. www.silabs.com @@ -27,97 +28,108 @@ * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * ******************************************************************************/ -#ifndef SPARKFUN_MLX90640_I2C_H_ -#define SPARKFUN_MLX90640_I2C_H_ - -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- +#ifndef EPAPER_DISPLAY +#define EPAPER_DISPLAY #include +#include +#include #include "sl_status.h" -#include "sl_i2cspm.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct epd_driver; + +// E-Paper Display (EPD) +struct epd { + const struct epd_driver *drv; +}; + +struct epd_driver { + void (*set_reset_pin)(bool active); + bool (*get_busy_pin)(void); + void (*sspi_init)(void); + void (*spi_init)(void); + void (*delay_10us)(uint32_t idelay); + sl_status_t (*sspi_command_read)(struct epd *epd, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len); + sl_status_t (*spi_command_write)(struct epd *epd, + uint8_t cmd, + const uint8_t *data, size_t len); +}; + +/***************************************************************************//** + * @brief EPD Initialization function. + ******************************************************************************/ +void epd_init(void); + +void epd_driver_init(struct epd *epd); // ----------------------------------------------------------------------------- -// Public Function Declarations +// COG related Function // ----------------------------------------------------------------------------- /***************************************************************************//** * @brief - * Assigns an I2CSPM instance and the default slave address for the driver to - * use + * COG Initialization function. * - * @param[in] i2cspm_instace - Pointer to the I2CSPM instance + * @param[in] image1 first image data frame + * @param[in] image2 second image data frame ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_init(sl_i2cspm_t *i2cspm_instance, - uint8_t i2c_addr); +void cog_initial(uint8_t *image1, uint8_t *image2); /***************************************************************************//** - * Assigns a new I2CSPM instance and a slave address for the driver to use + * @brief Power on COG driver. ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_change_bus_and_address( - sl_i2cspm_t *i2cspm_instance, - uint8_t i2c_addr); +void cog_power_on(void); /***************************************************************************//** - * @brief - * Updates the I2C slave address of the device. - * In case the address is already changed then it only stores the address to - * use - * - * @param[in] slave_addr - new I2C slave address to use + * @brief COG shutdown. ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_set_own_address(uint8_t slave_addr); +void cog_power_off(void); /***************************************************************************//** - * @brief - * Retrieves the current I2C slave address used by the driver - * - * @param[out] current_address - Current I2C slave address used + * @brief Read OTP data. ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_get_current_own_addr( - uint8_t *current_address); +void cog_get_data_otp(void); /***************************************************************************//** - * @brief - * Issues an I2C general reset + * @brief DC-DC soft-start command. ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_general_reset(void); +void cog_soft_start(void); /***************************************************************************//** * @brief - * Initiates an I2C read of the device + * Initialization function. * - * @param[in] startAddress - EEPROM memory address of the device to read out - * from - * @param[in] nMemAddressRead - Length of the requested data - * @param[out] data - pointer to an array where the received data will be stored + * @param[in] dram1 data is the new image data that you want to display + * @param[in] dram2 The data definition of DRAM2 is different between + * "Normal update" and "Fast update" + * 1. Normal update: DRAM2 image is dummy data + * 2. Fast update: DRAM2 image is the OLD image data ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_read(uint16_t startAddress, - uint16_t nMemAddressRead, - uint16_t *data); +void cog_send_image(uint8_t *dram1, uint8_t *dram2); /***************************************************************************//** - * @brief - * Initiates an I2C write to the device - * - * @param[in] writeAddress - EEPROM memory address of the device to write to - * @param[in] data - 16bit data to send to the device + * @brief Send updating command. ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_write(uint16_t writeAddress, uint16_t data); +void cog_display_refresh(void); -/***************************************************************************//** - * @brief - * Sets I2C base frequency to a given setting - * - * @param[in] freq - new frequency in Hz to set for the I2C base frequency - ******************************************************************************/ -void sparkfun_mlx90640_i2c_freq_set(int freq); +#ifdef __cplusplus +} +#endif -#endif /* SPARKFUN_MLX90640_I2C_H_ */ +#endif // EPAPER_DISPLAY diff --git a/driver/public/silabs/air_quality_sgp40/inc/sparkfun_sgp40_i2c.h b/driver/public/silabs/epaper_ext3_1/inc/oled_display.h similarity index 50% rename from driver/public/silabs/air_quality_sgp40/inc/sparkfun_sgp40_i2c.h rename to driver/public/silabs/epaper_ext3_1/inc/oled_display.h index 0c18a6ad..a0f00ff0 100644 --- a/driver/public/silabs/air_quality_sgp40/inc/sparkfun_sgp40_i2c.h +++ b/driver/public/silabs/epaper_ext3_1/inc/oled_display.h @@ -1,9 +1,9 @@ /***************************************************************************//** - * @file sparkfun_sgp40_i2c.h - * @brief sparkfun_sgp40_i2c header file. + * @file oled_display.h + * @brief OLED Driver API interface ******************************************************************************* * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * * SPDX-License-Identifier: Zlib @@ -32,57 +32,56 @@ * as a demonstration for evaluation purposes only. This code will be maintained * at the sole discretion of Silicon Labs. ******************************************************************************/ -#ifndef SPARKFUN_SGP40_I2C_H_ -#define SPARKFUN_SGP40_I2C_H_ +#ifndef OLED_DISPLAY_H +#define OLED_DISPLAY_H -#include "sl_i2cspm.h" +#include #include "sl_status.h" -/***************************************************************************//** - * @addtogroup SGP40 - Air Quality Sensor - * @brief This file contains I2C driver for Air Quality Sensor. - ******************************************************************************/ -/// @brief I2C Address -#define SGP40_ADDRESS 0x59 +#ifdef __cplusplus +extern "C" { +#endif -/***************************************************************************//** - * @brief - * Function to perform I2C write to the air quality sensor - * - * @param[in] i2c_instance - * The I2C peripheral to use. - * @param[in] src - * Pointer to data send buffer. - * @param[in] len - * Length of data send. - * - * @return - * @li @ref SL_STATUS_OK Success. - * - * @li @ref SL_STATUS_FAIL Failure. - ******************************************************************************/ -sl_status_t i2c_write_blocking(sl_i2cspm_t *i2c_instance, - uint8_t *src, - uint32_t len); +typedef struct oled_display_driver_api { + sl_status_t (*init)(void); + sl_status_t (*draw_pixel)(int16_t x, int16_t y, uint16_t color); + uint16_t (*get_raw_pixel)(int16_t x, int16_t y); + sl_status_t (*fill_screen)(uint16_t color); + sl_status_t (*update_display)(void); + sl_status_t (*set_invert_color)(void); + sl_status_t (*set_normal_color)(void); + sl_status_t (*set_contrast)(uint8_t); + sl_status_t (*scroll_right)(uint8_t, uint8_t); + sl_status_t (*scroll_left)(uint8_t, uint8_t); + sl_status_t (*scroll_diag_right)(uint8_t, uint8_t); + sl_status_t (*scroll_diag_left)(uint8_t, uint8_t); + sl_status_t (*stop_scroll)(void); + sl_status_t (*enable_display)(bool); +} oled_display_driver_api_t; -/***************************************************************************//** +/** + * General memory LCD data structure. + */ +typedef struct oled_display { + unsigned short width; ///< Display pixel width + unsigned short height; ///< Display pixel height + const oled_display_driver_api_t *driver; +} oled_display_t; + +/**************************************************************************//** * @brief - * Function to perform I2C read from the air quality sensor - * - * @param[in] i2c_instance - * The I2C peripheral to use. - * @param[in] dest - * Pointer to store data. - * @param[in] len - * Length of data receive buffer. + * Initialization function for device driver. * * @return - * @li @ref SL_STATUS_OK Success. - * - * @li @ref SL_STATUS_FAIL Failure. - ******************************************************************************/ -sl_status_t i2c_read_blocking(sl_i2cspm_t *i2c_instance, - uint8_t *dest, - uint32_t len); + * If all operations completed sucessfully SL_STATUS_OK is returned. On + * failure a different status code is returned specifying the error. + *****************************************************************************/ +sl_status_t oled_display_init(void); + +const oled_display_t *oled_display_get(void); + +#ifdef __cplusplus +} +#endif -#endif /* SPARKFUN_SGP40_I2C_H_ */ +#endif diff --git a/driver/public/silabs/epaper_ext3_1/src/epaper_display.c b/driver/public/silabs/epaper_ext3_1/src/epaper_display.c new file mode 100644 index 00000000..fa865639 --- /dev/null +++ b/driver/public/silabs/epaper_ext3_1/src/epaper_display.c @@ -0,0 +1,282 @@ +/***************************************************************************//** + * @file epaper_display.c + * @brief E-Paper Display Header File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include + +#include "sl_sleeptimer.h" + +#include "epaper_display.h" +#include "epaper_display_config.h" + +static struct epd epd; + +// Internal variables +static uint32_t image_data_size = 0; +static uint8_t otp_data[128]; + +// SPI transfer protocol for index and data transmit to COG +static void send_index_data(uint8_t index, uint8_t *data, uint32_t len); +static void send_command_data(uint8_t index, uint8_t data); + +// 2 format to perform soft reset +static void soft_start_format1(uint8_t offset, uint8_t iREPEAT); +static void soft_start_format2(uint8_t offset, uint8_t iREPEAT); + +void epd_init() +{ + // Actually for 1 color, BWR requires 2 pages. + image_data_size = (uint32_t)EPD_VERTICAL * (uint32_t)(EPD_HORIZONTAL / 8); + + epd_driver_init(&epd); +} + +void cog_initial(uint8_t *image1, uint8_t *image2) +{ + uint8_t tmp[2] = {}; + + cog_power_on(); + + epd.drv->sspi_init(); + cog_get_data_otp(); + + epd.drv->spi_init(); + + tmp[0] = otp_data[0x10]; + tmp[1] = 0x00; + send_index_data(0x01, tmp, 2); + + cog_send_image(image1, image2); + + send_command_data(0x05, 0x7d); + sl_sleeptimer_delay_millisecond(50); + send_command_data(0x05, 0x00); + sl_sleeptimer_delay_millisecond(1); + + send_command_data(0xd8, otp_data[0x1c]); // MS_SYNC + send_command_data(0xd6, otp_data[0x1d]); // BVSS + + send_command_data(0xa7, 0x10); + sl_sleeptimer_delay_millisecond(2); + send_command_data(0xa7, 0x00); + sl_sleeptimer_delay_millisecond(10); + + send_command_data(0x44, 0x00); + send_command_data(0x45, 0x80); + + send_command_data(0xa7, 0x10); + sl_sleeptimer_delay_millisecond(2); + send_command_data(0xa7, 0x00); + sl_sleeptimer_delay_millisecond(10); + + send_command_data(0x44, 0x06); + + // check temperature, use normal mode + // uint8_t indexTemperature = u_temperature * 2 + 0x50; + send_command_data(0x45, 0x28); + + send_command_data(0xa7, 0x10); + sl_sleeptimer_delay_millisecond(2); + send_command_data(0xa7, 0x00); + sl_sleeptimer_delay_millisecond(10); + + send_command_data(0x60, otp_data[0x0b]); // TCON + send_command_data(0x61, otp_data[0x1b]); // STV_DIR + send_command_data(0x02, otp_data[0x11]); // VCOM + + cog_soft_start(); + + cog_display_refresh(); + + cog_power_off(); +} + +void cog_power_on() +{ + epd.drv->set_reset_pin(false); + sl_sleeptimer_delay_millisecond(2); + + epd.drv->set_reset_pin(true); + sl_sleeptimer_delay_millisecond(4); + + epd.drv->set_reset_pin(false); + sl_sleeptimer_delay_millisecond(20); +} + +void cog_power_off() +{ + while (epd.drv->get_busy_pin()) { + // wait busy high + } + + send_command_data(0x09, 0x7b); + send_command_data(0x05, 0x5d); + send_command_data(0x09, 0x7a); + sl_sleeptimer_delay_millisecond(15); + send_command_data(0x09, 0x00); + + while (epd.drv->get_busy_pin()) { + // wait busy high + } + +// GPIO_PinOutClear(EPD_BUSY_PORT, EPD_BUSY_PIN); +// GPIO_PinOutClear(EPD_DC_PORT, EPD_DC_PIN); +// GPIO_PinOutClear(SPI_EPD_CS_PORT, SPI_EPD_CS_PIN); +// GPIO_PinOutClear(EPD_RST_PORT, EPD_RST_PIN); +} + +void cog_get_data_otp(void) +{ + uint8_t cmd = 0xb9; + + epd.drv->sspi_init(); + + epd.drv->sspi_command_read(&epd, + &cmd, 1, + otp_data, 128); +} + +void cog_send_image(uint8_t *dram1, uint8_t *dram2) +{ + send_index_data(0x13, &otp_data[0x15], 6); // DUW + send_index_data(0x90, &otp_data[0x0C], 4); // DRFW + send_index_data(0x12, &otp_data[0x12], 3); // RAM_RW + + // first frame + send_index_data(0x10, dram1, image_data_size); // First frame + + send_index_data(0x12, &otp_data[0x12], 3); // RAM_RW + + // second frame + send_index_data(0x11, dram2, image_data_size); // Second frame +} + +void cog_soft_start() +{ + // Application note § 3.3 DC/DC soft-start + uint8_t offsetFrame = 0x28; + + for (uint8_t stage = 0; stage < 4; stage++) { + uint8_t offset = offsetFrame + 0x08 * stage; + + uint8_t REPEAT = otp_data[offset]; + uint8_t iREPEAT = otp_data[offset] & 0x7f; + + if ((REPEAT & 0x80) == 0) { + soft_start_format1(offset, iREPEAT); + } else { + soft_start_format2(offset, iREPEAT); + } + } +} + +// EPD Screen refresh function +void cog_display_refresh() +{ + while (epd.drv->get_busy_pin()) { + sl_sleeptimer_delay_millisecond(32); + } + send_command_data(0x15, 0x3c); +} + +// Implements SPI transfer of index and data +static void send_index_data(uint8_t index, uint8_t *data, uint32_t len) +{ + epd.drv->spi_command_write(&epd, index, data, len); +} + +static void send_command_data(uint8_t index, uint8_t data) +{ + epd.drv->spi_command_write(&epd, index, &data, 1); +} + +static void soft_start_format1(uint8_t offset, uint8_t iREPEAT) +{ + uint8_t BST_SW_a = otp_data[offset + 1]; + uint8_t BST_SW_b = otp_data[offset + 2]; + uint8_t DELAY_a_SCALE = otp_data[offset + 3] & 0x80; + uint8_t DELAY_a_VALUE = otp_data[offset + 3] & 0x7f; + uint8_t DELAY_b_SCALE = otp_data[offset + 4] & 0x80; + uint8_t DELAY_b_VALUE = otp_data[offset + 4] & 0x7f; + + for (uint8_t i = 0; i < iREPEAT; i++) { + send_command_data(0x09, BST_SW_a); + + if (DELAY_a_SCALE > 0) { + sl_sleeptimer_delay_millisecond(DELAY_a_VALUE); + } else { + epd.drv->delay_10us(DELAY_a_VALUE); + } + + send_command_data(0x09, BST_SW_b); + + if (DELAY_b_SCALE > 0) { + sl_sleeptimer_delay_millisecond(DELAY_b_VALUE); + } else { + epd.drv->delay_10us(DELAY_b_VALUE); + } + } +} + +static void soft_start_format2(uint8_t offset, uint8_t iREPEAT) +{ + uint8_t reg51[2]; + uint8_t iPHL_INI = otp_data[offset + 1]; // PHL_INI + uint8_t iPHH_INI = otp_data[offset + 2]; // PHH_INI + uint8_t PHL_VAR = otp_data[offset + 3]; + uint8_t PHH_VAR = otp_data[offset + 4]; + uint8_t BST_SW_a = otp_data[offset + 5]; + uint8_t BST_SW_b = otp_data[offset + 6]; + uint8_t DELAY_SCALE = otp_data[offset + 7] & 0x80; + uint8_t DELAY_VALUE = otp_data[offset + 7] & 0x7f; + + for (uint8_t i = 0; i < iREPEAT; i++) { + send_command_data(0x09, BST_SW_a); + + reg51[0] = iPHL_INI + PHL_VAR; + reg51[1] = iPHH_INI + PHH_VAR; + send_index_data(0x51, reg51, 2); + + send_command_data(0x09, BST_SW_b); + + if (DELAY_SCALE > 0) { + sl_sleeptimer_delay_millisecond(DELAY_VALUE); // ms + } else { + epd.drv->delay_10us(DELAY_VALUE); // 10 us + } + } +} diff --git a/driver/public/silabs/epaper_ext3_1/src/epaper_display_gecko.c b/driver/public/silabs/epaper_ext3_1/src/epaper_display_gecko.c new file mode 100644 index 00000000..99c23283 --- /dev/null +++ b/driver/public/silabs/epaper_ext3_1/src/epaper_display_gecko.c @@ -0,0 +1,259 @@ +/***************************************************************************//** + * @file epaper_display.c + * @brief E-Paper Display Header File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include + +#include "epaper_display.h" +#include "epaper_display_config.h" + +#include "spidrv.h" +#include "em_gpio.h" + +#include "sl_sleeptimer.h" +#include "sl_udelay.h" + +#define DELAY_10US_COUNTER 46 // Delay count + +static SPIDRV_HandleData_t spi_epd_handle_data; +static SPIDRV_Handle_t spi_epd_handle = &spi_epd_handle_data; + +static SPIDRV_Init_t spi_epd_init = { + .port = SPI_EPD_PERIPHERAL, + .portTx = SPI_EPD_TX_PORT, + .portRx = SPI_EPD_RX_PORT, + .portClk = SPI_EPD_CLK_PORT, + .portCs = SPI_EPD_CS_PORT, + .pinTx = SPI_EPD_TX_PIN, + .pinRx = SPI_EPD_RX_PIN, + .pinClk = SPI_EPD_CLK_PIN, + .pinCs = SPI_EPD_CS_PIN, + .bitRate = SPI_EPD_BITRATE, + .frameLength = SPI_EPD_FRAME_LENGTH, + .dummyTxValue = 0, + .type = SPI_EPD_TYPE, + .bitOrder = SPI_EPD_BIT_ORDER, + .clockMode = SPI_EPD_CLOCK_MODE, + .csControl = SPI_EPD_CS_CONTROL, + .slaveStartMode = SPI_EPD_SLAVE_START_MODE, +}; + +static void sspi_init(void); +static void spi_init(void); + +static void set_reset_pin(bool active); +static bool get_busy_pin(void); + +static void delay_10us(uint32_t idelay); + +static sl_status_t sspi_command_read(struct epd *epd, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len); +static sl_status_t spi_command_write(struct epd *epd, + uint8_t cmd, + const uint8_t *data, size_t len); + +static const struct epd_driver epd_driver = { + .sspi_init = sspi_init, + .spi_init = spi_init, + .set_reset_pin = set_reset_pin, + .get_busy_pin = get_busy_pin, + .delay_10us = delay_10us, + .sspi_command_read = sspi_command_read, + .spi_command_write = spi_command_write, +}; + +static void sspi_init(void) +{ + GPIO_PinModeSet(SPI_EPD_CLK_PORT, + SPI_EPD_CLK_PIN, + gpioModePushPull, 0); + GPIO_PinModeSet(SPI_EPD_TX_PORT, + SPI_EPD_TX_PIN, + gpioModePushPull, 0); +} + +static void spi_init(void) +{ + GPIO_PinModeSet(SPI_EPD_CLK_PORT, + SPI_EPD_CLK_PIN, + gpioModePushPull, 0); + GPIO_PinModeSet(SPI_EPD_TX_PORT, + SPI_EPD_TX_PIN, + gpioModePushPull, 0); + + GPIO_PinModeSet(SPI_EPD_RX_PORT, + SPI_EPD_RX_PIN, + gpioModeInput, 0); + // Init SPI + SPIDRV_Init(spi_epd_handle, &spi_epd_init); + sl_sleeptimer_delay_millisecond(100); +} + +static void set_reset_pin(bool active) +{ + if (active) { + GPIO_PinOutClear(EPD_RST_PORT, EPD_RST_PIN); + } else { + GPIO_PinOutSet(EPD_RST_PORT, EPD_RST_PIN); + } +} + +static bool get_busy_pin(void) +{ + return (GPIO_PinInGet(EPD_BUSY_PORT, EPD_BUSY_PIN) == 0); +} + +static void delay_10us(uint32_t idelay) +{ + sl_udelay_wait(10 * idelay); +} + +static uint8_t sspi_read(void) +{ + uint8_t value = 0; + + GPIO_PinModeSet(SPI_EPD_TX_PORT, + SPI_EPD_TX_PIN, + gpioModeInput, 0); + + for (uint8_t i = 0; i < 8; i++) { + GPIO_PinOutSet(SPI_EPD_CLK_PORT, + SPI_EPD_CLK_PIN); + sl_udelay_wait(10); + value |= GPIO_PinInGet(SPI_EPD_TX_PORT, + SPI_EPD_TX_PIN) << (7 - i); + GPIO_PinOutClear(SPI_EPD_CLK_PORT, + SPI_EPD_CLK_PIN); + sl_udelay_wait(10); + } + + return value; +} + +static void sspi_write(uint8_t value) +{ + GPIO_PinModeSet(SPI_EPD_TX_PORT, + SPI_EPD_TX_PIN, + gpioModePushPull, 0); + + for (uint8_t i = 0; i < 8; i++) { + if (!(value & (1 << (7 - i)))) { + GPIO_PinOutClear(SPI_EPD_TX_PORT, + SPI_EPD_TX_PIN); + } else { + GPIO_PinOutSet(SPI_EPD_TX_PORT, + SPI_EPD_TX_PIN); + } + sl_udelay_wait(10); + + GPIO_PinOutSet(SPI_EPD_CLK_PORT, + SPI_EPD_CLK_PIN); + sl_udelay_wait(10); + GPIO_PinOutClear(SPI_EPD_CLK_PORT, + SPI_EPD_CLK_PIN); + sl_udelay_wait(10); + } +} + +static sl_status_t sspi_command_read(struct epd *epd, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len) +{ + (void) epd; + + GPIO_PinOutClear(EPD_DC_PORT, EPD_DC_PIN); + GPIO_PinOutClear(SPI_EPD_CS_PORT, SPI_EPD_CS_PIN); + + while (num_cmds--) { + sspi_write(*cmds++); + } + sl_sleeptimer_delay_millisecond(5); + + // Start OTP reading + GPIO_PinOutSet(EPD_DC_PORT, EPD_DC_PIN); + sspi_read(); // Dummy + while (len--) { + *response++ = sspi_read(); + } + + // End of OTP reading + GPIO_PinOutSet(SPI_EPD_CS_PORT, SPI_EPD_CS_PIN); + + return SL_STATUS_OK; +} + +static sl_status_t spi_command_write(struct epd *epd, + uint8_t cmd, + const uint8_t *data, size_t len) +{ + (void) epd; + + GPIO_PinOutClear(EPD_DC_PORT, EPD_DC_PIN); + GPIO_PinOutClear(SPI_EPD_CS_PORT, SPI_EPD_CS_PIN); + + SPIDRV_MTransmitB(spi_epd_handle, &cmd, 1); + + GPIO_PinOutSet(EPD_DC_PORT, EPD_DC_PIN); + + while (len) { + if (len < DMADRV_MAX_XFER_COUNT) { + SPIDRV_MTransmitB(spi_epd_handle, data, len); + len = 0; + } else { + SPIDRV_MTransmitB(spi_epd_handle, data, DMADRV_MAX_XFER_COUNT); + len -= DMADRV_MAX_XFER_COUNT; + data += DMADRV_MAX_XFER_COUNT; + } + } + + GPIO_PinOutSet(SPI_EPD_CS_PORT, SPI_EPD_CS_PIN); + + return SL_STATUS_OK; +} + +void epd_driver_init(struct epd *epd) +{ + epd->drv = &epd_driver; + + // Config pin + GPIO_PinModeSet(EPD_BUSY_PORT, EPD_BUSY_PIN, gpioModeInput, 0); + + GPIO_PinModeSet(EPD_DC_PORT, EPD_DC_PIN, gpioModePushPull, 1); + GPIO_PinModeSet(EPD_RST_PORT, EPD_RST_PIN, gpioModePushPull, 1); + GPIO_PinModeSet(SPI_EPD_CS_PORT, SPI_EPD_CS_PIN, gpioModePushPull, 1); +} diff --git a/driver/public/silabs/epaper_ext3_1/src/epaper_display_si91x.c b/driver/public/silabs/epaper_ext3_1/src/epaper_display_si91x.c new file mode 100644 index 00000000..6f8f3b17 --- /dev/null +++ b/driver/public/silabs/epaper_ext3_1/src/epaper_display_si91x.c @@ -0,0 +1,450 @@ +/***************************************************************************//** + * @file epaper_display.c + * @brief E-Paper Display Header File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#include +#include "sl_si91x_clock_manager.h" +#include "sl_si91x_peripheral_gpio.h" +#include "rsi_egpio.h" +#include "sl_si91x_gspi.h" + +#include "epaper_display.h" +#include "epaper_display_config.h" + +#include "sl_sleeptimer.h" + +#define DELAY_10US_COUNTER 46 // Delay count + +#define SOC_PLL_CLK \ + ((uint32_t) (180000000L)) // 180MHz default SoC PLL Clock + // as source to Processor +#define INTF_PLL_CLK \ + ((uint32_t) (180000000L)) // 180MHz default Interface PLL Clock + // as source to all peripherals + +#define GSPI_BUFFER_SIZE 1024 // Size of buffer +#define GSPI_INTF_PLL_CLK 180000000 // Intf pll clock frequency +#define GSPI_INTF_PLL_REF_CLK 40000000 // Intf pll reference clock frequency +#define GSPI_SOC_PLL_CLK 20000000 // Soc pll clock frequency +#define GSPI_SOC_PLL_REF_CLK 40000000 // Soc pll reference clock frequency +#define GSPI_INTF_PLL_500_CTRL_VALUE 0xD900 // Intf pll control value +#define GSPI_SOC_PLL_MM_COUNT_LIMIT 0xA4 // Soc pll count limit +#define GSPI_DVISION_FACTOR 0 // Division factor +#define GSPI_SWAP_READ_DATA 1 // true to enable and false to disable swap read +#define GSPI_SWAP_WRITE_DATA 0 // true to enable and false to disable swap write +#define GSPI_BITRATE 10000000 // Bitrate for setting the clock division factor +#define GSPI_BIT_WIDTH 8 // Default Bit width +#define GSPI_MAX_BIT_WIDTH 16 // Maximum Bit width + +static sl_gspi_handle_t spi_epd_handle = NULL; + +// read/write for OTP +static uint8_t sspi_read(); +static void sspi_write(uint8_t value); + +static void event_callback(uint32_t event); + +static void sspi_init(void); +static void spi_init(void); + +static void set_reset_pin(bool active); +static bool get_busy_pin(void); + +static void delay_10us(uint32_t idelay); + +static sl_status_t sspi_command_read(struct epd *epd, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len); +static sl_status_t spi_command_write(struct epd *epd, + uint8_t cmd, + const uint8_t *data, size_t len); + +static const struct epd_driver epd_driver = { + .sspi_init = sspi_init, + .spi_init = spi_init, + .set_reset_pin = set_reset_pin, + .get_busy_pin = get_busy_pin, + .delay_10us = delay_10us, + .sspi_command_read = sspi_command_read, + .spi_command_write = spi_command_write, +}; + +#define wait_spi_transfer_ready(handle) \ + do { \ + sl_gspi_status_t gspi_status; \ + do { \ + gspi_status = sl_si91x_gspi_get_status(handle); \ + } while (gspi_status.busy); \ + } while (0) + +#define si91x_get_port(num) ((num) / 16) +#define si91x_get_pin(num) ((num) % 16) +#define si91x_get_gpio_num(port, pin) (((port) * 16) + pin) + +static inline uint8_t si91x_gpio_get_pad(uint16_t gpio_num) +{ + if ((gpio_num >= 6) && (gpio_num <= 12)) { + return gpio_num - 5; + } else if (gpio_num == 15) { + return 8; + } else if ((gpio_num == 31) + || (gpio_num == 32) + || (gpio_num == 33) + || (gpio_num == 34)) { + return 9; + } else if ((gpio_num >= 46) && (gpio_num <= 57)) { + return gpio_num - 36; + } else { + return 0; + } +} + +static inline sl_status_t si91x_gpio_setup(uint16_t gpio_num, + sl_gpio_mode_t mode, + sl_si91x_gpio_direction_t direction, + uint32_t output_value) +{ + sl_gpio_port_t port = si91x_get_port(gpio_num); + uint8_t pin = si91x_get_pin(gpio_num); + + if (!SL_GPIO_VALIDATE_PORT(port)) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (port == SL_ULP_GPIO_PORT) { + if (!SL_GPIO_VALIDATE_ULP_PORT_PIN(port, pin)) { + return SL_STATUS_INVALID_PARAMETER; + } + } else { + if (!SL_GPIO_NDEBUG_PORT_PIN(port, pin)) { + return SL_STATUS_INVALID_PARAMETER; + } + } + + if (port == SL_ULP_GPIO_PORT) { + sl_si91x_gpio_enable_clock(ULPCLK_GPIO); + sl_si91x_gpio_enable_ulp_pad_receiver(pin); + } else { + sl_si91x_gpio_enable_clock(M4CLK_GPIO); + sl_si91x_gpio_enable_pad_receiver(gpio_num); + uint8_t pad = si91x_gpio_get_pad(gpio_num); + if (pad) { + sl_si91x_gpio_enable_pad_selection(pad); + } + } + + sl_gpio_set_pin_mode(port, pin, mode, output_value); + sl_si91x_gpio_set_pin_direction(port, pin, direction); + return SL_STATUS_OK; +} + +/******************************************************************************* + * default_clock_configuration + ******************************************************************************/ +static void default_clock_configuration(void) +{ + // Core Clock runs at 180MHz SOC PLL Clock + sl_si91x_clock_manager_m4_set_core_clk(M4_SOCPLLCLK, SOC_PLL_CLK); + + // All peripherals' source to be set to Interface PLL Clock + // and it runs at 180MHz + sl_si91x_clock_manager_set_pll_freq(INFT_PLL, + INTF_PLL_CLK, + PLL_REF_CLK_VAL_XTAL); +} + +static sl_status_t spi_config(void) +{ + sl_status_t status; + sl_gspi_clock_config_t clock_config = { + .soc_pll_mm_count_value = GSPI_SOC_PLL_MM_COUNT_LIMIT, + .intf_pll_500_control_value = GSPI_INTF_PLL_500_CTRL_VALUE, + .intf_pll_clock = GSPI_INTF_PLL_CLK, + .intf_pll_reference_clock = GSPI_INTF_PLL_REF_CLK, + .soc_pll_clock = GSPI_SOC_PLL_CLK, + .soc_pll_reference_clock = GSPI_SOC_PLL_REF_CLK, + .division_factor = GSPI_DVISION_FACTOR + }; + sl_gspi_control_config_t control_config = { + .bit_width = GSPI_BIT_WIDTH, + .bitrate = GSPI_BITRATE, + .clock_mode = SL_GSPI_MODE_0, + .slave_select_mode = SL_GSPI_MASTER_HW_OUTPUT, + .swap_read = GSPI_SWAP_READ_DATA, + .swap_write = GSPI_SWAP_WRITE_DATA, + }; + + default_clock_configuration(); + +// gspi_configuration = control_config; + // Configuration of clock with the default clock parameters + status = sl_si91x_gspi_configure_clock(&clock_config); + if (status != SL_STATUS_OK) { + return status; + } + // Pass the address of void pointer, it will be updated with the address + // of GSPI instance which can be used in other APIs. + status = sl_si91x_gspi_init(SL_GSPI_MASTER, &spi_epd_handle); + if (status != SL_STATUS_OK) { + return status; + } + + // Fetching the status of GSPI i.e., busy, data lost and mode fault + // Configuration of all other parameters that are required by GSPI + // gspi_configuration structure is from sl_si91x_gspi_init.h file. + // The user can modify this structure with the configuration of + // his choice by filling this structure. + status = sl_si91x_gspi_set_configuration(spi_epd_handle, + &control_config); + if (status != SL_STATUS_OK) { + return status; + } + + // Register user callback function + status = sl_si91x_gspi_register_event_callback(spi_epd_handle, + event_callback); + if (status != SL_STATUS_OK) { + return status; + } + + // Validation for executing the API only once + status = sl_si91x_gspi_set_slave_number(GSPI_SLAVE_0); + if (status != SL_STATUS_OK) { + return status; + } + return SL_STATUS_OK; +} + +static void sspi_init(void) +{ + si91x_gpio_setup(RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 0); + si91x_gpio_setup(RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 0); +} + +static void spi_init(void) +{ + spi_config(); +} + +static uint8_t sspi_read(void) +{ + uint8_t value = 0; + + si91x_gpio_setup(RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 0); + si91x_gpio_setup(RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_0, + GPIO_INPUT, + 0); + + for (uint8_t i = 0; i < 8; i++) { + sl_gpio_set_pin_output(si91x_get_port(RTE_GSPI_MASTER_CLK_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CLK_PIN)); + delay_10us(1); + value |= (sl_gpio_get_pin_input( + si91x_get_port(RTE_GSPI_MASTER_MOSI_PIN), + si91x_get_pin(RTE_GSPI_MASTER_MOSI_PIN)) ? 1 : 0) << (7 - i); + sl_gpio_clear_pin_output(si91x_get_port(RTE_GSPI_MASTER_CLK_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CLK_PIN)); + delay_10us(1); + } + + return value; +} + +static void sspi_write(uint8_t value) +{ + si91x_gpio_setup(RTE_GSPI_MASTER_CLK_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 0); + si91x_gpio_setup(RTE_GSPI_MASTER_MOSI_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 0); + + for (uint8_t i = 0; i < 8; i++) { + if (!(value & (1 << (7 - i)))) { + sl_gpio_clear_pin_output(si91x_get_port(RTE_GSPI_MASTER_MOSI_PIN), + si91x_get_pin(RTE_GSPI_MASTER_MOSI_PIN)); + } else { + sl_gpio_set_pin_output(si91x_get_port(RTE_GSPI_MASTER_MOSI_PIN), + si91x_get_pin(RTE_GSPI_MASTER_MOSI_PIN)); + } + delay_10us(1); + + sl_gpio_set_pin_output(si91x_get_port(RTE_GSPI_MASTER_CLK_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CLK_PIN)); + delay_10us(1); + sl_gpio_clear_pin_output(si91x_get_port(RTE_GSPI_MASTER_CLK_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CLK_PIN)); + delay_10us(1); + } +} + +static void set_reset_pin(bool active) +{ + if (active) { + sl_gpio_clear_pin_output(si91x_get_port(EPD_RST_PIN), + si91x_get_pin(EPD_RST_PIN)); + } else { + sl_gpio_set_pin_output(si91x_get_port(EPD_RST_PIN), + si91x_get_pin(EPD_RST_PIN)); + } +} + +static bool get_busy_pin(void) +{ + return (sl_gpio_get_pin_input(si91x_get_port(EPD_BUSY_PIN), + si91x_get_pin(EPD_BUSY_PIN)) == 0); +} + +static void delay_10us(uint32_t idelay) +{ + for (uint32_t x = 0; x < DELAY_10US_COUNTER * idelay; x++) { + __NOP(); + } +} + +static sl_status_t sspi_command_read(struct epd *epd, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len) +{ + (void) epd; + + sl_gpio_clear_pin_output(si91x_get_port(EPD_DC_PIN), + si91x_get_pin(EPD_DC_PIN)); + sl_gpio_clear_pin_output(si91x_get_port(RTE_GSPI_MASTER_CS0_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CS0_PIN)); + + while (num_cmds--) { + sspi_write(*cmds++); + } + sl_sleeptimer_delay_millisecond(5); + + // Start OTP reading + sl_gpio_set_pin_output(si91x_get_port(EPD_DC_PIN), + si91x_get_pin(EPD_DC_PIN)); + sspi_read(); // Dummy + while (len--) { + *response++ = sspi_read(); + } + + // End of OTP reading + sl_gpio_set_pin_output(si91x_get_port(RTE_GSPI_MASTER_CS0_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CS0_PIN)); + + return SL_STATUS_OK; +} + +static sl_status_t spi_command_write(struct epd *epd, + uint8_t cmd, + const uint8_t *data, size_t len) +{ + (void) epd; + sl_status_t status; + + sl_gpio_clear_pin_output(si91x_get_port(EPD_DC_PIN), + si91x_get_pin(EPD_DC_PIN)); + sl_gpio_clear_pin_output(si91x_get_port(RTE_GSPI_MASTER_CS0_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CS0_PIN)); + + status = sl_si91x_gspi_send_data(spi_epd_handle, &cmd, 1); + if (SL_STATUS_OK != status) { + return status; + } + + wait_spi_transfer_ready(spi_epd_handle); + + sl_gpio_set_pin_output(si91x_get_port(EPD_DC_PIN), + si91x_get_pin(EPD_DC_PIN)); + + status = sl_si91x_gspi_send_data(spi_epd_handle, data, len); + if (SL_STATUS_OK != status) { + return status; + } + + wait_spi_transfer_ready(spi_epd_handle); + + sl_gpio_set_pin_output(si91x_get_port(RTE_GSPI_MASTER_CS0_PIN), + si91x_get_pin(RTE_GSPI_MASTER_CS0_PIN)); + + return SL_STATUS_OK; +} + +static void event_callback(uint32_t event) +{ + switch (event) { + case SL_GSPI_TRANSFER_COMPLETE: + break; + case SL_GSPI_DATA_LOST: + break; + case SL_GSPI_MODE_FAULT: + break; + } +} + +void epd_driver_init(struct epd *epd) +{ + epd->drv = &epd_driver; + + // Config pin + si91x_gpio_setup(EPD_BUSY_PIN, + SL_GPIO_MODE_0, + GPIO_INPUT, + 0); + si91x_gpio_setup(EPD_DC_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 1); + si91x_gpio_setup(EPD_RST_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 1); + si91x_gpio_setup(RTE_GSPI_MASTER_CS0_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + 1); +} diff --git a/driver/public/silabs/epaper_ext3_1/src/oled_display.c b/driver/public/silabs/epaper_ext3_1/src/oled_display.c new file mode 100644 index 00000000..3da7ca6a --- /dev/null +++ b/driver/public/silabs/epaper_ext3_1/src/oled_display.c @@ -0,0 +1,129 @@ +/***************************************************************************//** + * @file oled_display.c + * @brief OLED Driver API interface + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ +#include +#include "oled_display.h" + +#include "epaper_display_config.h" +#include "epaper_display.h" + +/* This oled_frame_buffer is large enough to store one full frame. */ +static uint8_t oled_frame_buffer[(EPD_VERTICAL * EPD_HORIZONTAL) / 8]; +const uint8_t buffer0[(EPD_VERTICAL * EPD_HORIZONTAL) / 8] = {}; + +static sl_status_t driver_init(void); +static sl_status_t draw_pixel(int16_t x, int16_t y, uint16_t color); +static uint16_t get_raw_pixel(int16_t x, int16_t y); +static sl_status_t fill_screen(uint16_t color); +static sl_status_t update_display(void); + +static oled_display_t oled_display_instance; +static const oled_display_driver_api_t sl_memlcd_driver_api = +{ + .init = driver_init, + .draw_pixel = draw_pixel, + .get_raw_pixel = get_raw_pixel, + .fill_screen = fill_screen, + .update_display = update_display, + .enable_display = NULL, + .set_invert_color = NULL, + .set_normal_color = NULL, + .set_contrast = NULL, + .scroll_right = NULL, + .scroll_left = NULL, + .scroll_diag_right = NULL, + .scroll_diag_left = NULL, + .stop_scroll = NULL, +}; + +/** Flag to monitor is this driver has been initialized. The + * oled_display_instance + * is only valid after initialized=true. */ +static bool initialized = false; + +sl_status_t oled_display_init(void) +{ + oled_display_instance.width = EPD_VERTICAL; + oled_display_instance.height = EPD_HORIZONTAL; + oled_display_instance.driver = &sl_memlcd_driver_api; + initialized = true; + return SL_STATUS_OK; +} + +static sl_status_t draw_pixel(int16_t x, int16_t y, uint16_t color) +{ + uint16_t i = x / 8 + y * EPD_VERTICAL / 8; + if (color) { + oled_frame_buffer[i] |= 1 << (7 - (x % 8)); + } else { + oled_frame_buffer[i] &= ~(1 << (7 - (x % 8))); + } + return SL_STATUS_OK; +} + +static uint16_t get_raw_pixel(int16_t x, int16_t y) +{ + return (oled_frame_buffer[x / 8 + y * EPD_VERTICAL / 8] + & (1 << (x % 8))) == 0 ? 0x0000 : 0xffff; +} + +static sl_status_t fill_screen(uint16_t color) +{ + /* Fill the display with the background color of the glib_context_t */ + for (uint16_t i = 0; i < sizeof(oled_frame_buffer); i++) { + oled_frame_buffer[i] = color == 0 ? 0x00 : 0xFF; + } + return SL_STATUS_OK; +} + +static sl_status_t update_display(void) +{ + cog_initial(oled_frame_buffer, (uint8_t *)buffer0); + return SL_STATUS_OK; +} + +const oled_display_t *oled_display_get(void) +{ + if (initialized) { + return &oled_display_instance; + } else { + return NULL; + } +} + +static sl_status_t driver_init(void) +{ + epd_init(); + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/fatfs_sdc_spi_platform/inc/sl_sdc_platform_spi.h b/driver/public/silabs/fatfs_sdc_spi_platform/inc/sl_sdc_platform_spi.h index df6b602a..27f57d16 100644 --- a/driver/public/silabs/fatfs_sdc_spi_platform/inc/sl_sdc_platform_spi.h +++ b/driver/public/silabs/fatfs_sdc_spi_platform/inc/sl_sdc_platform_spi.h @@ -36,7 +36,7 @@ #define SL_SDC_PLATFORM_SPI_H #include "sl_status.h" -#include "spidrv.h" +#include "drv_spi_master.h" #ifdef __cplusplus extern "C" { @@ -52,7 +52,7 @@ extern "C" { * @return * @ref SL_STATUS_OK on success or @ref SL_STATUS_TRANSMIT on failure ******************************************************************************/ -sl_status_t sdc_xchg_spi(SPIDRV_Handle_t spi_handle, uint8_t tx, uint8_t *rx); +sl_status_t sdc_xchg_spi(spi_master_t *spi_handle, uint8_t tx, uint8_t *rx); /***************************************************************************//** * @brief @@ -67,7 +67,7 @@ sl_status_t sdc_xchg_spi(SPIDRV_Handle_t spi_handle, uint8_t tx, uint8_t *rx); * @return * @ref SL_STATUS_OK on success or @ref SL_STATUS_TRANSMIT on failure ******************************************************************************/ -sl_status_t sdc_xmit_spi_multi(SPIDRV_Handle_t spi_handle, +sl_status_t sdc_xmit_spi_multi(spi_master_t *spi_handle, const uint8_t *buff, uint16_t cnt); @@ -84,11 +84,11 @@ sl_status_t sdc_xmit_spi_multi(SPIDRV_Handle_t spi_handle, * @return * @ref SL_STATUS_OK on success or @ref SL_STATUS_TRANSMIT on failure ******************************************************************************/ -sl_status_t sdc_rcvr_spi_multi(SPIDRV_Handle_t spi_handle, +sl_status_t sdc_rcvr_spi_multi(spi_master_t *spi_handle, uint8_t *buff, uint16_t cnt); -sl_status_t sdc_platform_set_bit_rate(SPIDRV_Handle_t spi_handle, +sl_status_t sdc_platform_set_bit_rate(spi_master_t *spi_handle, uint32_t bit_rate); #ifdef __cplusplus diff --git a/driver/public/silabs/fatfs_sdc_spi_platform/src/sl_sdc_platform_spi.c b/driver/public/silabs/fatfs_sdc_spi_platform/src/sl_sdc_platform_spi.c index 0c1ca37b..3dfcc726 100644 --- a/driver/public/silabs/fatfs_sdc_spi_platform/src/sl_sdc_platform_spi.c +++ b/driver/public/silabs/fatfs_sdc_spi_platform/src/sl_sdc_platform_spi.c @@ -37,75 +37,65 @@ /***************************************************************************//** * Exchange a byte. ******************************************************************************/ -sl_status_t sdc_xchg_spi(SPIDRV_Handle_t spi_handle, uint8_t tx, uint8_t *rx) +sl_status_t sdc_xchg_spi(spi_master_t *spi_handle, uint8_t tx, uint8_t *rx) { - sl_status_t retval; - if (!spi_handle) { return SL_STATUS_INVALID_PARAMETER; } - retval = SPIDRV_MTransferB(spi_handle, &tx, rx, 1); - if (retval != ECODE_EMDRV_SPIDRV_OK) { + if (SPI_MASTER_SUCCESS != spi_master_exchange(spi_handle, &tx, rx, 1)) { *rx = 0; - return SL_STATUS_TRANSMIT; + return SPI_MASTER_ERROR; } - return SL_STATUS_OK; + return SPI_MASTER_SUCCESS; } /***************************************************************************//** * Multi-byte SPI transaction (transmit). ******************************************************************************/ -sl_status_t sdc_xmit_spi_multi(SPIDRV_Handle_t spi_handle, +sl_status_t sdc_xmit_spi_multi(spi_master_t *spi_handle, const uint8_t *buff, uint16_t cnt) { - sl_status_t retval; - if (!spi_handle) { return SL_STATUS_INVALID_PARAMETER; } - retval = SPIDRV_MTransmitB(spi_handle, buff, cnt); - if (retval != ECODE_EMDRV_SPIDRV_OK) { - return SL_STATUS_TRANSMIT; + if (SPI_MASTER_SUCCESS != spi_master_write(spi_handle, + (uint8_t *)buff, + cnt)) { + return SPI_MASTER_ERROR; } - return SL_STATUS_OK; + return SPI_MASTER_SUCCESS; } /***************************************************************************//** * Multi-byte SPI transaction (receive). ******************************************************************************/ -sl_status_t sdc_rcvr_spi_multi(SPIDRV_Handle_t spi_handle, +sl_status_t sdc_rcvr_spi_multi(spi_master_t *spi_handle, uint8_t *buff, uint16_t cnt) { - sl_status_t retval; - uint8_t dummy = 0xff; - if (!spi_handle) { return SL_STATUS_INVALID_PARAMETER; } - retval = SPIDRV_MTransferB(spi_handle, &dummy, buff, cnt); - if (retval != ECODE_EMDRV_SPIDRV_OK) { - return SL_STATUS_TRANSMIT; + if (SPI_MASTER_SUCCESS != spi_master_read(spi_handle, + buff, + cnt)) { + return SPI_MASTER_ERROR; } - return SL_STATUS_OK; + return SPI_MASTER_SUCCESS; } -sl_status_t sdc_platform_set_bit_rate(SPIDRV_Handle_t spi_handle, +sl_status_t sdc_platform_set_bit_rate(spi_master_t *spi_handle, uint32_t bit_rate) { - sl_status_t retval; - if (!spi_handle) { return SL_STATUS_NULL_POINTER; } - retval = SPIDRV_SetBitrate(spi_handle, bit_rate); - - if (retval != ECODE_EMDRV_SPIDRV_OK) { + if (SPI_MASTER_SUCCESS != spi_master_set_speed(spi_handle, bit_rate)) { return SL_STATUS_TRANSMIT; } diff --git a/driver/public/silabs/fuel_gauge_max17048/config/brd4180a/maxim_max17048_config.h b/driver/public/silabs/fuel_gauge_max17048/config/brd4180a/maxim_max17048_config.h new file mode 100644 index 00000000..f5d7acee --- /dev/null +++ b/driver/public/silabs/fuel_gauge_max17048/config/brd4180a/maxim_max17048_config.h @@ -0,0 +1,112 @@ +/***************************************************************************//** +* @file max17048_config.h +* @brief MAX17048 Driver Configuration +******************************************************************************** +* # License +* Copyright 2022 Silicon Laboratories Inc. www.silabs.com +******************************************************************************** +* +* SPDX-License-Identifier: Zlib +* +* The licensor of this software is Silicon Laboratories Inc. +* +* This software is provided \'as-is\', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +* +******************************************************************************* +* # Evaluation Quality +* This code has been minimally tested to ensure that it builds and is suitable +* as a demonstration for evaluation purposes only. This code will be maintained +* at the sole discretion of Silicon Labs. +*******************************************************************************/ +#ifndef MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ +#define MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ + +#include "em_gpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MAX17048 I2C Configuration + +// MAX17048 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MAX17048_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MAX17048_I2C_SPEED_MODE 0 + +// I2C Address <0x1..0x7E:0x1> +// Default: 0x36 +#define MAX17048_I2C_ADDRESS 0x36 + +// +// + +// User-Settings + +// Stabilization delay (ms) +// Default: 0 +#define MAX17048_STABILIZATION_DELAY 0 + +// Rcomp update interval (ms) +// Default: 60000 +// The driver calculates and updates the RCOMP factor at a rate of +// 1000 ms <= MAX17048_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms +// and defaults to 1 minute (60000 ms = 1 minute). +#define MAX17048_RCOMP_UPDATE_INTERVAL_MS 60000 + +// Enable battery quick start +// Default: 1 +#define MAX17048_ENABLE_HW_QSTRT 1 + +// Enable power manager +// Default: 0 +#define MAX17048_ENABLE_POWER_MANAGER 0 + +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MAX17048_ALRT +// $[GPIO_MAX17048_ALRT] +#define MAX17048_ALRT_PORT gpioPortC +#define MAX17048_ALRT_PIN 0 +// [GPIO_MAX17048_ALRT]$ + +// MAX17048_ENABLE_QSTRT +// $[GPIO_MAX17048_ENABLE_QSTRT] +#define MAX17048_ENABLE_QSTRT_PORT gpioPortC +#define MAX17048_ENABLE_QSTRT_PIN 2 +// [GPIO_MAX17048_ENABLE_QSTRT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ */ diff --git a/app/example/sparkfun_distance_vl53l1x/brd2601b/sl_i2cspm_qwiic_config.h b/driver/public/silabs/fuel_gauge_max17048/config/brd4180a/sl_i2cspm_fuel_gauge_config.h similarity index 61% rename from app/example/sparkfun_distance_vl53l1x/brd2601b/sl_i2cspm_qwiic_config.h rename to driver/public/silabs/fuel_gauge_max17048/config/brd4180a/sl_i2cspm_fuel_gauge_config.h index aea9b367..e5711d10 100644 --- a/app/example/sparkfun_distance_vl53l1x/brd2601b/sl_i2cspm_qwiic_config.h +++ b/driver/public/silabs/fuel_gauge_max17048/config/brd4180a/sl_i2cspm_fuel_gauge_config.h @@ -15,43 +15,43 @@ * ******************************************************************************/ -#ifndef SL_I2CSPM_QWIIC_CONFIG_H -#define SL_I2CSPM_QWIIC_CONFIG_H +#ifndef SL_I2CSPM_FUEL_GAUGE_CONFIG_H +#define SL_I2CSPM_FUEL_GAUGE_CONFIG_H // <<< Use Configuration Wizard in Context Menu // I2CSPM settings -// Reference clock frequency +// Reference clock frequency // Frequency in Hz of the reference clock. // Select 0 to use the frequency of the currently selected clock. // Default: 0 -#define SL_I2CSPM_QWIIC_REFERENCE_CLOCK 0 +#define SL_I2CSPM_FUEL_GAUGE_REFERENCE_CLOCK 0 -// Speed mode +// Speed mode // <0=> Standard mode (100kbit/s) // <1=> Fast mode (400kbit/s) // <2=> Fast mode plus (1Mbit/s) // Default: 0 -#define SL_I2CSPM_QWIIC_SPEED_MODE 0 +#define SL_I2CSPM_FUEL_GAUGE_SPEED_MODE 0 // end I2CSPM config // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// SL_I2CSPM_QWIIC -// $[I2C_SL_I2CSPM_QWIIC] -#define SL_I2CSPM_QWIIC_PERIPHERAL I2C0 -#define SL_I2CSPM_QWIIC_PERIPHERAL_NO 0 - -// I2C0 SCL on PC04 -#define SL_I2CSPM_QWIIC_SCL_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_QWIIC_SDA_PORT gpioPortC -#define SL_I2CSPM_QWIIC_SDA_PIN 5 -// [I2C_SL_I2CSPM_QWIIC]$ +// SL_I2CSPM_FUEL_GAUGE +// $[I2C_SL_I2CSPM_FUEL_GAUGE] +#define SL_I2CSPM_FUEL_GAUGE_PERIPHERAL I2C0 +#define SL_I2CSPM_FUEL_GAUGE_PERIPHERAL_NO 0 + +// I2C0 SCL on PD02 +#define SL_I2CSPM_FUEL_GAUGE_SCL_PORT gpioPortD +#define SL_I2CSPM_FUEL_GAUGE_SCL_PIN 2 + +// I2C0 SDA on PD03 +#define SL_I2CSPM_FUEL_GAUGE_SDA_PORT gpioPortD +#define SL_I2CSPM_FUEL_GAUGE_SDA_PIN 3 +// [I2C_SL_I2CSPM_FUEL_GAUGE]$ // <<< sl:end pin_tool >>> -#endif // SL_I2CSPM_QWIIC_CONFIG_H +#endif // SL_I2CSPM_FUEL_GAUGE_CONFIG_H diff --git a/driver/public/silabs/fuel_gauge_max17048/config/brd4181b/maxim_max17048_config.h b/driver/public/silabs/fuel_gauge_max17048/config/brd4181b/maxim_max17048_config.h index fdb0e1f3..f5d7acee 100644 --- a/driver/public/silabs/fuel_gauge_max17048/config/brd4181b/maxim_max17048_config.h +++ b/driver/public/silabs/fuel_gauge_max17048/config/brd4181b/maxim_max17048_config.h @@ -35,50 +35,73 @@ #ifndef MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ #define MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> -// Connection + +// MAX17048 I2C Configuration + +// MAX17048 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MAX17048_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MAX17048_I2C_SPEED_MODE 0 + // I2C Address <0x1..0x7E:0x1> // Default: 0x36 -#define MAX17048_I2C_ADDRESS 0x36 +#define MAX17048_I2C_ADDRESS 0x36 + +// // // User-Settings -// Stabilization delay (ms) +// Stabilization delay (ms) // Default: 0 -#define MAX17048_CONFIG_STABILIZATION_DELAY 0 +#define MAX17048_STABILIZATION_DELAY 0 -// Rcomp update interval (ms) +// Rcomp update interval (ms) // Default: 60000 // The driver calculates and updates the RCOMP factor at a rate of -// 1000 ms <= MAX17048_CONFIG_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms +// 1000 ms <= MAX17048_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms // and defaults to 1 minute (60000 ms = 1 minute). -#define MAX17048_CONFIG_RCOMP_UPDATE_INTERVAL_MS 60000 +#define MAX17048_RCOMP_UPDATE_INTERVAL_MS 60000 -// Enable battery quick start +// Enable battery quick start // Default: 1 -#define MAX17048_CONFIG_ENABLE_HW_QSTRT 1 +#define MAX17048_ENABLE_HW_QSTRT 1 + +// Enable power manager +// Default: 0 +#define MAX17048_ENABLE_POWER_MANAGER 0 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// MAX17048_CONFIG_ALRT -// $[GPIO_MAX17048_CONFIG_ALRT] -#define MAX17048_CONFIG_ALRT_PORT gpioPortC -#define MAX17048_CONFIG_ALRT_PIN 1 -// [GPIO_MAX17048_CONFIG_ALRT]$ - -// MAX17048_CONFIG_ENABLE_QSTRT -// $[GPIO_MAX17048_CONFIG_ENABLE_QSTRT] -#define MAX17048_CONFIG_ENABLE_QSTRT_PORT gpioPortC -#define MAX17048_CONFIG_ENABLE_QSTRT_PIN 2 -// [GPIO_MAX17048_CONFIG_ENABLE_QSTRT]$ +// MAX17048_ALRT +// $[GPIO_MAX17048_ALRT] +#define MAX17048_ALRT_PORT gpioPortC +#define MAX17048_ALRT_PIN 0 +// [GPIO_MAX17048_ALRT]$ + +// MAX17048_ENABLE_QSTRT +// $[GPIO_MAX17048_ENABLE_QSTRT] +#define MAX17048_ENABLE_QSTRT_PORT gpioPortC +#define MAX17048_ENABLE_QSTRT_PIN 2 +// [GPIO_MAX17048_ENABLE_QSTRT]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/fuel_gauge_max17048/config/brd4338a/maxim_max17048_config.h b/driver/public/silabs/fuel_gauge_max17048/config/brd4338a/maxim_max17048_config.h new file mode 100644 index 00000000..97d75822 --- /dev/null +++ b/driver/public/silabs/fuel_gauge_max17048/config/brd4338a/maxim_max17048_config.h @@ -0,0 +1,110 @@ +/***************************************************************************//** +* @file max17048_config.h +* @brief MAX17048 Driver Configuration +******************************************************************************** +* # License +* Copyright 2022 Silicon Laboratories Inc. www.silabs.com +******************************************************************************** +* +* SPDX-License-Identifier: Zlib +* +* The licensor of this software is Silicon Laboratories Inc. +* +* This software is provided \'as-is\', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +* +******************************************************************************* +* # Evaluation Quality +* This code has been minimally tested to ensure that it builds and is suitable +* as a demonstration for evaluation purposes only. This code will be maintained +* at the sole discretion of Silicon Labs. +*******************************************************************************/ +#ifndef MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ +#define MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// MAX17048 I2C Configuration + +// MAX17048 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MAX17048_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MAX17048_I2C_SPEED_MODE 0 + +// I2C Address <0x1..0x7E:0x1> +// Default: 0x36 +#define MAX17048_I2C_ADDRESS 0x36 + +// +// + +// User-Settings + +// Stabilization delay (ms) +// Default: 0 +#define MAX17048_STABILIZATION_DELAY 0 + +// Rcomp update interval (ms) +// Default: 60000 +// The driver calculates and updates the RCOMP factor at a rate of +// 1000 ms <= MAX17048_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms +// and defaults to 1 minute (60000 ms = 1 minute). +#define MAX17048_RCOMP_UPDATE_INTERVAL_MS 60000 + +// Enable battery quick start +// Default: 1 +#define MAX17048_ENABLE_HW_QSTRT 1 + +// Enable power manager +// Default: 0 +#define MAX17048_ENABLE_POWER_MANAGER 0 + +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MAX17048_ALRT +// $[GPIO_MAX17048_ALRT] +#define MAX17048_ALRT_PORT HP +#define MAX17048_ALRT_PIN 46 +// [GPIO_MAX17048_ALRT]$ + +// MAX17048_ENABLE_QSTRT +// $[GPIO_MAX17048_ENABLE_QSTRT] +#define MAX17048_ENABLE_QSTRT_PORT HP +#define MAX17048_ENABLE_QSTRT_PIN 47 +// [GPIO_MAX17048_ENABLE_QSTRT]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ */ diff --git a/driver/public/silabs/fuel_gauge_max17048/config/other/maxim_max17048_config.h b/driver/public/silabs/fuel_gauge_max17048/config/other/maxim_max17048_config.h index b0d8d5d9..9b03ff3e 100644 --- a/driver/public/silabs/fuel_gauge_max17048/config/other/maxim_max17048_config.h +++ b/driver/public/silabs/fuel_gauge_max17048/config/other/maxim_max17048_config.h @@ -35,52 +35,71 @@ #ifndef MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ #define MAXIM_FUEL_GAUGE_MAX17048_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> -// Connection + +// MAX17048 I2C Configuration + +// MAX17048 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MAX17048_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MAX17048_I2C_SPEED_MODE 0 + // I2C Address <0x1..0x7E:0x1> // Default: 0x36 -#define MAX17048_I2C_ADDRESS 0x36 +#define MAX17048_I2C_ADDRESS 0x36 + +// // // User-Settings -// Stabilization delay (ms) +// Stabilization delay (ms) // Default: 0 -#define MAX17048_CONFIG_STABILIZATION_DELAY 0 +#define MAX17048_STABILIZATION_DELAY 0 -// Rcomp update interval (ms) +// Rcomp update interval (ms) // Default: 60000 // The driver calculates and updates the RCOMP factor at a rate of -// 1000 ms <= MAX17048_CONFIG_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms +// 1000 ms <= MAX17048_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms // and defaults to 1 minute (60000 ms = 1 minute). -#define MAX17048_CONFIG_RCOMP_UPDATE_INTERVAL_MS 60000 +#define MAX17048_RCOMP_UPDATE_INTERVAL_MS 60000 -// Enable battery quick start +// Enable battery quick start // Default: 1 -#define MAX17048_CONFIG_ENABLE_HW_QSTRT 1 +#define MAX17048_ENABLE_HW_QSTRT 1 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// MAX17048_CONFIG_ALRT -// $[GPIO_MAX17048_CONFIG_ALRT] +// MAX17048_ALRT +// $[GPIO_MAX17048_ALRT] #warning "ALR pin for MAX17048 is not configured" -// #define MAX17048_CONFIG_ALRT_PORT gpioPortC -// #define MAX17048_CONFIG_ALRT_PIN 1 -// [GPIO_MAX17048_CONFIG_ALRT]$ +// #define MAX17048_ALRT_PORT gpioPortC +// #define MAX17048_ALRT_PIN 1 +// [GPIO_MAX17048_ALRT]$ -// MAX17048_CONFIG_ENABLE_QSTRT -// $[GPIO_MAX17048_CONFIG_ENABLE_QSTRT] +// MAX17048_ENABLE_QSTRT +// $[GPIO_MAX17048_ENABLE_QSTRT] #warning "QSTRT pin for MAX17048 is not configured" -// #define MAX17048_CONFIG_ENABLE_QSTRT_PORT gpioPortC -// #define MAX17048_CONFIG_ENABLE_QSTRT_PIN 2 -// [GPIO_MAX17048_CONFIG_ENABLE_QSTRT]$ +// #define MAX17048_ENABLE_QSTRT_PORT gpioPortC +// #define MAX17048_ENABLE_QSTRT_PIN 2 +// [GPIO_MAX17048_ENABLE_QSTRT]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/fuel_gauge_max17048/inc/maxim_fuel_gauge_max17048.h b/driver/public/silabs/fuel_gauge_max17048/inc/maxim_fuel_gauge_max17048.h index d8324ee3..65bc4d5b 100644 --- a/driver/public/silabs/fuel_gauge_max17048/inc/maxim_fuel_gauge_max17048.h +++ b/driver/public/silabs/fuel_gauge_max17048/inc/maxim_fuel_gauge_max17048.h @@ -38,16 +38,32 @@ #include #include -#include "em_gpio.h" +#include "sl_status.h" +#include "sl_sleeptimer.h" + +#include "drv_digital_in.h" +#include "drv_digital_out.h" +#include "drv_i2c_master.h" + +#include "maxim_max17048_config.h" + +#if (defined(SLI_SI917)) +#include "sl_driver_gpio.h" +#include "sl_si91x_bjt_temperature_sensor.h" +#define GPIO_M4_INTR 7 // M4 Pin interrupt number +#define AVL_INTR_NO 0 // available interrupt number +#else #include "gpiointerrupt.h" #include "tempdrv.h" +#endif -#include "sl_status.h" -#include "sl_i2cspm.h" -#include "sl_sleeptimer.h" -#if (defined(SL_CATALOG_POWER_MANAGER_PRESENT)) +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) +#include "sl_si91x_power_manager.h" +#else #include "sl_power_manager.h" #endif +#endif #ifdef __cplusplus extern "C" { @@ -184,22 +200,6 @@ typedef enum { hibernateMode = 1 ///< Device is in hibernate mode } max17048_hibstate_t; -/***************************************************************************//** - * @brief - * MAX17048 temperature external temperature measurement callback function. - * - * @details - * This callback function is executed from interrupt context when the user - * opts to provide the battery pack temperature through a mechanism other - * than the integrated EMU temperature sensor (e.g. an external temperature - * sensor or other means). The driver needs the battery pack temperature - * to periodically update the MAX17048 compensation factor (RCOMP). - * - * @return - * Temperature, as a signed integer in degrees C. - ******************************************************************************/ -typedef int32_t (*max17048_temp_callback_t)(void); - /***************************************************************************//** * @brief * Initialize the MAX17048 driver with the values provided in the @@ -227,7 +227,7 @@ typedef int32_t (*max17048_temp_callback_t)(void); * @li @ref SL_STATUS_ALREADY_INITIALIZED the function has previously * been called. ******************************************************************************/ -sl_status_t max17048_init(sl_i2cspm_t *i2cspm); +sl_status_t max17048_init(mikroe_i2c_handle_t i2cspm); /***************************************************************************//** * @brief @@ -260,6 +260,14 @@ sl_status_t max17048_init(sl_i2cspm_t *i2cspm); ******************************************************************************/ sl_status_t max17048_deinit(void); +/***************************************************************************//** + * @brief This function reads internal temperature of the device and recaculate + * rcom value and set this value to MAX17048 + * + * @return SL_STATUS_OK if successful. Error code otherwise. + ******************************************************************************/ +sl_status_t max17048_update_rcom(void); + /***************************************************************************//** * @brief This function returns the cell voltage in millivolts. * @@ -293,88 +301,6 @@ sl_status_t max17048_get_soc(uint32_t *soc); ******************************************************************************/ sl_status_t max17048_get_crate(float *crate); -/***************************************************************************//** - * @brief - * Register the temperature update callback for the MAX17048 driver - * - * @details - * This function is used to register a callback that periodically updates - * the temperature of the battery monitored by the MAX17048. By default, the - * driver uses the EMU temperature sensor on Series 2 EFM32/EFR32 devices. - * - * However, in order for this sensor to accurately reflect the battery - * temperature, the MCU must be underneath (e.g. on the side of the PCB - * opposite) or immediately adjacent to the battery. - * - * In cases where this is not possible, the battery temperature can be - * provided to the driver from another source, such as an external - * temperature sensor that is integrated with the battery or mounted in - * close proximity to it. The driver imposes no particular requirements - * on the source of the temperature other than that it is provided as a - * signed integer in degrees Celsius. - * - * @note - * The driver permits only one temperature update callback function to be - * registered. Attempting to register another callback returns an error. - * - * Firmware can unregister the current callback function, in which case - * the driver will revert to using the EMU temperature sensor. This - * can be useful to further reduce overall current draw in cases where the - * system enters a low-power, quiescent state such that the temperature - * reported by the EMU sensor is effectively the same as the battery - * temperature. - * - * @details - * There is no attempt to synchronize expiration of the software timer - * that updates the MAX17048's compensation factor (RCOMP) with - * registration of the user-provided callback function. If the software - * timer expires and no callback has been registered, the EMU sensor's - * output is used. - * - * This can be a concern if the user callback function does not actually - * read the temperature from whatever alternate source is used but instead - * simply returns a value that is updated in some asynchronous fashion. - * If firmware does not seed the callback function with an accurate - * battery temperature, the MAX17408 could report an erroneous SOC. - * - * @param[in] temp_cb - * User-defined function to return the battery temperature to the driver. - * - * @return - * @li @ref SL_STATUS_OK on success. - * - * @li @ref SL_STATUS_NULL_POINTER if the callback is NULL. - * - * @li @ref SL_STATUS_ALREADY_INITIALIZED if a callback has already been - * initialized. - ******************************************************************************/ -sl_status_t max17048_register_temperature_callback( - max17048_temp_callback_t temp_cb); - -/***************************************************************************//** - * @brief - * Unregister the temperature update callback for the MAX17048 driver - * - * @details - * This is the opposite of max17048_register_temperature_callback(). It - * unregisters the previously-registered temperature update callback - * function and causes the driver to revert to the output of the EMU - * temperature sensor when next updating the MAX17048's RCOMP value. - * - * @details - * There is no attempt to unregister the user-provided callback function - * before expiration of the software timer that updates RCOMP. If the - * timer expires and the callback is still registered, it must provide - * a valid temperature to the driver. - * - * @return - * @li @ref SL_STATUS_OK on success. - * - * @li @ref SL_STATUS_NOT_INITIALIZED if a callback has not previously - * been registered. - ******************************************************************************/ -sl_status_t max17048_unregister_temperature_callback(void); - /***************************************************************************//** * @brief * Set the RCOMP update interval. @@ -418,8 +344,8 @@ uint32_t max17048_get_update_interval(void); * This callback function is executed from interrupt context when the user * has enabled one of the MAX17048 interrupt sources. ******************************************************************************/ -typedef void (*max17048_interrupt_callback_t)(sl_max17048_irq_source_t irq, - void *data); +typedef void (*interrupt_callback_t)(sl_max17048_irq_source_t irq, + void *data); /***************************************************************************//** * @brief @@ -467,7 +393,7 @@ void max17048_unmask_interrupts(void); * @li @ref SL_STATUS_ALREADY_INITIALIZED if a callback has already been * initialized. ******************************************************************************/ -sl_status_t max17048_enable_soc_interrupt(max17048_interrupt_callback_t irq_cb, +sl_status_t max17048_enable_soc_interrupt(interrupt_callback_t irq_cb, void *cb_data); /***************************************************************************//** @@ -521,7 +447,7 @@ sl_status_t max17048_disable_soc_interrupt(void); * initialized. ******************************************************************************/ sl_status_t max17048_enable_empty_interrupt(uint8_t athd, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data); /***************************************************************************//** @@ -633,7 +559,7 @@ uint8_t max17048_get_empty_threshold(void); * initialized. ******************************************************************************/ sl_status_t max17048_enable_vhigh_interrupt(uint32_t valrt_max_mv, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data); /***************************************************************************//** @@ -734,7 +660,7 @@ uint32_t max17048_get_vhigh_threshold(void); * initialized. ******************************************************************************/ sl_status_t max17048_enable_vlow_interrupt(uint32_t valrt_min_mv, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data); /***************************************************************************//** @@ -837,7 +763,7 @@ uint32_t max17048_get_vlow_threshold(void); * @li @ref SL_STATUS_INVALID_PARAMETER if vreset_mv > 5080. ******************************************************************************/ sl_status_t max17048_enable_reset_interrupt(uint32_t vreset_mv, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data); /***************************************************************************//** diff --git a/driver/public/silabs/fuel_gauge_max17048/src/maxim_fuel_gauge_max17048.c b/driver/public/silabs/fuel_gauge_max17048/src/maxim_fuel_gauge_max17048.c index 667daa39..6f5e2c0a 100644 --- a/driver/public/silabs/fuel_gauge_max17048/src/maxim_fuel_gauge_max17048.c +++ b/driver/public/silabs/fuel_gauge_max17048/src/maxim_fuel_gauge_max17048.c @@ -33,31 +33,59 @@ * at the sole discretion of Silicon Labs. *******************************************************************************/ #include "maxim_fuel_gauge_max17048.h" -#include "maxim_max17048_config.h" + +typedef struct +{ + bool is_initialized; + i2c_master_t i2c; + + // Tracking for the state of SLEEP and ALSC in addition to the ATHD field + uint8_t config_lower_tracking; + uint8_t rcomp_tracking; + uint8_t valrt_max_tracking; + uint8_t valrt_min_tracking; + uint8_t vreset_tracking; + uint8_t hibthr_tracking; + uint8_t actthr_tracking; + uint32_t rcomp_update_interval; + + digital_in_t alrt_pin; + +#if MAX17048_ENABLE_HW_QSTRT +#if defined(MAX17048_ENABLE_QSTRT_PORT) && defined(MAX17048_ENABLE_QSTRT_PIN) + digital_out_t qstrt_pin; +#endif + sl_sleeptimer_timer_handle_t quick_start_timer_handle; +#endif + sl_sleeptimer_timer_handle_t temp_timer_handle; + interrupt_callback_t interrupt_callback[5]; + void *callback_data[5]; +} fuel_gauge_t; /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */ -// Global variables -static sl_i2cspm_t *max17048_i2cspm_instance = NULL; -static bool max17048_is_initialized = false; -// Tracking for the state of SLEEP and ALSC in addition to the ATHD field -static uint8_t max17048_config_lower_tracking = 0x1C; -static uint8_t max17048_rcomp_tracking = 0x97; -static uint8_t max17048_valrt_max_tracking = 0xFF; -static uint8_t max17048_valrt_min_tracking = 0x00; -static uint8_t max17048_vreset_tracking = 0x96; -static uint8_t max17048_hibthr_tracking = 0x80; -static uint8_t max17048_actthr_tracking = 0x30; -static uint32_t max17048_rcomp_update_interval = - MAX17048_CONFIG_RCOMP_UPDATE_INTERVAL_MS; - -static sl_sleeptimer_timer_handle_t max17048_temp_timer_handle; -#if MAX17048_CONFIG_ENABLE_HW_QSTRT -static sl_sleeptimer_timer_handle_t max17048_quick_start_timer_handle; +/******************************************************************************* + *************************** GLOBAL VARIABLES ******************************* + ******************************************************************************/ + +#if (defined(SLI_SI917)) +extern adc_config_t sl_bjt_config; +extern adc_ch_config_t sl_bjt_channel_config; #endif -max17048_temp_callback_t max17048_temp_callback; -max17048_interrupt_callback_t max17048_interrupt_callback[5]; -void *max17048_callback_data[5]; + +bool update_rcom = false; +static fuel_gauge_t fuel_gauge = { + .is_initialized = false, + .config_lower_tracking = 0x1C, + .rcomp_tracking = 0x97, + .valrt_max_tracking = 0xFF, + .valrt_min_tracking = 0x00, + .vreset_tracking = 0x96, + .hibthr_tracking = 0x80, + .actthr_tracking = 0x30, + .rcomp_update_interval = MAX17048_RCOMP_UPDATE_INTERVAL_MS, + .interrupt_callback = { NULL, NULL, NULL, NULL, NULL }, +}; // Function prototypes (private API) static sl_status_t max17048_read_register(uint8_t reg_addr, @@ -67,7 +95,7 @@ static sl_status_t max17048_write_register(uint8_t reg_addr, static void max17048_temp_timer_callback(sl_sleeptimer_timer_handle_t *handle, void *data); -#if MAX17048_CONFIG_ENABLE_HW_QSTRT +#if MAX17048_ENABLE_HW_QSTRT static void max17048_quick_start_callback(sl_sleeptimer_timer_handle_t *handle, void *data); @@ -102,45 +130,39 @@ static sl_status_t max17048_clear_reset_indicator_bit(void); static sl_status_t max17048_read_register(uint8_t reg_addr, uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - - uint8_t i2c_write_data[1]; - - seq.addr = MAX17048_I2C_ADDRESS << 1; - seq.flags = I2C_FLAG_WRITE_READ; - - i2c_write_data[0] = reg_addr; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - - seq.buf[1].data = data; - seq.buf[1].len = 2; - /* * Invoke sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1) * to prevent the EFM32/EFR32 from entering energy mode EM2 * or lower during I2C bus activity. */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); #endif - result = I2CSPM_Transfer(max17048_i2cspm_instance, &seq); +#endif + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&fuel_gauge.i2c, + ®_addr, + 1, + data, + 2)) { + return SL_STATUS_TRANSMIT; + } + return SL_STATUS_OK; /* * Call sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1) * to remove the requirement to remain in EM1 or higher * after I2C bus activity is complete. */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_remove_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); #endif - - if (result != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - - return SL_STATUS_OK; +#endif } /***************************************************************************//** @@ -166,47 +188,43 @@ static sl_status_t max17048_read_register(uint8_t reg_addr, static sl_status_t max17048_write_register(uint8_t reg_addr, const uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; uint8_t i2c_write_data[3]; - uint8_t i2c_read_data[1]; - - seq.addr = MAX17048_I2C_ADDRESS << 1; - seq.flags = I2C_FLAG_WRITE; i2c_write_data[0] = reg_addr; i2c_write_data[1] = data[0]; i2c_write_data[2] = data[1]; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 3; - - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - /* * Invoke sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1) * to prevent the EFM32/EFR32 from entering energy mode EM2 * or lower during I2C bus activity. */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); #endif - result = I2CSPM_Transfer(max17048_i2cspm_instance, &seq); +#endif + if (I2C_MASTER_SUCCESS != i2c_master_write(&fuel_gauge.i2c, + i2c_write_data, + sizeof(i2c_write_data))) { + return SL_STATUS_TRANSMIT; + } + return SL_STATUS_OK; /* * Call sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1) * to remove the requirement to remain in EM1 or higher * after I2C bus activity is complete. */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_remove_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); #endif - if (result != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - - return SL_STATUS_OK; +#endif } /***************************************************************************//** @@ -224,9 +242,9 @@ static sl_status_t max17048_set_rcomp(uint8_t rcomp) uint8_t buffer[2]; // Update the private global variable to track - max17048_rcomp_tracking = rcomp; - buffer[0] = max17048_rcomp_tracking; - buffer[1] = max17048_config_lower_tracking; + fuel_gauge.rcomp_tracking = rcomp; + buffer[0] = fuel_gauge.rcomp_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); return status; @@ -241,49 +259,22 @@ static void max17048_temp_timer_callback(sl_sleeptimer_timer_handle_t *handle, { (void)handle; (void)data; - uint8_t temp; - uint8_t rcomp; - /* - * Invoke sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1) - * to prevent the EFM32/EFR32 from entering energy mode EM2 - * or lower during reading the temperature. - */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) - sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); -#endif - temp = max17048_temp_callback(); - - if (temp > 20) { - rcomp = RCOMP0 + (temp - 20) * TEMP_CO_UP; - } else { - rcomp = RCOMP0 + (temp - 20) * TEMP_CO_DOWN; - } - - max17048_set_rcomp(rcomp); - - /* - * Call sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1) - * to remove the requirement to remain in EM1 or higher - * after writing rcomp to the MAX17048 is completed - */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) - sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); -#endif + update_rcom = true; } /***************************************************************************//** * Sleeptimer callback function to de-assert QSTRT pin after 1 ms. ******************************************************************************/ -#if MAX17048_CONFIG_ENABLE_HW_QSTRT +#if MAX17048_ENABLE_HW_QSTRT static void max17048_quick_start_callback(sl_sleeptimer_timer_handle_t *handle, void *data) { (void)handle; (void)data; - - GPIO_PinOutClear(MAX17048_CONFIG_ENABLE_QSTRT_PORT, - MAX17048_CONFIG_ENABLE_QSTRT_PIN); +#if defined(MAX17048_ENABLE_QSTRT_PORT) && defined(MAX17048_ENABLE_QSTRT_PIN) + digital_out_low(&fuel_gauge.qstrt_pin); +#endif } #endif @@ -300,7 +291,7 @@ static void max17048_quick_start_callback(sl_sleeptimer_timer_handle_t *handle, static void max17048_alrt_pin_callback(uint8_t pin) { (void)pin; - max17048_interrupt_callback_t callback; + interrupt_callback_t callback; uint8_t alert_condition = 0; // Check alert condition @@ -311,34 +302,34 @@ static void max17048_alrt_pin_callback(uint8_t pin) * Process RESET alert callback because battery * has changed or there has been POR */ - callback = max17048_interrupt_callback[IRQ_RESET]; - callback(IRQ_RESET, max17048_callback_data[IRQ_RESET]); + callback = fuel_gauge.interrupt_callback[IRQ_RESET]; + callback(IRQ_RESET, fuel_gauge.callback_data[IRQ_RESET]); max17048_clear_alert_condition(alert_condition, MAX17048_STATUS_VR); } else if ((alert_condition & MAX17048_STATUS_HD) != 0) { // Cell nearing empty; may need to place system in ultra-low-power state - callback = max17048_interrupt_callback[IRQ_EMPTY]; - callback(IRQ_EMPTY, max17048_callback_data[IRQ_EMPTY]); + callback = fuel_gauge.interrupt_callback[IRQ_EMPTY]; + callback(IRQ_EMPTY, fuel_gauge.callback_data[IRQ_EMPTY]); max17048_clear_alert_condition(alert_condition, MAX17048_STATUS_HD); } else if ((alert_condition & MAX17048_STATUS_VL) != 0) { /* * Voltage low alert; may need to set parameters for reduced * energy use before reaching empty threshold */ - callback = max17048_interrupt_callback[IRQ_VCELL_LOW]; - callback(IRQ_VCELL_LOW, max17048_callback_data[IRQ_VCELL_LOW]); + callback = fuel_gauge.interrupt_callback[IRQ_VCELL_LOW]; + callback(IRQ_VCELL_LOW, fuel_gauge.callback_data[IRQ_VCELL_LOW]); max17048_clear_alert_condition(alert_condition, MAX17048_STATUS_VL); } else if ((alert_condition & MAX17048_STATUS_VH) != 0) { /* * Voltage high alert; may indicate battery is full charged * and need to place charging IC in maintenance/trickle charge state */ - callback = max17048_interrupt_callback[IRQ_VCELL_HIGH]; - callback(IRQ_VCELL_HIGH, max17048_callback_data[IRQ_VCELL_HIGH]); + callback = fuel_gauge.interrupt_callback[IRQ_VCELL_HIGH]; + callback(IRQ_VCELL_HIGH, fuel_gauge.callback_data[IRQ_VCELL_HIGH]); max17048_clear_alert_condition(alert_condition, MAX17048_STATUS_VH); } else if ((alert_condition & MAX17048_STATUS_SC) != 0) { // SOC changed by 1%; lowest priority interrupt - callback = max17048_interrupt_callback[IRQ_SOC]; - callback(IRQ_SOC, max17048_callback_data[IRQ_SOC]); + callback = fuel_gauge.interrupt_callback[IRQ_SOC]; + callback(IRQ_SOC, fuel_gauge.callback_data[IRQ_SOC]); max17048_clear_alert_condition(alert_condition, MAX17048_STATUS_SC); } @@ -395,15 +386,15 @@ static sl_status_t max17048_clear_alert_status_bit(void) sl_status_t status; uint8_t buffer[2]; - buffer[0] = max17048_rcomp_tracking; + buffer[0] = fuel_gauge.rcomp_tracking; /* * Clear the ALRT bit by rewriting the lower byte of the CONFIG register. - * The max17048_config_lower_tracking holds the state of SLEEP and ALSC + * The config_lower_tracking holds the state of SLEEP and ALSC * in addition to the ATHD field, so this will clear ALRT without modifying * the other bits in the lower byte of CONFIG. */ - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); return status; @@ -470,70 +461,108 @@ static sl_status_t max17048_clear_alert_condition(uint8_t alert_condition, /***************************************************************************//** * Initialize the MAX17048. ******************************************************************************/ -sl_status_t max17048_init(sl_i2cspm_t *i2cspm) +sl_status_t max17048_init(mikroe_i2c_handle_t i2cspm) { sl_status_t status; + i2c_master_config_t fuel_gauge_cfg; if (i2cspm == NULL) { return SL_STATUS_NULL_POINTER; } // If already initialized, return status - if (max17048_is_initialized == true) { + if (fuel_gauge.is_initialized == true) { return SL_STATUS_ALREADY_INITIALIZED; } - // Update i2cspm instance - max17048_i2cspm_instance = i2cspm; + i2c_master_configure_default(&fuel_gauge_cfg); + fuel_gauge_cfg.addr = MAX17048_I2C_ADDRESS; + fuel_gauge.i2c.handle = i2cspm; + +#if (MAX17048_I2C_UC == 1) + fuel_gauge_cfg.speed = MAX17048_I2C_SPEED_MODE; +#endif + +#if defined(MAX17048_ALRT_PORT) && defined(MAX17048_ALRT_PIN) + digital_in_pullup_init(&fuel_gauge.alrt_pin, + hal_gpio_pin_name(MAX17048_ALRT_PORT, + MAX17048_ALRT_PIN)); +#endif + if (i2c_master_open(&fuel_gauge.i2c, &fuel_gauge_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&fuel_gauge.i2c, fuel_gauge_cfg.speed); + i2c_master_set_timeout(&fuel_gauge.i2c, 0); + +#if defined(MAX17048_ALRT_PORT) && defined(MAX17048_ALRT_PIN) +#if (defined(SLI_SI917)) + sl_gpio_t gpio_port_pin = { MAX17048_ALRT_PIN / 16, + MAX17048_ALRT_PIN % 16 }; + sl_gpio_driver_configure_interrupt(&gpio_port_pin, + GPIO_M4_INTR, + SL_GPIO_INTERRUPT_FALLING_EDGE, + (void *)max17048_alrt_pin_callback, + AVL_INTR_NO); +#else GPIOINT_Init(); - GPIO_PinModeSet(MAX17048_CONFIG_ALRT_PORT, - MAX17048_CONFIG_ALRT_PIN, + GPIO_PinModeSet(MAX17048_ALRT_PORT, + MAX17048_ALRT_PIN, gpioModeInputPullFilter, 1); - GPIO_ExtIntConfig(MAX17048_CONFIG_ALRT_PORT, - MAX17048_CONFIG_ALRT_PIN, - MAX17048_CONFIG_ALRT_PIN, + GPIO_ExtIntConfig(MAX17048_ALRT_PORT, + MAX17048_ALRT_PIN, + MAX17048_ALRT_PIN, false, true, true); + // Register the callback function that is invoked when interrupt occurs - GPIOINT_CallbackRegister(MAX17048_CONFIG_ALRT_PIN, + GPIOINT_CallbackRegister(MAX17048_ALRT_PIN, max17048_alrt_pin_callback); +#endif +#endif -#if MAX17048_CONFIG_ENABLE_HW_QSTRT - GPIO_PinModeSet(MAX17048_CONFIG_ENABLE_QSTRT_PORT, - MAX17048_CONFIG_ENABLE_QSTRT_PIN, - gpioModePushPull, - 0); +#if MAX17048_ENABLE_HW_QSTRT +#if defined(MAX17048_ENABLE_QSTRT_PORT) && defined(MAX17048_ENABLE_QSTRT_PIN) + digital_out_init(&fuel_gauge.qstrt_pin, + hal_gpio_pin_name(MAX17048_ENABLE_QSTRT_PORT, + MAX17048_ENABLE_QSTRT_PIN)); +#endif #endif /* The driver calculates and updates the RCOMP factor at a rate of - * 1000 ms <= MAX17048_CONFIG_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms + * 1000 ms <= MAX17048_RCOMP_UPDATE_INTERVAL_MS <= 60000 ms * and defaults to 1 minute (60000 ms = 1 minute). */ - if ((max17048_rcomp_update_interval < 1000) - || (max17048_rcomp_update_interval > 60000)) { + if ((fuel_gauge.rcomp_update_interval < 1000) + || (fuel_gauge.rcomp_update_interval > 60000)) { return SL_STATUS_INVALID_RANGE; } - TEMPDRV_Init(); - status = - max17048_register_temperature_callback( - ((max17048_temp_callback_t)((int32_t)TEMPDRV_GetTemp))); +#if (defined(SLI_SI917)) + status = sl_si91x_bjt_temperature_sensor_init(sl_bjt_channel_config, + sl_bjt_config); if (status != SL_STATUS_OK) { return status; } +#else + TEMPDRV_Init(); +#endif // Read and clear RI bit if it is set - max17048_clear_reset_indicator_bit(); + status = max17048_clear_reset_indicator_bit(); + if (status != SL_STATUS_OK) { + return status; + } // Change drive state to initialized - max17048_is_initialized = true; + fuel_gauge.is_initialized = true; // User-specified stabilization delay -#if MAX17048_CONFIG_STABILIZATION_DELAY > 0 - sl_sleeptimer_delay_millisecond(MAX17048_CONFIG_STABILIZATION_DELAY); +#if MAX17048_STABILIZATION_DELAY > 0 + sl_sleeptimer_delay_millisecond(MAX17048_STABILIZATION_DELAY); #endif return SL_STATUS_OK; @@ -546,21 +575,41 @@ sl_status_t max17048_deinit(void) { sl_status_t status; - if (max17048_is_initialized == false) { + if (fuel_gauge.is_initialized == false) { return SL_STATUS_NOT_INITIALIZED; } // De-initialization tasks - GPIO_PinModeSet(MAX17048_CONFIG_ALRT_PORT, - MAX17048_CONFIG_ALRT_PIN, +#if defined(MAX17048_ALRT_PORT) && defined(MAX17048_ALRT_PIN) +#if (defined(SLI_SI917)) + sl_gpio_t alert_port_pin = { MAX17048_ALRT_PIN / 16, + MAX17048_ALRT_PIN % 16 }; + sl_gpio_driver_set_pin_mode(&alert_port_pin, + SL_GPIO_MODE_DISABLED, + 0); +#else + GPIO_PinModeSet(MAX17048_ALRT_PORT, + MAX17048_ALRT_PIN, gpioModeDisabled, 1); +#endif +#endif -#if MAX17048_CONFIG_ENABLE_HW_QSTRT - GPIO_PinModeSet(MAX17048_CONFIG_ENABLE_QSTRT_PORT, - MAX17048_CONFIG_ENABLE_QSTRT_PIN, +#if MAX17048_ENABLE_HW_QSTRT +#if defined(MAX17048_ENABLE_QSTRT_PORT) && defined(MAX17048_ENABLE_QSTRT_PIN) +#if (defined(SLI_SI917)) + sl_gpio_t qstrt_port_pin = { MAX17048_ENABLE_QSTRT_PORT / 16, + MAX17048_ENABLE_QSTRT_PIN % 16 }; + sl_gpio_driver_set_pin_mode(&qstrt_port_pin, + SL_GPIO_MODE_DISABLED, + 0); +#else + GPIO_PinModeSet(MAX17048_ENABLE_QSTRT_PORT, + MAX17048_ENABLE_QSTRT_PIN, gpioModeDisabled, 0); +#endif +#endif #endif status = max17048_disable_soc_interrupt(); @@ -594,14 +643,72 @@ sl_status_t max17048_deinit(void) } // Update i2cspm instance - max17048_i2cspm_instance = NULL; + fuel_gauge.i2c.handle = NULL; // Mark driver as not initialized - max17048_is_initialized = false; + fuel_gauge.is_initialized = false; return SL_STATUS_OK; } +/***************************************************************************//** + * This function returns the cell voltage in millivolts. + ******************************************************************************/ +sl_status_t max17048_update_rcom(void) +{ +#if (defined(SLI_SI917)) + double temp; +#else + uint8_t temp; +#endif + uint8_t rcomp; + + /* + * Invoke sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1) + * to prevent the EFM32/EFR32 from entering energy mode EM2 + * or lower during reading the temperature. + */ +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else + sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); +#endif +#endif + +#if (defined(SLI_SI917)) + sl_si91x_bjt_temperature_sensor_read_data(&temp); +#else + temp = TEMPDRV_GetTemp(); +#endif + + if (temp > 20) { + rcomp = RCOMP0 + (temp - 20) * TEMP_CO_UP; + } else { + rcomp = RCOMP0 + (temp - 20) * TEMP_CO_DOWN; + } + + sl_status_t status = max17048_set_rcomp(rcomp); + + /* + * Call sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1) + * to remove the requirement to remain in EM1 or higher + * after writing rcomp to the MAX17048 is completed + */ +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_remove_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else + sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); +#endif +#endif + + if (status != SL_STATUS_OK) { + return SL_STATUS_FAIL; + } + return SL_STATUS_OK; +} + /***************************************************************************//** * This function returns the cell voltage in millivolts. ******************************************************************************/ @@ -664,47 +771,6 @@ sl_status_t max17048_get_crate(float *crate) return status; } -/***************************************************************************//** - * Register the temperature update callback for the MAX17048 driver - ******************************************************************************/ -sl_status_t max17048_register_temperature_callback( - max17048_temp_callback_t temp_cb) -{ - sl_status_t status; - - if (max17048_temp_callback == temp_cb) { - return SL_STATUS_ALREADY_INITIALIZED; - } - - if (temp_cb == NULL) { - return SL_STATUS_NULL_POINTER; - } - - max17048_temp_callback = temp_cb; - - status = sl_sleeptimer_start_periodic_timer_ms(&max17048_temp_timer_handle, - max17048_rcomp_update_interval, - max17048_temp_timer_callback, - (void *)NULL, - 0, - 0); - - return status; -} - -/***************************************************************************//** - * Unregister the temperature update callback for the MAX17048 driver - ******************************************************************************/ -sl_status_t max17048_unregister_temperature_callback(void) -{ - if (max17048_temp_callback == NULL) { - return SL_STATUS_NOT_INITIALIZED; - } - max17048_temp_callback = (max17048_temp_callback_t)((int32_t)TEMPDRV_GetTemp); - - return SL_STATUS_OK; -} - /***************************************************************************//** * Set the RCOMP update interval. ******************************************************************************/ @@ -722,13 +788,14 @@ sl_status_t max17048_set_update_interval(uint32_t interval) */ max17048_temp_timer_callback(NULL, NULL); - max17048_rcomp_update_interval = interval; - status = sl_sleeptimer_restart_periodic_timer_ms(&max17048_temp_timer_handle, - max17048_rcomp_update_interval, - max17048_temp_timer_callback, - (void *)NULL, - 0, - 0); + fuel_gauge.rcomp_update_interval = interval; + status = sl_sleeptimer_restart_periodic_timer_ms( + &fuel_gauge.temp_timer_handle, + fuel_gauge.rcomp_update_interval, + max17048_temp_timer_callback, + (void *)NULL, + 0, + 0); return status; } @@ -738,7 +805,7 @@ sl_status_t max17048_set_update_interval(uint32_t interval) ******************************************************************************/ uint32_t max17048_get_update_interval(void) { - return max17048_rcomp_update_interval; + return fuel_gauge.rcomp_update_interval; } /***************************************************************************//** @@ -746,7 +813,13 @@ uint32_t max17048_get_update_interval(void) ******************************************************************************/ void max17048_mask_interrupts(void) { - GPIO_IntDisable(1 << MAX17048_CONFIG_ALRT_PIN); +#if (defined(SLI_SI917)) + sl_gpio_driver_clear_interrupts(GPIO_M4_INTR); + sl_gpio_driver_disable_interrupts( + (GPIO_M4_INTR << 16) | SL_GPIO_INTERRUPT_FALL_EDGE); +#else + GPIO_IntDisable(1 << MAX17048_ALRT_PIN); +#endif } /***************************************************************************//** @@ -758,14 +831,19 @@ void max17048_unmask_interrupts(void) * Clear ALRT pin interrupt flag in case an edge was detected while * the interrupt was disabled. */ - GPIO_IntClear(1 << MAX17048_CONFIG_ALRT_PIN); - GPIO_IntEnable(1 << MAX17048_CONFIG_ALRT_PIN); +#if (defined(SLI_SI917)) + sl_gpio_driver_enable_interrupts( + (GPIO_M4_INTR << 16) | SL_GPIO_INTERRUPT_FALL_EDGE); +#else + GPIO_IntClear(1 << MAX17048_ALRT_PIN); + GPIO_IntEnable(1 << MAX17048_ALRT_PIN); +#endif } /***************************************************************************//** * Enable alerting when SOC changes. ******************************************************************************/ -sl_status_t max17048_enable_soc_interrupt(max17048_interrupt_callback_t irq_cb, +sl_status_t max17048_enable_soc_interrupt(interrupt_callback_t irq_cb, void *cb_data) { sl_status_t status; @@ -775,23 +853,23 @@ sl_status_t max17048_enable_soc_interrupt(max17048_interrupt_callback_t irq_cb, return SL_STATUS_NULL_POINTER; } - if ((max17048_interrupt_callback[IRQ_SOC] != NULL) - || (max17048_callback_data[IRQ_SOC] != NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_SOC] != NULL) + || (fuel_gauge.callback_data[IRQ_SOC] != NULL)) { return SL_STATUS_ALREADY_INITIALIZED; } - max17048_interrupt_callback[IRQ_SOC] = irq_cb; - max17048_callback_data[IRQ_SOC] = cb_data; + fuel_gauge.interrupt_callback[IRQ_SOC] = irq_cb; + fuel_gauge.callback_data[IRQ_SOC] = cb_data; // Get the upper byte of the CONFIG register - buffer[0] = max17048_rcomp_tracking; + buffer[0] = fuel_gauge.rcomp_tracking; /* * Set ALSC bit in the lower byte of the CONFIG register * to enable alerting when SOC changes */ - max17048_config_lower_tracking |= MAX17048_CONFIG_ALSC; + fuel_gauge.config_lower_tracking |= MAX17048_CONFIG_ALSC; // Get the lower byte of the CONFIG register - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); @@ -807,24 +885,24 @@ sl_status_t max17048_disable_soc_interrupt(void) sl_status_t status; uint8_t buffer[2]; - if ((max17048_interrupt_callback[IRQ_SOC] == NULL) - || (max17048_callback_data[IRQ_SOC] == NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_SOC] == NULL) + || (fuel_gauge.callback_data[IRQ_SOC] == NULL)) { return SL_STATUS_NOT_INITIALIZED; } - max17048_interrupt_callback[IRQ_SOC] = NULL; - max17048_callback_data[IRQ_SOC] = NULL; + fuel_gauge.interrupt_callback[IRQ_SOC] = NULL; + fuel_gauge.callback_data[IRQ_SOC] = NULL; // Get the upper byte of the CONFIG register - buffer[0] = max17048_rcomp_tracking; + buffer[0] = fuel_gauge.rcomp_tracking; /* * Clear ALSC bit in the lower byte of the CONFIG register * to disable alerting when SOC changes */ - max17048_config_lower_tracking &= ~MAX17048_CONFIG_ALSC; + fuel_gauge.config_lower_tracking &= ~MAX17048_CONFIG_ALSC; // Get the lower byte of the CONFIG register - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); return status; @@ -834,7 +912,7 @@ sl_status_t max17048_disable_soc_interrupt(void) * Enables the empty alert interrupt and set its threshold. ******************************************************************************/ sl_status_t max17048_enable_empty_interrupt(uint8_t athd, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data) { sl_status_t status; @@ -848,20 +926,20 @@ sl_status_t max17048_enable_empty_interrupt(uint8_t athd, return SL_STATUS_NULL_POINTER; } - if ((max17048_interrupt_callback[IRQ_EMPTY] != NULL) - || (max17048_callback_data[IRQ_EMPTY] != NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_EMPTY] != NULL) + || (fuel_gauge.callback_data[IRQ_EMPTY] != NULL)) { return SL_STATUS_ALREADY_INITIALIZED; } - max17048_interrupt_callback[IRQ_EMPTY] = irq_cb; - max17048_callback_data[IRQ_EMPTY] = cb_data; + fuel_gauge.interrupt_callback[IRQ_EMPTY] = irq_cb; + fuel_gauge.callback_data[IRQ_EMPTY] = cb_data; // Get the upper byte of the CONFIG register - buffer[0] = max17048_rcomp_tracking; + buffer[0] = fuel_gauge.rcomp_tracking; // Update the private global variable to track - max17048_config_lower_tracking &= 0xE0; - max17048_config_lower_tracking |= 32 - athd; + fuel_gauge.config_lower_tracking &= 0xE0; + fuel_gauge.config_lower_tracking |= 32 - athd; // Update the lower byte of the CONFIG register - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); @@ -877,26 +955,26 @@ sl_status_t max17048_disable_empty_interrupt(void) sl_status_t status; uint8_t buffer[2]; - if ((max17048_interrupt_callback[IRQ_EMPTY] == NULL) - || (max17048_callback_data[IRQ_EMPTY] == NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_EMPTY] == NULL) + || (fuel_gauge.callback_data[IRQ_EMPTY] == NULL)) { return SL_STATUS_NOT_INITIALIZED; } - max17048_interrupt_callback[IRQ_EMPTY] = NULL; - max17048_callback_data[IRQ_EMPTY] = NULL; + fuel_gauge.interrupt_callback[IRQ_EMPTY] = NULL; + fuel_gauge.callback_data[IRQ_EMPTY] = NULL; // Get the upper byte of the CONFIG register - buffer[0] = max17048_rcomp_tracking; + buffer[0] = fuel_gauge.rcomp_tracking; /* * Update the private global variable to track. * Setting a threshold of 1% (ATHD = 31) should prevent the interrupt * from being requested and the driver will ignore it. */ - max17048_config_lower_tracking &= 0xE0; - max17048_config_lower_tracking |= 0x1F; + fuel_gauge.config_lower_tracking &= 0xE0; + fuel_gauge.config_lower_tracking |= 0x1F; // Update the lower byte of the CONFIG register - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); @@ -916,12 +994,12 @@ sl_status_t max17048_set_empty_threshold(uint8_t athd) } // Get the upper byte of the CONFIG register - buffer[0] = max17048_rcomp_tracking; + buffer[0] = fuel_gauge.rcomp_tracking; // Update the private global variable to track - max17048_config_lower_tracking &= 0xE0; - max17048_config_lower_tracking |= 32 - athd; + fuel_gauge.config_lower_tracking &= 0xE0; + fuel_gauge.config_lower_tracking |= 32 - athd; // Update the lower byte of the CONFIG register - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); @@ -933,7 +1011,7 @@ sl_status_t max17048_set_empty_threshold(uint8_t athd) ******************************************************************************/ uint8_t max17048_get_empty_threshold(void) { - return (32 - (max17048_config_lower_tracking & 0x1F)); + return (32 - (fuel_gauge.config_lower_tracking & 0x1F)); } /***************************************************************************//** @@ -941,7 +1019,7 @@ uint8_t max17048_get_empty_threshold(void) * register a user-provided callback function to respond to it. ******************************************************************************/ sl_status_t max17048_enable_vhigh_interrupt(uint32_t valrt_max_mv, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data) { sl_status_t status; @@ -951,23 +1029,23 @@ sl_status_t max17048_enable_vhigh_interrupt(uint32_t valrt_max_mv, return SL_STATUS_NULL_POINTER; } - if ((max17048_interrupt_callback[IRQ_VCELL_HIGH] != NULL) - || (max17048_callback_data[IRQ_VCELL_HIGH] != NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_VCELL_HIGH] != NULL) + || (fuel_gauge.callback_data[IRQ_VCELL_HIGH] != NULL)) { return SL_STATUS_ALREADY_INITIALIZED; } - max17048_interrupt_callback[IRQ_VCELL_HIGH] = irq_cb; - max17048_callback_data[IRQ_VCELL_HIGH] = cb_data; + fuel_gauge.interrupt_callback[IRQ_VCELL_HIGH] = irq_cb; + fuel_gauge.callback_data[IRQ_VCELL_HIGH] = cb_data; if (valrt_max_mv > MAX17048_VALRT_MAX_MV) { valrt_max_mv = MAX17048_VALRT_MAX_MV; } - buffer[0] = max17048_valrt_min_tracking; // Get the VALRT.MIN register + buffer[0] = fuel_gauge.valrt_min_tracking; // Get the VALRT.MIN register // Update the private global variable to track - max17048_valrt_max_tracking = + fuel_gauge.valrt_max_tracking = (uint8_t)(valrt_max_mv / MAX17048_VALRT_RESOLUTION); - buffer[1] = max17048_valrt_max_tracking; // Update the VALRT.MAX register + buffer[1] = fuel_gauge.valrt_max_tracking; // Update the VALRT.MAX register status = max17048_write_register(MAX17048_VALRT, buffer); return status; @@ -982,20 +1060,20 @@ sl_status_t max17048_disable_vhigh_interrupt(void) sl_status_t status; uint8_t buffer[2]; - if ((max17048_interrupt_callback[IRQ_VCELL_HIGH] == NULL) - || (max17048_callback_data[IRQ_VCELL_HIGH] == NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_VCELL_HIGH] == NULL) + || (fuel_gauge.callback_data[IRQ_VCELL_HIGH] == NULL)) { return SL_STATUS_NOT_INITIALIZED; } - max17048_interrupt_callback[IRQ_VCELL_HIGH] = NULL; - max17048_callback_data[IRQ_VCELL_HIGH] = NULL; + fuel_gauge.interrupt_callback[IRQ_VCELL_HIGH] = NULL; + fuel_gauge.callback_data[IRQ_VCELL_HIGH] = NULL; // Get the VALRT.MIN register - buffer[0] = max17048_valrt_min_tracking; + buffer[0] = fuel_gauge.valrt_min_tracking; // Update the private global variable to track - max17048_valrt_max_tracking = 0xFF; + fuel_gauge.valrt_max_tracking = 0xFF; // Update the VALRT.MAX register - buffer[1] = max17048_valrt_max_tracking; + buffer[1] = fuel_gauge.valrt_max_tracking; status = max17048_write_register(MAX17048_VALRT, buffer); return status; @@ -1014,12 +1092,12 @@ sl_status_t max17048_set_vhigh_threshold(uint32_t valrt_max_mv) } // Get the VALRT.MIN register - buffer[0] = max17048_valrt_min_tracking; + buffer[0] = fuel_gauge.valrt_min_tracking; // Update the private global variable to track - max17048_valrt_max_tracking = + fuel_gauge.valrt_max_tracking = (uint8_t)(valrt_max_mv / MAX17048_VALRT_RESOLUTION); // Update the VALRT.MAX register - buffer[1] = max17048_valrt_max_tracking; + buffer[1] = fuel_gauge.valrt_max_tracking; status = max17048_write_register(MAX17048_VALRT, buffer); return status; @@ -1030,7 +1108,7 @@ sl_status_t max17048_set_vhigh_threshold(uint32_t valrt_max_mv) ******************************************************************************/ uint32_t max17048_get_vhigh_threshold(void) { - return (uint32_t)(max17048_valrt_max_tracking * MAX17048_VALRT_RESOLUTION); + return (uint32_t)(fuel_gauge.valrt_max_tracking * MAX17048_VALRT_RESOLUTION); } /***************************************************************************//** @@ -1038,7 +1116,7 @@ uint32_t max17048_get_vhigh_threshold(void) * register a user-provided callback function to respond to it. ******************************************************************************/ sl_status_t max17048_enable_vlow_interrupt(uint32_t valrt_min_mv, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data) { sl_status_t status; @@ -1048,25 +1126,25 @@ sl_status_t max17048_enable_vlow_interrupt(uint32_t valrt_min_mv, return SL_STATUS_NULL_POINTER; } - if ((max17048_interrupt_callback[IRQ_VCELL_LOW] != NULL) - || (max17048_callback_data[IRQ_VCELL_LOW] != NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_VCELL_LOW] != NULL) + || (fuel_gauge.callback_data[IRQ_VCELL_LOW] != NULL)) { return SL_STATUS_ALREADY_INITIALIZED; } - max17048_interrupt_callback[IRQ_VCELL_LOW] = irq_cb; - max17048_callback_data[IRQ_VCELL_LOW] = cb_data; + fuel_gauge.interrupt_callback[IRQ_VCELL_LOW] = irq_cb; + fuel_gauge.callback_data[IRQ_VCELL_LOW] = cb_data; if (valrt_min_mv > MAX17048_VALRT_MIN_MV) { valrt_min_mv = MAX17048_VALRT_MIN_MV; } // Get the VALRT.MAX register - buffer[1] = max17048_valrt_max_tracking; + buffer[1] = fuel_gauge.valrt_max_tracking; // Update the private global variable to track - max17048_valrt_min_tracking = + fuel_gauge.valrt_min_tracking = (uint8_t)(valrt_min_mv / MAX17048_VALRT_RESOLUTION); // Update the VALRT.MIN register - buffer[0] = max17048_valrt_min_tracking; + buffer[0] = fuel_gauge.valrt_min_tracking; status = max17048_write_register(MAX17048_VALRT, buffer); return status; @@ -1081,20 +1159,20 @@ sl_status_t max17048_disable_vlow_interrupt(void) sl_status_t status; uint8_t buffer[2]; - if ((max17048_interrupt_callback[IRQ_VCELL_LOW] == NULL) - || (max17048_callback_data[IRQ_VCELL_LOW] == NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_VCELL_LOW] == NULL) + || (fuel_gauge.callback_data[IRQ_VCELL_LOW] == NULL)) { return SL_STATUS_NOT_INITIALIZED; } - max17048_interrupt_callback[IRQ_VCELL_LOW] = NULL; - max17048_callback_data[IRQ_VCELL_LOW] = NULL; + fuel_gauge.interrupt_callback[IRQ_VCELL_LOW] = NULL; + fuel_gauge.callback_data[IRQ_VCELL_LOW] = NULL; // Get the VALRT.MAX register - buffer[1] = max17048_valrt_max_tracking; + buffer[1] = fuel_gauge.valrt_max_tracking; // Update the private global variable to track - max17048_valrt_min_tracking = 0x00; + fuel_gauge.valrt_min_tracking = 0x00; // Update the VALRT.MIN register - buffer[0] = max17048_valrt_min_tracking; + buffer[0] = fuel_gauge.valrt_min_tracking; status = max17048_write_register(MAX17048_VALRT, buffer); return status; @@ -1113,12 +1191,12 @@ sl_status_t max17048_set_vlow_threshold(uint32_t valrt_min_mv) } // Get the VALRT.MAX register - buffer[1] = max17048_valrt_max_tracking; + buffer[1] = fuel_gauge.valrt_max_tracking; // Update the private global variable to track - max17048_valrt_min_tracking = + fuel_gauge.valrt_min_tracking = (uint8_t)(valrt_min_mv / MAX17048_VALRT_RESOLUTION); // Update the VALRT.MIN register - buffer[0] = max17048_valrt_min_tracking; + buffer[0] = fuel_gauge.valrt_min_tracking; status = max17048_write_register(MAX17048_VALRT, buffer); return status; @@ -1129,14 +1207,14 @@ sl_status_t max17048_set_vlow_threshold(uint32_t valrt_min_mv) ******************************************************************************/ uint32_t max17048_get_vlow_threshold(void) { - return (uint32_t)(max17048_valrt_min_tracking * MAX17048_VALRT_RESOLUTION); + return (uint32_t)(fuel_gauge.valrt_min_tracking * MAX17048_VALRT_RESOLUTION); } /***************************************************************************//** * Enable the voltage reset alert interrupt and set its threshold. ******************************************************************************/ sl_status_t max17048_enable_reset_interrupt(uint32_t vreset_mv, - max17048_interrupt_callback_t irq_cb, + interrupt_callback_t irq_cb, void *cb_data) { sl_status_t status; @@ -1147,8 +1225,8 @@ sl_status_t max17048_enable_reset_interrupt(uint32_t vreset_mv, return SL_STATUS_NULL_POINTER; } - if ((max17048_interrupt_callback[IRQ_RESET] != NULL) - || (max17048_callback_data[IRQ_RESET] != NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_RESET] != NULL) + || (fuel_gauge.callback_data[IRQ_RESET] != NULL)) { return SL_STATUS_ALREADY_INITIALIZED; } @@ -1156,8 +1234,8 @@ sl_status_t max17048_enable_reset_interrupt(uint32_t vreset_mv, return SL_STATUS_INVALID_PARAMETER; } - max17048_interrupt_callback[IRQ_RESET] = irq_cb; - max17048_callback_data[IRQ_RESET] = cb_data; + fuel_gauge.interrupt_callback[IRQ_RESET] = irq_cb; + fuel_gauge.callback_data[IRQ_RESET] = cb_data; /* * Set EnVR bit in the upper of the STATUS register @@ -1175,11 +1253,11 @@ sl_status_t max17048_enable_reset_interrupt(uint32_t vreset_mv, } // Update the private global variable to track - max17048_vreset_tracking &= 0x01; + fuel_gauge.vreset_tracking &= 0x01; vreset_val = (uint8_t)(vreset_mv / MAX17048_VRESET_RESOLUTION); - max17048_vreset_tracking |= (vreset_val << MAX17048_VRESET_SHIFT); + fuel_gauge.vreset_tracking |= (vreset_val << MAX17048_VRESET_SHIFT); // Update the VRESET register - buffer[0] = max17048_vreset_tracking; + buffer[0] = fuel_gauge.vreset_tracking; // Writing to the ID register has no effect buffer[1] = 0x00; status = max17048_write_register(MAX17048_VRESET_ID, buffer); @@ -1196,13 +1274,13 @@ sl_status_t max17048_disable_reset_interrupt(void) sl_status_t status; uint8_t buffer[2]; - if ((max17048_interrupt_callback[IRQ_RESET] == NULL) - || (max17048_callback_data[IRQ_RESET] == NULL)) { + if ((fuel_gauge.interrupt_callback[IRQ_RESET] == NULL) + || (fuel_gauge.callback_data[IRQ_RESET] == NULL)) { return SL_STATUS_NOT_INITIALIZED; } - max17048_interrupt_callback[IRQ_RESET] = NULL; - max17048_callback_data[IRQ_RESET] = NULL; + fuel_gauge.interrupt_callback[IRQ_RESET] = NULL; + fuel_gauge.callback_data[IRQ_RESET] = NULL; /* * Clear EnVR bit in the upper byte of the STATUS register @@ -1230,11 +1308,11 @@ sl_status_t max17048_set_reset_threshold(uint32_t vreset_mv) } // Update the private global variable to track - max17048_vreset_tracking &= MAX17048_VRESET_DIS; + fuel_gauge.vreset_tracking &= MAX17048_VRESET_DIS; vreset_val = (uint8_t)(vreset_mv / MAX17048_VRESET_RESOLUTION); - max17048_vreset_tracking |= (vreset_val << MAX17048_VRESET_SHIFT); + fuel_gauge.vreset_tracking |= (vreset_val << MAX17048_VRESET_SHIFT); // Update the VRESET register - buffer[0] = max17048_vreset_tracking; + buffer[0] = fuel_gauge.vreset_tracking; // Writing to the ID register has no effect buffer[1] = 0x00; status = max17048_write_register(MAX17048_VRESET_ID, buffer); @@ -1247,7 +1325,7 @@ sl_status_t max17048_set_reset_threshold(uint32_t vreset_mv) ******************************************************************************/ uint32_t max17048_get_reset_threshold(void) { - return (uint32_t)((max17048_vreset_tracking >> + return (uint32_t)((fuel_gauge.vreset_tracking >> MAX17048_VRESET_SHIFT) * MAX17048_VRESET_RESOLUTION); } @@ -1289,12 +1367,12 @@ sl_status_t max17048_enable_auto_hibernate(float hib_thr, uint32_t act_thr) } // Update the private global variables to track - max17048_hibthr_tracking = (uint8_t)(hib_thr / MAX17048_HIBTHR_RESOLUTION); - max17048_actthr_tracking = + fuel_gauge.hibthr_tracking = (uint8_t)(hib_thr / MAX17048_HIBTHR_RESOLUTION); + fuel_gauge.actthr_tracking = (uint8_t)(act_thr * 1000 / MAX17048_ACTTHR_RESOLUTION); - buffer[0] = max17048_hibthr_tracking; - buffer[1] = max17048_actthr_tracking; + buffer[0] = fuel_gauge.hibthr_tracking; + buffer[1] = fuel_gauge.actthr_tracking; status = max17048_write_register(MAX17048_HIBRT, buffer); return status; @@ -1310,11 +1388,11 @@ sl_status_t max17048_disable_auto_hibernate(void) uint8_t buffer[2]; // Update the private global variables to track - max17048_hibthr_tracking = 0x00; - max17048_actthr_tracking = 0x00; + fuel_gauge.hibthr_tracking = 0x00; + fuel_gauge.actthr_tracking = 0x00; - buffer[0] = max17048_hibthr_tracking; - buffer[1] = max17048_actthr_tracking; + buffer[0] = fuel_gauge.hibthr_tracking; + buffer[1] = fuel_gauge.actthr_tracking; status = max17048_write_register(MAX17048_HIBRT, buffer); return status; @@ -1332,9 +1410,9 @@ sl_status_t max17048_set_hibernate_threshold(float hib_thr) hib_thr = MAX17048_HIBTHR_PERCENT; } // Update the private global variable to track - max17048_hibthr_tracking = (uint8_t)(hib_thr / MAX17048_HIBTHR_RESOLUTION); - buffer[0] = max17048_hibthr_tracking; - buffer[1] = max17048_actthr_tracking; + fuel_gauge.hibthr_tracking = (uint8_t)(hib_thr / MAX17048_HIBTHR_RESOLUTION); + buffer[0] = fuel_gauge.hibthr_tracking; + buffer[1] = fuel_gauge.actthr_tracking; status = max17048_write_register(MAX17048_HIBRT, buffer); return status; @@ -1345,7 +1423,7 @@ sl_status_t max17048_set_hibernate_threshold(float hib_thr) ******************************************************************************/ float max17048_get_hibernate_threshold(void) { - return (float)(max17048_hibthr_tracking * MAX17048_HIBTHR_RESOLUTION); + return (float)(fuel_gauge.hibthr_tracking * MAX17048_HIBTHR_RESOLUTION); } /***************************************************************************//** @@ -1361,10 +1439,10 @@ sl_status_t max17048_set_activity_threshold(uint32_t act_thr) } // Update the private global variable to track - max17048_actthr_tracking = + fuel_gauge.actthr_tracking = (uint8_t)(act_thr * 1000 / MAX17048_ACTTHR_RESOLUTION); - buffer[0] = max17048_hibthr_tracking; - buffer[1] = max17048_actthr_tracking; + buffer[0] = fuel_gauge.hibthr_tracking; + buffer[1] = fuel_gauge.actthr_tracking; status = max17048_write_register(MAX17048_HIBRT, buffer); return status; @@ -1375,7 +1453,7 @@ sl_status_t max17048_set_activity_threshold(uint32_t act_thr) ******************************************************************************/ uint32_t max17048_get_activity_threshold(void) { - return (uint32_t)(max17048_actthr_tracking * MAX17048_ACTTHR_RESOLUTION + return (uint32_t)(fuel_gauge.actthr_tracking * MAX17048_ACTTHR_RESOLUTION / 1000); } @@ -1389,14 +1467,14 @@ sl_status_t max17048_enable_reset_comparator(bool enable) if (enable) { // VRESET_DIS = 1 to disable the comparator in hibernate mode - max17048_vreset_tracking |= MAX17048_VRESET_DIS; + fuel_gauge.vreset_tracking |= MAX17048_VRESET_DIS; } else { // VRESET_DIS = 0 to keep the comparator enabled in hibernate mode - max17048_vreset_tracking &= ~MAX17048_VRESET_DIS; + fuel_gauge.vreset_tracking &= ~MAX17048_VRESET_DIS; } // Update the VRESET register - buffer[0] = max17048_vreset_tracking; + buffer[0] = fuel_gauge.vreset_tracking; // Writing to the ID register has no effect buffer[1] = 0x00; status = max17048_write_register(MAX17048_VRESET_ID, buffer); @@ -1421,10 +1499,10 @@ sl_status_t max17048_enter_sleep(void) return status; } // Get the upper byte of the CONFIG register - buffer[0] = max17048_rcomp_tracking; - max17048_config_lower_tracking |= MAX17048_CONFIG_SLEEP; + buffer[0] = fuel_gauge.rcomp_tracking; + fuel_gauge.config_lower_tracking |= MAX17048_CONFIG_SLEEP; // Get the lower byte of the CONFIG register - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); return status; @@ -1439,11 +1517,11 @@ sl_status_t max17048_exit_sleep(void) uint8_t buffer[2]; // Get the upper byte of the CONFIG register - buffer[0] = max17048_rcomp_tracking; + buffer[0] = fuel_gauge.rcomp_tracking; // Clear SLEEP in the lower byte of the CONFIG register to exit sleep mode - max17048_config_lower_tracking &= ~MAX17048_CONFIG_SLEEP; + fuel_gauge.config_lower_tracking &= ~MAX17048_CONFIG_SLEEP; // Get the lower byte of the CONFIG register - buffer[1] = max17048_config_lower_tracking; + buffer[1] = fuel_gauge.config_lower_tracking; status = max17048_write_register(MAX17048_CONFIG, buffer); return status; @@ -1458,13 +1536,13 @@ sl_status_t max17048_force_reset(void) uint8_t buffer[2]; // Force all tracking variables to their default values - max17048_config_lower_tracking = 0x1C; - max17048_rcomp_tracking = 0x97; - max17048_valrt_max_tracking = 0xFF; - max17048_valrt_min_tracking = 0x00; - max17048_vreset_tracking = 0x96; - max17048_hibthr_tracking = 0x80; - max17048_actthr_tracking = 0x30; + fuel_gauge.config_lower_tracking = 0x1C; + fuel_gauge.rcomp_tracking = 0x97; + fuel_gauge.valrt_max_tracking = 0xFF; + fuel_gauge.valrt_min_tracking = 0x00; + fuel_gauge.vreset_tracking = 0x96; + fuel_gauge.hibthr_tracking = 0x80; + fuel_gauge.actthr_tracking = 0x30; buffer[0] = MAX17048_RESET_UPPER_BYTE; buffer[1] = MAX17048_RESET_LOWER_BYTE; @@ -1480,7 +1558,7 @@ sl_status_t max17048_force_quick_start(void) { sl_status_t status; -#if !MAX17048_CONFIG_ENABLE_HW_QSTRT +#if !MAX17048_ENABLE_HW_QSTRT uint8_t buffer[2]; // Lower byte of MODE is not implemented; writing to it has no effect. @@ -1494,17 +1572,19 @@ sl_status_t max17048_force_quick_start(void) buffer[0] = MAX17048_MODE_QUICK_START; status = max17048_write_register(MAX17048_MODE, buffer); #else + +#if defined(MAX17048_ENABLE_QSTRT_PORT) && defined(MAX17048_ENABLE_QSTRT_PIN) // Assert GPIO pin connected to QSTRT and delay 1 ms. - GPIO_PinOutSet(MAX17048_CONFIG_ENABLE_QSTRT_PORT, - MAX17048_CONFIG_ENABLE_QSTRT_PIN); + digital_out_high(&fuel_gauge.qstrt_pin); +#endif - status = sl_sleeptimer_start_timer_ms(&max17048_quick_start_timer_handle, + status = sl_sleeptimer_start_timer_ms(&fuel_gauge.quick_start_timer_handle, 1, max17048_quick_start_callback, (void *)NULL, 0, 0); -#endif /* MAX17048_CONFIG_ENABLE_HW_QSTRT */ +#endif /* MAX17048_ENABLE_HW_QSTRT */ return status; } @@ -1515,14 +1595,8 @@ sl_status_t max17048_force_quick_start(void) sl_status_t max17048_load_model(const uint8_t *model) { sl_status_t status; - - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - uint8_t buffer[2]; uint8_t i2c_write_data[65]; - uint8_t i2c_read_data[1]; - uint8_t i; if (model == NULL) { return SL_STATUS_NULL_POINTER; @@ -1536,45 +1610,46 @@ sl_status_t max17048_load_model(const uint8_t *model) if (status != SL_STATUS_OK) { return status; } - // Write the model - seq.addr = MAX17048_I2C_ADDRESS << 1; - seq.flags = I2C_FLAG_WRITE; + // Write the model // Copy model and table start address into transfer buffer i2c_write_data[0] = MAX17048_TABLE; - - for (i = 0; i < 64; i++) { + for (uint8_t i = 0; i < 64; i++) { i2c_write_data[i + 1] = model[i]; } - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 65; - - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; - /* * Invoke sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1) * to prevent the EFM32/EFR32 from entering energy mode EM2 * or lower during I2C bus activity. */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); #endif - result = I2CSPM_Transfer(max17048_i2cspm_instance, &seq); +#endif + + if (I2C_MASTER_SUCCESS != i2c_master_write(&fuel_gauge.i2c, + i2c_write_data, + sizeof(i2c_write_data))) { + return SL_STATUS_TRANSMIT; + } + return SL_STATUS_OK; /* * Call sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1) * to remove the requirement to remain in EM1 or higher * after I2C bus activity is complete. */ -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#if (MAX17048_ENABLE_POWER_MANAGER == 1) +#if (defined(SLI_SI917)) + sl_si91x_power_manager_remove_ps_requirement(SL_SI91X_POWER_MANAGER_PS1); +#else sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); #endif - - if (result != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } +#endif // Lock and load the new model buffer[0] = 0x0; diff --git a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_driver.h b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_driver.h index 4136b546..24394241 100644 --- a/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_driver.h +++ b/driver/public/silabs/gnss_max_m10s/inc/gnss_max_m10s_driver.h @@ -57,7 +57,6 @@ extern "C" { #define TX_LEN 2 ///< Write buffer length 2 bytes #define RD_BUF 6 ///< Read buffer length 6 bytes #define WR_BUF 1 ///< Write buffer length 1 byte -// #define I2C_BASE I2C2 ///< Value of I2C base #define MS_DELAY_COUNTER 4600 ///< Value of delay counter for milli seconds delay #define MAX_PAYLOAD_SIZE 276 ///< Value of maximum payload size for UBX #define UBX_NAV_PVT_LEN 92 ///< Value for position/velocity/time type UBX packet length diff --git a/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c index 5fa16014..04b8961d 100644 --- a/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c +++ b/driver/public/silabs/gnss_max_m10s/src/gnss_max_m10s_driver.c @@ -1603,7 +1603,8 @@ static void gnss_max_m10s_process(sl_max_m10s_cfg_data_t *gnss_cfg_data, uint32_t gnss_max_m10s_milli_sec() { - return sl_sleeptimer_get_tick_count(); + uint32_t tickcount = sl_sleeptimer_get_tick_count(); + return sl_sleeptimer_tick_to_ms(tickcount); } static uint16_t gnss_max_m10s_file_buffer_space_available( diff --git a/driver/public/silabs/hr_po_max30101_max32664/config/sparkfun_max30101_max32664_config.h b/driver/public/silabs/hr_po_max30101_max32664/config/sparkfun_max30101_max32664_config.h index c011fb95..3120de9d 100644 --- a/driver/public/silabs/hr_po_max30101_max32664/config/sparkfun_max30101_max32664_config.h +++ b/driver/public/silabs/hr_po_max30101_max32664/config/sparkfun_max30101_max32664_config.h @@ -37,10 +37,30 @@ #define BIO_HUB_CONFIG_H #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN_MAX30101 I2C Configuration + +// SPARKFUN_MAX30101 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_MAX30101_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_MAX30101_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + // <<< sl:start pin_tool >>> // CONFIG_BIO_HUB_RESET diff --git a/driver/public/silabs/hr_po_max30101_max32664/inc/sparkfun_max30101_max32664.h b/driver/public/silabs/hr_po_max30101_max32664/inc/sparkfun_max30101_max32664.h index 78a5cf03..de83357e 100644 --- a/driver/public/silabs/hr_po_max30101_max32664/inc/sparkfun_max30101_max32664.h +++ b/driver/public/silabs/hr_po_max30101_max32664/inc/sparkfun_max30101_max32664.h @@ -39,6 +39,7 @@ #define SPARKFUN_BIO_SENSOR_HUB_LIBRARY_H_ #include +#include "drv_i2c_master.h" /***************************************************************************//** * @addtogroup MAX32664 @@ -321,7 +322,7 @@ typedef struct { * * @return SL_STATUS_OK if successful. Error code otherwise. ******************************************************************************/ -sl_status_t bio_hub_init(sl_i2cspm_t *i2cspm_instance, uint8_t address); +sl_status_t bio_hub_init(mikroe_i2c_handle_t i2cspm_instance, uint8_t address); /***************************************************************************//** * @brief @@ -341,7 +342,7 @@ sl_status_t bio_hub_init(sl_i2cspm_t *i2cspm_instance, uint8_t address); * * @return SL_STATUS_OK if successful. Error code otherwise. ******************************************************************************/ -sl_status_t bio_hub_init_bootloader_mode(sl_i2cspm_t *i2cspm_instance, +sl_status_t bio_hub_init_bootloader_mode(mikroe_i2c_handle_t i2cspm_instance, uint8_t address); /***************************************************************************//** diff --git a/driver/public/silabs/hr_po_max30101_max32664/src/sparkfun_max30101_max32664.c b/driver/public/silabs/hr_po_max30101_max32664/src/sparkfun_max30101_max32664.c index ab154161..c308d364 100644 --- a/driver/public/silabs/hr_po_max30101_max32664/src/sparkfun_max30101_max32664.c +++ b/driver/public/silabs/hr_po_max30101_max32664/src/sparkfun_max30101_max32664.c @@ -39,10 +39,8 @@ #include #include "sl_status.h" #include "sl_sleeptimer.h" -#include "sl_i2cspm.h" - -#include "sparkfun_max30101_max32664_config.h" #include "sparkfun_max30101_max32664.h" +#include "sparkfun_max30101_max32664_config.h" #define BIO_HUB_ADDRESS 0x55 @@ -64,8 +62,7 @@ #define NO_WRITE 0x00 // Variables ------------ -static sl_i2cspm_t *bio_hub_i2cspm_instance = NULL; -static uint8_t i2c_address = BIO_HUB_ADDRESS; +static i2c_master_t bio_hub; static bio_hub_algo_mode_t user_selected_mode; static uint8_t sample_rate = 100; @@ -129,7 +126,7 @@ static sl_status_t read_fill_array(uint8_t family_byte, * * @return SL_STATUS_OK if successful. Error code otherwise. ******************************************************************************/ -sl_status_t bio_hub_init(sl_i2cspm_t *i2cspm_instance, uint8_t address) +sl_status_t bio_hub_init(mikroe_i2c_handle_t i2cspm_instance, uint8_t address) { uint8_t response_byte; sl_status_t sc; @@ -138,9 +135,25 @@ sl_status_t bio_hub_init(sl_i2cspm_t *i2cspm_instance, uint8_t address) return SL_STATUS_NULL_POINTER; } - bio_hub_i2cspm_instance = i2cspm_instance; + bio_hub.handle = i2cspm_instance; + + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + if (address) { - i2c_address = address; + i2c_cfg.addr = address; + } else { + i2c_cfg.addr = BIO_HUB_ADDRESS; + } + + i2c_cfg.timeout_pass_count = 0; + +#if (SPARKFUN_MAX30101_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_MAX30101_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&bio_hub, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_FAIL; } // The following function initializes the sensor. To place the MAX32664 into @@ -1396,7 +1409,7 @@ sl_status_t bio_hub_read_register_accel(uint8_t reg_addr, uint8_t *reg_cont) ******************************************************************************/ sl_status_t bio_hub_get_afe_attributes_max30101(bio_hub_sensor_attr_t *max_attr) { - uint8_t temp_array[2]; + uint8_t temp_array[2] = { 0x00 }; sl_status_t sc; if (max_attr == NULL) { @@ -1428,7 +1441,7 @@ sl_status_t bio_hub_get_afe_attributes_max30101(bio_hub_sensor_attr_t *max_attr) sl_status_t bio_hub_get_afe_attributes_accelerometer( bio_hub_sensor_attr_t *max_attr) { - uint8_t temp_array[2]; + uint8_t temp_array[2] = { 0x00 }; sl_status_t sc; if (max_attr == NULL) { @@ -1804,41 +1817,31 @@ sl_status_t bio_hub_set_num_pages(uint8_t total_pages) ******************************************************************************/ sl_status_t bio_hub_erase_flash(void) { - I2C_TransferSeq_TypeDef seq; uint8_t buf[2]; uint8_t status; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - buf[0] = BOOTLOADER_FLASH; buf[1] = ERASE_FLASH; - // Write buffer - seq.buf[0].data = buf; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + buf, + 2)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = &status; - seq.buf[0].len = 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + &status, + 1)) { return SL_STATUS_TRANSMIT; } - return status == 0 ? SL_STATUS_OK:SL_STATUS_FAIL; + + return (status == 0) ? SL_STATUS_OK : SL_STATUS_FAIL; } /***************************************************************************//** @@ -2180,37 +2183,26 @@ static sl_status_t read_version(uint8_t family, uint8_t index, bio_hub_version_t *vers) { - I2C_TransferSeq_TypeDef seq; uint8_t buf[4]; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - buf[0] = family; buf[1] = index; - // Write buffer - seq.buf[0].data = buf; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + buf, + 2)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = buf; - seq.buf[0].len = 4; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + buf, + 4)) { return SL_STATUS_TRANSMIT; } @@ -2238,42 +2230,33 @@ static sl_status_t enable_write(uint8_t family_byte, uint8_t index_byte, uint8_t enable_byte) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[3]; uint8_t statusByte; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = enable_byte; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 3; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 3)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(ENABLE_CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - // Read buffer - seq.buf[0].data = &statusByte; - seq.buf[0].len = 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + &statusByte, + 1)) { return SL_STATUS_TRANSMIT; } - return statusByte == 0 ? SL_STATUS_OK:SL_STATUS_TRANSMIT; + + return (statusByte == 0) ? SL_STATUS_OK : SL_STATUS_TRANSMIT; } /***************************************************************************//** @@ -2288,42 +2271,34 @@ static sl_status_t write_byte(uint8_t family_byte, uint8_t index_byte, uint8_t write_byte) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[3]; uint8_t statusByte; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = write_byte; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 3; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 3)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - // Read buffer - seq.buf[0].data = &statusByte; - seq.buf[0].len = 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + &statusByte, + 1)) { return SL_STATUS_TRANSMIT; } - return statusByte == 0 ? SL_STATUS_OK:SL_STATUS_TRANSMIT; + + return (statusByte == 0) ? SL_STATUS_OK : SL_STATUS_TRANSMIT; } /***************************************************************************//** @@ -2339,43 +2314,34 @@ static sl_status_t write_byte2(uint8_t family_byte, uint8_t write_byte, uint8_t write_val) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[4]; uint8_t statusByte; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = write_byte; write_buf[3] = write_val; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 4; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 4)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = &statusByte; - seq.buf[0].len = 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + &statusByte, + 1)) { return SL_STATUS_TRANSMIT; } - return statusByte == 0 ? SL_STATUS_OK:SL_STATUS_TRANSMIT; + + return (statusByte == 0) ? SL_STATUS_OK : SL_STATUS_TRANSMIT; } /***************************************************************************//** @@ -2391,43 +2357,34 @@ static sl_status_t write_long_bytes(uint8_t family_byte, const int32_t *write_val, const size_t size) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[(size * 4) + 3]; uint8_t statusByte; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = write_byte; memcpy(&write_buf[3], write_val, size * 4); // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = (size * 4) + 3; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + (size * 4) + 3)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = &statusByte; - seq.buf[0].len = 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + &statusByte, + 1)) { return SL_STATUS_TRANSMIT; } - return statusByte == 0 ? SL_STATUS_OK:SL_STATUS_TRANSMIT; + + return (statusByte == 0) ? SL_STATUS_OK : SL_STATUS_TRANSMIT; } /***************************************************************************//** @@ -2443,43 +2400,34 @@ static sl_status_t write_bytes(uint8_t family_byte, const uint8_t *write_val, size_t size) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[size + 3]; uint8_t statusByte; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = write_byte; memcpy(&write_buf[3], write_val, size); // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = size + 3; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + size + 3)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = &statusByte; - seq.buf[0].len = 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + &statusByte, + 1)) { return SL_STATUS_TRANSMIT; } - return statusByte == 0 ? SL_STATUS_OK:SL_STATUS_TRANSMIT; + + return (statusByte == 0) ? SL_STATUS_OK : SL_STATUS_TRANSMIT; } /***************************************************************************//** @@ -2495,43 +2443,35 @@ static sl_status_t read_byte(uint8_t family_byte, uint8_t index_byte, uint8_t *byte_read) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[2]; uint8_t read_buf[2]; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 2)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = read_buf; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + read_buf, + 2)) { return SL_STATUS_TRANSMIT; } + if (read_buf[0]) { return SL_STATUS_IO; // Return the error, see: read_status_byte_value_t } + *byte_read = read_buf[1]; return SL_STATUS_OK; } @@ -2549,44 +2489,37 @@ static sl_status_t read_byte2(uint8_t family_byte, uint8_t write_byte, uint8_t *byte_read) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[3]; uint8_t read_buf[2]; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = write_byte; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 3; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 3)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - // Read buffer - seq.buf[0].data = read_buf; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + read_buf, + 2)) { return SL_STATUS_TRANSMIT; } + if (read_buf[0]) { return SL_STATUS_IO; // Return the error, see: read_status_byte_value_t } + *byte_read = read_buf[1]; return SL_STATUS_OK; } @@ -2596,37 +2529,27 @@ static sl_status_t read_fill_array(uint8_t family_byte, uint8_t num_of_reads, uint8_t *array) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[2]; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_WRITE; - write_buf[0] = family_byte; write_buf[1] = index_byte; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 2)) { return SL_STATUS_TRANSMIT; } sl_sleeptimer_delay_millisecond(CMD_DELAY); - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = array; - seq.buf[0].len = num_of_reads; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + array, + num_of_reads)) { return SL_STATUS_TRANSMIT; } return SL_STATUS_OK; @@ -2649,25 +2572,20 @@ static sl_status_t read_multiple_bytes_int(uint8_t family_byte, const size_t num_of_reads, int32_t *user_array) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[3]; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = write_byte; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 3; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 3)) { return SL_STATUS_TRANSMIT; } @@ -2676,16 +2594,12 @@ static sl_status_t read_multiple_bytes_int(uint8_t family_byte, if ((num_of_reads * 4) < 255) { uint8_t read_buf[(num_of_reads * 4) + 1]; - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = read_buf; - seq.buf[0].len = (num_of_reads * 4) + 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + read_buf, + (num_of_reads * 4) + 1)) { return SL_STATUS_TRANSMIT; } + if (read_buf[0]) { return SL_STATUS_IO; // Return the error, see: read_status_byte_value_t } @@ -2693,6 +2607,7 @@ static sl_status_t read_multiple_bytes_int(uint8_t family_byte, } else { return SL_STATUS_WOULD_OVERFLOW; } + return SL_STATUS_OK; } @@ -2713,25 +2628,20 @@ static sl_status_t read_multiple_bytes(uint8_t family_byte, const size_t num_of_reads, uint8_t *user_array) { - I2C_TransferSeq_TypeDef seq; uint8_t write_buf[3]; - if (bio_hub_i2cspm_instance == NULL) { + if (bio_hub.handle == NULL) { return SL_STATUS_NULL_POINTER; } - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - write_buf[0] = family_byte; write_buf[1] = index_byte; write_buf[2] = write_byte; // Write buffer - seq.buf[0].data = write_buf; - seq.buf[0].len = 3; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&bio_hub, + write_buf, + 3)) { return SL_STATUS_TRANSMIT; } @@ -2740,22 +2650,20 @@ static sl_status_t read_multiple_bytes(uint8_t family_byte, if (num_of_reads < 255) { uint8_t read_buf[num_of_reads + 1]; - seq.addr = i2c_address << 1; - seq.flags = I2C_FLAG_READ; - - // Read buffer - seq.buf[0].data = read_buf; - seq.buf[0].len = num_of_reads + 1; - - if (I2CSPM_Transfer(bio_hub_i2cspm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&bio_hub, + read_buf, + num_of_reads + 1)) { return SL_STATUS_TRANSMIT; } + if (read_buf[0]) { return SL_STATUS_IO; // Return the error, see: read_status_byte_value_t } + memcpy(user_array, &read_buf[1], num_of_reads); - return SL_STATUS_OK; } else { return SL_STATUS_WOULD_OVERFLOW; } + + return SL_STATUS_OK; } diff --git a/driver/public/silabs/human_presence_ak9753/config/sparkfun_ak9753_config.h b/driver/public/silabs/human_presence_ak9753/config/sparkfun_ak9753_config.h index 4b934a3e..c8c90479 100644 --- a/driver/public/silabs/human_presence_ak9753/config/sparkfun_ak9753_config.h +++ b/driver/public/silabs/human_presence_ak9753/config/sparkfun_ak9753_config.h @@ -39,6 +39,10 @@ #ifndef SPARKFUN_AK9753_CONFIG_H_ #define SPARKFUN_AK9753_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -55,6 +59,24 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN AK9753 I2C Configuration + +// SPARKFUN AK9753 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_AK9753_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_AK9753_I2C_SPEED_MODE 0 + +// +// + // Address settings // Address of AK9753 sensor. @@ -96,4 +118,4 @@ extern "C" { } #endif -#endif /* SPARKFUN_AK9753_CONFIG_H_ */ +#endif // SPARKFUN_AK9753_CONFIG_H_ diff --git a/driver/public/silabs/human_presence_ak9753/inc/sparkfun_ak9753.h b/driver/public/silabs/human_presence_ak9753/inc/sparkfun_ak9753.h index 05c9dd3b..d2305c17 100644 --- a/driver/public/silabs/human_presence_ak9753/inc/sparkfun_ak9753.h +++ b/driver/public/silabs/human_presence_ak9753/inc/sparkfun_ak9753.h @@ -40,11 +40,8 @@ #ifndef SPARKFUN_AK9753_H_ #define SPARKFUN_AK9753_H_ -#include "em_gpio.h" -#include "gpiointerrupt.h" #include "sl_status.h" -#include "sl_i2cspm.h" -#include "sparkfun_ak9753_platform.h" +#include "drv_i2c_master.h" #include "sparkfun_ak9753_config.h" #if (defined(SL_CATALOG_POWER_MANAGER_PRESENT)) @@ -165,7 +162,7 @@ typedef struct * Structure to store the sensor configuration ******************************************************************************/ typedef struct { - sl_i2cspm_t *sparkfun_ak9753_i2cspm_instance; + mikroe_i2c_handle_t i2cspm_instance; uint8_t I2C_address; sparkfun_ak9753_cutoff_freq_t cut_off_freq; sparkfun_ak9753_mode_t mode; @@ -898,4 +895,4 @@ sl_status_t sparkfun_ak9753_is_interrupt(bool *isIR13H, #ifdef __cplusplus } #endif -#endif /* SPARKFUN_AK9753_H_ */ +#endif // SPARKFUN_AK9753_H_ diff --git a/driver/public/silabs/human_presence_ak9753/src/sparkfun_ak9753.c b/driver/public/silabs/human_presence_ak9753/src/sparkfun_ak9753.c index 86dbdcd2..34e14506 100644 --- a/driver/public/silabs/human_presence_ak9753/src/sparkfun_ak9753.c +++ b/driver/public/silabs/human_presence_ak9753/src/sparkfun_ak9753.c @@ -37,24 +37,26 @@ ******************************************************************************/ #include -#include "sl_udelay.h" +#include "sl_sleeptimer.h" #include "sparkfun_ak9753.h" #include "sparkfun_ak9753_config.h" -#include "sparkfun_ak9753_platform.h" +#include "drv_digital_out.h" #ifdef __cplusplus extern "C" { #endif // instance for I2C communication -sl_i2cspm_t *sparkfun_ak9753_i2cpsm_instance = NULL; +i2c_master_t ak9753_i2c; +pin_name_t pdn_name; +digital_out_t pdn_out; /***************************************************************************//** * Local Variables ******************************************************************************/ static sparkfun_ak9753_config_t sparkfun_ak9753_cfg = { .I2C_address = SPARKFUN_AK9753_ADDR, - .sparkfun_ak9753_i2cspm_instance = NULL, + .i2cspm_instance = NULL, .cut_off_freq = SPARKFUN_AK975X_FREQ_8_8HZ, .mode = SPARKFUN_AK975X_MODE_0, .upper_threshold13 = 0x00, @@ -68,6 +70,66 @@ static sparkfun_ak9753_config_t sparkfun_ak9753_cfg = { .PDN_present = false }; /* Structure to hold AK9753 driver config */ +/***************************************************************************//** +* Read register value +*******************************************************************************/ +static sl_status_t sparkfun_ak9753_platform_read_register(uint8_t addr, + uint8_t *pdata) +{ + if ((pdata == NULL) || (ak9753_i2c.handle == NULL)) { + return SL_STATUS_INVALID_PARAMETER; + } else { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&ak9753_i2c, + &addr, + 1, + pdata, + 1)) { + return SL_STATUS_TRANSMIT; + } + } + return SL_STATUS_OK; +} + +/***************************************************************************//** +* Write into register +*******************************************************************************/ +sl_status_t sparkfun_ak9753_platform_write_register(uint8_t addr, + uint8_t data) +{ + if (ak9753_i2c.handle == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + + uint8_t i2c_write_data[2] = { addr, data }; + if (I2C_MASTER_SUCCESS != i2c_master_write(&ak9753_i2c, + i2c_write_data, + 2)) { + return SL_STATUS_TRANSMIT; + } + return SL_STATUS_OK; +} + +/***************************************************************************//** +* Read multiple bytes from sensor +*******************************************************************************/ +sl_status_t sparkfun_ak9753_platform_read_blocking_register(uint8_t addr, + uint8_t *pdata, + uint8_t len) +{ + if ((pdata == NULL) || (ak9753_i2c.handle == NULL)) { + return SL_STATUS_INVALID_PARAMETER; + } else { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&ak9753_i2c, + &addr, + 1, + pdata, + len)) { + return SL_STATUS_TRANSMIT; + } + } + return SL_STATUS_OK; +} + /***************************************************************************//** * Return the version information of the MMA8452Q. *******************************************************************************/ @@ -117,12 +179,10 @@ sl_status_t sparkfun_ak9753_set_mode(sparkfun_ak9753_mode_t mode) *******************************************************************************/ sl_status_t sparkfun_ak9753_power_down(void) { -#if (defined SPARKFUN_AK9753_CONFIG_PDN_PORT) \ - && (defined SPARKFUN_AK9753_CONFIG_PDN_PIN) - GPIO_PinOutClear(SPARKFUN_AK9753_CONFIG_PDN_PORT, - SPARKFUN_AK9753_CONFIG_PDN_PIN); - return SL_STATUS_OK; -#endif + if (sparkfun_ak9753_cfg.PDN_present) { + digital_out_low(&pdn_out); + return SL_STATUS_OK; + } return SL_STATUS_NOT_INITIALIZED; } @@ -131,12 +191,10 @@ sl_status_t sparkfun_ak9753_power_down(void) *******************************************************************************/ sl_status_t sparkfun_ak9753_power_up(void) { -#if (defined SPARKFUN_AK9753_CONFIG_PDN_PORT) \ - && (defined SPARKFUN_AK9753_CONFIG_PDN_PIN) - GPIO_PinOutSet(SPARKFUN_AK9753_CONFIG_PDN_PORT, - SPARKFUN_AK9753_CONFIG_PDN_PIN); - return SL_STATUS_OK; -#endif + if (sparkfun_ak9753_cfg.PDN_present) { + digital_out_high(&pdn_out); + return SL_STATUS_OK; + } return SL_STATUS_NOT_INITIALIZED; } @@ -225,8 +283,34 @@ sl_status_t sparkfun_ak9753_init( } // Update i2cspm instance - sparkfun_ak9753_i2cpsm_instance = - sparkfun_ak9753_config->sparkfun_ak9753_i2cspm_instance; + ak9753_i2c.handle = + sparkfun_ak9753_config->i2cspm_instance; + + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = sparkfun_ak9753_config->I2C_address; + +#if (SPARKFUN_AK9753_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_AK9753_I2C_SPEED_MODE; +#endif + +#if (defined SPARKFUN_AK9753_CONFIG_PDN_PORT) \ + && (defined SPARKFUN_AK9753_CONFIG_PDN_PIN) + pdn_name = hal_gpio_pin_name(SPARKFUN_AK9753_CONFIG_PDN_PORT, + SPARKFUN_AK9753_CONFIG_PDN_PIN); + digital_out_init(&pdn_out, pdn_name); + digital_out_high(&pdn_out); + sparkfun_ak9753_config->PDN_present = true; +#endif + + if (i2c_master_open(&ak9753_i2c, &i2c_cfg) + == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&ak9753_i2c, i2c_cfg.speed); + i2c_master_set_timeout(&ak9753_i2c, 0); uint8_t device_id = 0; sl_status_t sc = SL_STATUS_OK; @@ -261,18 +345,6 @@ sl_status_t sparkfun_ak9753_init( sc |= sparkfun_ak9753_get_dummy(); - if (sparkfun_ak9753_config->PDN_present - || sparkfun_ak9753_config->int_present) { - GPIOINT_Init(); -#if (defined SPARKFUN_AK9753_CONFIG_PDN_PORT) \ - && (defined SPARKFUN_AK9753_CONFIG_PDN_PIN) - GPIO_PinModeSet(SPARKFUN_AK9753_CONFIG_PDN_PORT, - SPARKFUN_AK9753_CONFIG_PDN_PIN, - gpioModePushPull, - 1); -#endif - } - if (sc != SL_STATUS_OK) { return SL_STATUS_TRANSMIT; } @@ -284,16 +356,6 @@ sl_status_t sparkfun_ak9753_init( *******************************************************************************/ sl_status_t sparkfun_ak9753_deinit(void) { - if (sparkfun_ak9753_cfg.PDN_present || sparkfun_ak9753_cfg.int_present) { - GPIOINT_Init(); -#if (defined SPARKFUN_AK9753_CONFIG_PDN_PORT) \ - && (defined SPARKFUN_AK9753_CONFIG_PDN_PIN) - GPIO_PinModeSet(SPARKFUN_AK9753_CONFIG_PDN_PORT, - SPARKFUN_AK9753_CONFIG_PDN_PIN, - gpioModeDisabled, - 1); -#endif - } return SL_STATUS_OK; } @@ -317,7 +379,7 @@ sl_status_t sparkfun_ak9753_get_ir1_data(int16_t *measurement_data) } sl_status_t sc = SL_STATUS_OK; - uint8_t temp[2]; + uint8_t temp[2] = { 0x00, 0x00 }; sc = sparkfun_ak9753_platform_read_blocking_register(SPARKFUN_AK975X_IR1, temp, @@ -337,7 +399,7 @@ sl_status_t sparkfun_ak9753_get_ir2_data(int16_t *measurement_data) } sl_status_t sc = SL_STATUS_OK; - uint8_t temp[2]; + uint8_t temp[2] = { 0x00, 0x00 }; sc = sparkfun_ak9753_platform_read_blocking_register(SPARKFUN_AK975X_IR2, temp, @@ -357,7 +419,7 @@ sl_status_t sparkfun_ak9753_get_ir3_data(int16_t *measurement_data) } sl_status_t sc = SL_STATUS_OK; - uint8_t temp[2]; + uint8_t temp[2] = { 0x00, 0x00 }; sc = sparkfun_ak9753_platform_read_blocking_register(SPARKFUN_AK975X_IR3, temp, @@ -377,7 +439,7 @@ sl_status_t sparkfun_ak9753_get_ir4_data(int16_t *measurement_data) } sl_status_t sc = SL_STATUS_OK; - uint8_t temp[2]; + uint8_t temp[2] = { 0x00, 0x00 }; sc = sparkfun_ak9753_platform_read_blocking_register(SPARKFUN_AK975X_IR4, temp, @@ -397,7 +459,7 @@ sl_status_t sparkfun_ak9753_get_raw_temp(uint16_t *raw_temperature_data) } sl_status_t sc = SL_STATUS_OK; - uint8_t value[2]; + uint8_t value[2] = { 0x00, 0x00 }; sc = sparkfun_ak9753_platform_read_blocking_register(SPARKFUN_AK975X_TMP, value, @@ -525,28 +587,28 @@ sl_status_t sparkfun_ak9753_set_threshold_eeprom_ir24(bool height, // low byte is at adresse 0x55 OR 0X57 11+[6:0] for ETH24H OR ETH24L sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH24H_LOW, threshold_value); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EKEY, SPARKFUN_AK975X_EKEY_ON); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH24H_HIGH, h); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); } else { sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EKEY, SPARKFUN_AK975X_EKEY_ON); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH24L_LOW, threshold_value); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EKEY, SPARKFUN_AK975X_EKEY_ON); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH24L_HIGH, h); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); } sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_ECNTL1, current_mode); @@ -679,7 +741,7 @@ sl_status_t sparkfun_ak9753_set_threshold_eeprom_ir13(bool height, // low byte is at adresse 0x52 OR 0X54 11+[6:0] for ETH13H OR ETH13L sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH13H_LOW, threshold_value); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EKEY, SPARKFUN_AK975X_EKEY_ON); @@ -687,7 +749,7 @@ sl_status_t sparkfun_ak9753_set_threshold_eeprom_ir13(bool height, // high byte is at adresse 0x51 OR 0X53 11+[6:0] for ETH13H OR ETH13L sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH13H_HIGH, h); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); } else { sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EKEY, SPARKFUN_AK975X_EKEY_ON); @@ -695,7 +757,7 @@ sl_status_t sparkfun_ak9753_set_threshold_eeprom_ir13(bool height, // low byte is at address 0x52 OR 0X54 11+[6:0] for ETH13H OR ETH13L sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH13L_LOW, threshold_value); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EKEY, SPARKFUN_AK975X_EKEY_ON); @@ -703,7 +765,7 @@ sl_status_t sparkfun_ak9753_set_threshold_eeprom_ir13(bool height, // high byte is at adresse 0x51 OR 0X53 11+[6:0] for ETH13H OR ETH13L sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EETH13L_HIGH, h); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); } sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_ECNTL1, @@ -816,7 +878,7 @@ sl_status_t sparkfun_ak9753_set_hysteresis_eeprom_ir24(uint8_t hysteresis_value) // allow EEPROM writing sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EEHYS24, hysteresis_value); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_ECNTL1, current_mode); @@ -911,7 +973,7 @@ sl_status_t sparkfun_ak9753_set_hysteresis_eeprom_ir13(uint8_t hysteresis_value) // allow EEPROM writing sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_EEHYS13, hysteresis_value); - sl_udelay_wait(15000); + sl_sleeptimer_delay_millisecond(15); sc |= sparkfun_ak9753_platform_write_register(SPARKFUN_AK975X_ECNTL1, current_mode); diff --git a/driver/public/silabs/human_presence_ak9753/src/sparkfun_ak9753_platform.c b/driver/public/silabs/human_presence_ak9753/src/sparkfun_ak9753_platform.c deleted file mode 100644 index 1a9e1ea3..00000000 --- a/driver/public/silabs/human_presence_ak9753/src/sparkfun_ak9753_platform.c +++ /dev/null @@ -1,140 +0,0 @@ -/***************************************************************************//** - * @file sparkfun_ak9753_platform.c - * @brief ak9753 Platform Source file - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ - -#include -#include "sparkfun_ak9753_config.h" -#include "sparkfun_ak9753_platform.h" - -extern sl_i2cspm_t *sparkfun_ak9753_i2cpsm_instance; - -/***************************************************************************//** -* Read register value -*******************************************************************************/ -sl_status_t sparkfun_ak9753_platform_read_register(uint8_t addr, - uint8_t *pdata) -{ - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data; - - if ((pdata == NULL) || (sparkfun_ak9753_i2cpsm_instance == NULL)) { - return SL_STATUS_INVALID_PARAMETER; - } else { - seq.addr = SPARKFUN_AK9753_ADDR << 1; - seq.flags = I2C_FLAG_WRITE_READ; - - i2c_write_data = addr; - - /* Write buffer */ - seq.buf[0].data = &i2c_write_data; - seq.buf[0].len = 1; - - /* Read buffer */ - seq.buf[1].data = pdata; - seq.buf[1].len = 1; - - if (I2CSPM_Transfer(sparkfun_ak9753_i2cpsm_instance, - &seq) != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - return SL_STATUS_OK; - } -} - -/***************************************************************************//** -* Write into register -*******************************************************************************/ -sl_status_t sparkfun_ak9753_platform_write_register(uint8_t addr, - uint8_t data) -{ - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data[2]; - - if (sparkfun_ak9753_i2cpsm_instance == NULL) { - return SL_STATUS_INVALID_PARAMETER; - } - - seq.addr = SPARKFUN_AK9753_ADDR << 1; - seq.flags = I2C_FLAG_WRITE; - - i2c_write_data[0] = addr; - i2c_write_data[1] = data; - - /* Write buffer */ - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(sparkfun_ak9753_i2cpsm_instance, - &seq) != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - return SL_STATUS_OK; -} - -/***************************************************************************//** -* Read multiple bytes from sensor -*******************************************************************************/ -sl_status_t sparkfun_ak9753_platform_read_blocking_register(uint8_t addr, - uint8_t *pdata, - uint8_t len) -{ - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data; - - if ((pdata == NULL) || (sparkfun_ak9753_i2cpsm_instance == NULL)) { - return SL_STATUS_INVALID_PARAMETER; - } else { - seq.addr = SPARKFUN_AK9753_ADDR << 1; - seq.flags = I2C_FLAG_WRITE_READ; - - i2c_write_data = addr; - - /* Write buffer */ - seq.buf[0].data = &i2c_write_data; - seq.buf[0].len = 1; - - /* Read buffer */ - seq.buf[1].data = pdata; - seq.buf[1].len = len; - - if (I2CSPM_Transfer(sparkfun_ak9753_i2cpsm_instance, - &seq) != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - return SL_STATUS_OK; - } -} diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_dma_config.h b/driver/public/silabs/ir_array_amg88xx/config/sparkfun_amg88xx_config.h similarity index 65% rename from driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_dma_config.h rename to driver/public/silabs/ir_array_amg88xx/config/sparkfun_amg88xx_config.h index 63c0e673..070762e4 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_dma_config.h +++ b/driver/public/silabs/ir_array_amg88xx/config/sparkfun_amg88xx_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file adafruit_hxd8357d_config.h - * @brief Configuration file for Adafruit HXD8357D board. + * @file sparkfun_ir_array_amg88xx.h + * @brief Configuration file for Sparkfun ir array sensor. * @version 1.0.0 ******************************************************************************* * # License @@ -33,28 +33,39 @@ * as a demonstration for evaluation purposes only. This code will be maintained * at the sole discretion of Silicon Labs. ******************************************************************************/ -#ifndef ADAFRUIT_HXD8357D_CONFIG_H_ -#define ADAFRUIT_HXD8357D_CONFIG_H_ + +#ifndef SPARKFUN_AMG88XX_CONFIG_H_ +#define SPARKFUN_AMG88XX_CONFIG_H_ #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif +// <<< Use Configuration Wizard in Context Menu >>> -// <<< sl:start pin_tool >>> +//SPARKFUN AMG88XX I2C Configuration -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 0 -// [GPIO_HXD8357D_SPI_DC]$ +// SPARKFUN AMG88XX I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_AMG88XX_I2C_UC 0 -// <<< sl:end pin_tool >>> +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_AMG88XX_I2C_SPEED_MODE 0 +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// <<< sl:end pin_tool >>> #ifdef __cplusplus -extern "C" } #endif -#endif /* ADAFRUIT_HXD8357D_CONFIG_H_ */ +#endif /* SPARKFUN_AMG88XX_CONFIG_H_ */ \ No newline at end of file diff --git a/driver/public/silabs/ir_array_amg88xx/inc/ir_array_amg88xx.h b/driver/public/silabs/ir_array_amg88xx/inc/ir_array_amg88xx.h index 302f910e..31e5cd8a 100644 --- a/driver/public/silabs/ir_array_amg88xx/inc/ir_array_amg88xx.h +++ b/driver/public/silabs/ir_array_amg88xx/inc/ir_array_amg88xx.h @@ -39,8 +39,9 @@ #ifndef IR_ARRAY_AMG88XX_H_ #define IR_ARRAY_AMG88XX_H_ +#include #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" // ----------------------------------------------------------------------------- // Defines @@ -96,9 +97,9 @@ extern "C" { * @param I2C_address The used device address. * @param temp_scale Temperature scale. Can be "celsius" or "fahrenheit". ******************************************************************************/ -void amg88xx_init(sl_i2cspm_t *amg88xx_i2c_instance_init, - int16_t I2C_address, - enum temperature_scale_t temp_scale); +sl_status_t amg88xx_init(mikroe_i2c_handle_t amg88xx_i2c_instance_init, + uint8_t I2C_address, + enum temperature_scale_t temp_scale); /***************************************************************************//** * Sets temperature scale for temperature related functions. diff --git a/driver/public/silabs/ir_array_amg88xx/src/ir_array_amg88xx.c b/driver/public/silabs/ir_array_amg88xx/src/ir_array_amg88xx.c index 11c169dc..65cf568a 100644 --- a/driver/public/silabs/ir_array_amg88xx/src/ir_array_amg88xx.c +++ b/driver/public/silabs/ir_array_amg88xx/src/ir_array_amg88xx.c @@ -43,19 +43,21 @@ #include #include #include -#include "em_gpio.h" -#include "em_cmu.h" #include "sl_status.h" #include "ir_array_amg88xx.h" +#include "sparkfun_amg88xx_config.h" + +typedef struct { + i2c_master_t i2c; + uint8_t slave_address; + enum temperature_scale_t temperature_scale; +} ir_array_t; // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- -static uint16_t amg88xx_I2C_address = AMG88XX_ADDRESS_OPEN; - -static enum temperature_scale_t temperature_scale = CELSIUS; -static sl_i2cspm_t *amg88xx_I2C_instance = NULL; +static ir_array_t ir_array; // ----------------------------------------------------------------------------- // Local Functions @@ -75,26 +77,15 @@ static sl_status_t amg88xx_i2c_read(uint8_t register_address, uint8_t *rx_buffer, uint8_t number_of_bytes) { - // Transfer structure. - I2C_TransferSeq_TypeDef i2c_transfer; - I2C_TransferReturn_TypeDef result; - - // Initializing I2C transfer. - i2c_transfer.addr = (uint16_t) (amg88xx_I2C_address << 1); // Must write target address before reading. - i2c_transfer.flags = I2C_FLAG_WRITE_READ; - i2c_transfer.buf[0].data = ®ister_address; - i2c_transfer.buf[0].len = 1; - i2c_transfer.buf[1].data = rx_buffer; - i2c_transfer.buf[1].len = number_of_bytes; - - result = I2CSPM_Transfer(amg88xx_I2C_instance, &i2c_transfer); - - if (result == i2cTransferDone) { - return SL_STATUS_OK; - } else { - return SL_STATUS_FAIL; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&ir_array.i2c, + ®ister_address, + 1, + (uint8_t *)rx_buffer, + number_of_bytes)) { + return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } /***************************************************************************//** @@ -111,9 +102,6 @@ static sl_status_t amg88xx_i2c_write(uint8_t register_address, const uint8_t *tx_buffer, uint8_t number_of_bytes) { - // Transfer structure. - I2C_TransferSeq_TypeDef i2c_transfer; - I2C_TransferReturn_TypeDef result; uint8_t tx_buffer_with_address[I2C_BUFFER_SIZE + 1]; // Register address to write to. @@ -122,21 +110,12 @@ static sl_status_t amg88xx_i2c_write(uint8_t register_address, tx_buffer_with_address[i + 1] = tx_buffer[i]; } - // Initializing I2C transfer. - i2c_transfer.addr = (uint16_t) (amg88xx_I2C_address << 1); - i2c_transfer.flags = I2C_FLAG_WRITE; - i2c_transfer.buf[0].data = tx_buffer_with_address; - i2c_transfer.buf[0].len = number_of_bytes + 1; - i2c_transfer.buf[1].data = NULL; - i2c_transfer.buf[1].len = 0; - - result = I2CSPM_Transfer(amg88xx_I2C_instance, &i2c_transfer); - - if (result == i2cTransferDone) { - return SL_STATUS_OK; - } else { - return SL_STATUS_FAIL; + if (I2C_MASTER_SUCCESS != i2c_master_write(&ir_array.i2c, + tx_buffer_with_address, + number_of_bytes + 1)) { + return SL_STATUS_TRANSMIT; } + return SL_STATUS_OK; } /***************************************************************************//** @@ -227,13 +206,35 @@ static uint16_t convert_fahrenheit_to_raw(float degrees_F) /***************************************************************************//** * Initialise the periphery ******************************************************************************/ -void amg88xx_init(sl_i2cspm_t *amg88xx_i2c_instance_init, - int16_t I2C_address, - enum temperature_scale_t temp_scale) +sl_status_t amg88xx_init(mikroe_i2c_handle_t amg88xx_i2c_instance_init, + uint8_t I2C_address, + enum temperature_scale_t temp_scale) { - amg88xx_I2C_instance = amg88xx_i2c_instance_init; - amg88xx_I2C_address = I2C_address; - set_temperature_scale(temp_scale); + i2c_master_config_t ir_array_config; + + ir_array.i2c.handle = amg88xx_i2c_instance_init; + + i2c_master_configure_default(&ir_array_config); + + ir_array_config.addr = I2C_address; + ir_array.slave_address = ir_array_config.addr; + +#if (SPARKFUN_AMG88XX_I2C_UC == 1) + ir_array_config.speed = SPARKFUN_AMG88XX_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&ir_array.i2c, &ir_array_config) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_slave_address(&ir_array.i2c, ir_array.slave_address); + i2c_master_set_speed(&ir_array.i2c, ir_array_config.speed); + i2c_master_set_timeout(&ir_array.i2c, 0); + + ir_array.temperature_scale = temp_scale; + set_temperature_scale(ir_array.temperature_scale); + + return SL_STATUS_OK; } /***************************************************************************//** @@ -241,7 +242,7 @@ void amg88xx_init(sl_i2cspm_t *amg88xx_i2c_instance_init, ******************************************************************************/ void set_temperature_scale(enum temperature_scale_t temp_scale) { - temperature_scale = temp_scale; + ir_array.temperature_scale = temp_scale; } /***************************************************************************//** @@ -262,7 +263,7 @@ sl_status_t amg88xx_get_thermistor_temperature(float *thermistor_temperature) temperature = temperature * -1; } *thermistor_temperature = (float) (temperature * 0.0625); - if (temperature_scale == FAHRENHEIT) { + if (ir_array.temperature_scale == FAHRENHEIT) { *thermistor_temperature = (float) (*thermistor_temperature * 1.8 + 32); } } @@ -287,7 +288,7 @@ sl_status_t amg88xx_get_pixel_temperature(unsigned char pixel_number, int16_t temperature = 0; sl_status_t result = amg88xx_get_pixel_temperature_raw(pixel_number, &temperature); - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { *pixel_temperature = convert_raw_to_celsius(temperature); } else { *pixel_temperature = convert_raw_to_fahrenheit(temperature); @@ -317,7 +318,7 @@ sl_status_t amg88xx_get_sensor_array_temperatures( SENSOR_ARRAY_ROWS * SENSOR_ARRAY_COLUMNS * 2); while ((read_result == SL_STATUS_OK) && (i < SENSOR_ARRAY_COLUMNS)) { for (int j = 0; j < SENSOR_ARRAY_ROWS; j++) { - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { temperature_grid[i][j] = convert_raw_to_celsius( temperature_grid_raw[i][j]); } else { @@ -345,7 +346,8 @@ sl_status_t amg88xx_get_sensor_array_temperatures_raw( ******************************************************************************/ void amg88xx_set_i2c_address(uint16_t address) { - amg88xx_I2C_address = address; + ir_array.slave_address = address; + i2c_master_set_slave_address(&ir_array.i2c, ir_array.slave_address); } /***************************************************************************//** @@ -690,7 +692,7 @@ sl_status_t amg88xx_is_moving_average_enabled(bool *is_enabled) sl_status_t amg88xx_set_upper_interrupt_value(float degrees) { uint16_t temperature = 0; - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { temperature = convert_celsius_to_raw(degrees); } else { temperature = convert_fahrenheit_to_raw(degrees); @@ -711,7 +713,7 @@ sl_status_t amg88xx_set_upper_interrupt_value_raw(int16_t register_value) sl_status_t amg88xx_set_lower_interrupt_value(float degrees) { uint16_t temperature = 0; - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { temperature = convert_celsius_to_raw(degrees); } else { temperature = convert_fahrenheit_to_raw(degrees); @@ -732,7 +734,7 @@ sl_status_t amg88xx_set_lower_interrupt_value_raw(int16_t register_value) sl_status_t amg88xx_set_interrupt_hysteresis(float degrees) { uint16_t temperature = 0; - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { temperature = convert_celsius_to_raw(degrees); } else { temperature = convert_fahrenheit_to_raw(degrees); @@ -756,7 +758,7 @@ sl_status_t amg88xx_get_upper_interrupt_value(float *degrees) return result; } - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { *degrees = convert_raw_to_celsius(temperature); } else { *degrees = convert_raw_to_fahrenheit(temperature); @@ -780,7 +782,7 @@ sl_status_t amg88xx_get_lower_interrupt_value(float *degrees) return result; } - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { *degrees = convert_raw_to_celsius(temperature); } else { *degrees = convert_raw_to_fahrenheit(temperature); @@ -804,7 +806,7 @@ sl_status_t amg88xx_get_interrupt_hysteresis(float *degrees) return result; } - if (temperature_scale == CELSIUS) { + if (ir_array.temperature_scale == CELSIUS) { *degrees = convert_raw_to_celsius(temperature); } else { *degrees = convert_raw_to_fahrenheit(temperature); diff --git a/driver/public/silabs/ir_array_mlx90640/config/sparkfun_mlx90640_config.h b/driver/public/silabs/ir_array_mlx90640/config/sparkfun_mlx90640_config.h index 19f5f1e9..ac73c01c 100644 --- a/driver/public/silabs/ir_array_mlx90640/config/sparkfun_mlx90640_config.h +++ b/driver/public/silabs/ir_array_mlx90640/config/sparkfun_mlx90640_config.h @@ -40,23 +40,42 @@ extern "C" { #endif // <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN MLX90640 I2C Configuration + +// SPARKFUN MLX90640 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_MLX90640_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_MLX90640_I2C_SPEED_MODE 0 + +// +// + // Connection -// I2C Address <0x1..0x7E:0x1> +// I2C Address <0x1..0x7E:0x1> // Default: 0x33 -#define MLX90640_I2C_ADDRESS 0x33 +#define SPARKFUN_MLX90640_I2C_ADDRESS 0x33 // // User-Settings - -// Enable log +// Enable log // Default: 0 -#define MLX90640_CONFIG_ENABLE_LOG 0 +#define SPARKFUN_MLX90640_CONFIG_ENABLE_LOG 0 // + // <<< end of configuration section >>> #ifdef __cplusplus } #endif -#endif /* SPARKFUN_MLX90640_CONFIG_H_ */ +#endif // SPARKFUN_MLX90640_CONFIG_H_ diff --git a/driver/public/silabs/ir_array_mlx90640/inc/sparkfun_mlx90640.h b/driver/public/silabs/ir_array_mlx90640/inc/sparkfun_mlx90640.h index a558aa91..03b1d116 100644 --- a/driver/public/silabs/ir_array_mlx90640/inc/sparkfun_mlx90640.h +++ b/driver/public/silabs/ir_array_mlx90640/inc/sparkfun_mlx90640.h @@ -43,9 +43,14 @@ #include #include #include -#include "sl_i2cspm.h" #include "sl_status.h" +#include "drv_i2c_master.h" + +#ifdef __cplusplus +extern "C" { +#endif + // ----------------------------------------------------------------------------- // Macros and Typedefs // ----------------------------------------------------------------------------- @@ -112,7 +117,7 @@ typedef struct * * @param[in] i2cspm_instace - Pointer to the I2CSPM instance ******************************************************************************/ -sl_status_t sparkfun_mlx90640_init(sl_i2cspm_t *i2cspm_instance, +sl_status_t sparkfun_mlx90640_init(mikroe_i2c_handle_t i2c_instance, uint8_t i2c_addr); /***************************************************************************//** @@ -128,13 +133,13 @@ sl_status_t sparkfun_mlx90640_get_image_array(float *pixel_array); /***************************************************************************//** * Change slave address to the value of "new_addr" ******************************************************************************/ -sl_status_t sparkfun_mlx90640_set_slave_addr(sl_i2cspm_t *i2cspm_instance, +sl_status_t sparkfun_mlx90640_set_slave_addr(mikroe_i2c_handle_t i2c_instance, uint8_t new_addr); /***************************************************************************//** * Changes which I2C bus and slave address does the driver use ******************************************************************************/ -sl_status_t sparkfun_mlx90640_change_devices(sl_i2cspm_t *i2cspm_instance, +sl_status_t sparkfun_mlx90640_change_devices(mikroe_i2c_handle_t i2c_instance, uint8_t new_addr); /***************************************************************************//** @@ -326,4 +331,7 @@ sl_status_t sparkfun_mlx90640_bad_pixels_correction(uint16_t *pixels, int mode, paramsMLX90640 *params); -#endif /* SPARKFUN_MLX90640_H_ */ +#ifdef __cplusplus +} +#endif +#endif // SPARKFUN_MLX90640_H_ diff --git a/driver/public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640.c b/driver/public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640.c index c1bf34b7..5428ce4f 100644 --- a/driver/public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640.c +++ b/driver/public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640.c @@ -42,14 +42,15 @@ #include "app_assert.h" #include "sparkfun_mlx90640.h" -#include "sparkfun_mlx90640_i2c.h" #include "sparkfun_mlx90640_config.h" -#if MLX90640_CONFIG_ENABLE_LOG -#include "app_log.h" +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG +#define app_printf(...) printf(__VA_ARGS__) #endif static paramsMLX90640 mlx90640; +static i2c_master_t mlx90640_i2c; + // ----------------------------------------------------------------------------- // Static Local function declarations // ----------------------------------------------------------------------------- @@ -77,6 +78,12 @@ static float get_median(float *values, int n); static int is_pixel_bad(uint16_t pixel, paramsMLX90640 *params); static int validate_frame_data(uint16_t *frame_data); static int validate_aux_data(uint16_t *aux_data); +static sl_status_t sparkfun_mlx90640_i2c_read(uint16_t startAddress, + uint16_t nMemAddressRead, + uint16_t *data); +static sl_status_t sparkfun_mlx90640_i2c_write(uint16_t writeAddress, + uint16_t data); +static sl_status_t sparkfun_mlx90640_i2c_general_reset(void); // ----------------------------------------------------------------------------- // Function definitions @@ -85,27 +92,35 @@ static int validate_aux_data(uint16_t *aux_data); /***************************************************************************//** * Initializes the MLX90640 driver ******************************************************************************/ -sl_status_t sparkfun_mlx90640_init(sl_i2cspm_t *i2cspm_instance, +sl_status_t sparkfun_mlx90640_init(mikroe_i2c_handle_t i2c_instance, uint8_t i2c_addr) { + i2c_master_config_t mlx90640_cfg; int status; uint8_t bad_pixel_count = 0; uint16_t eeMLX90640[832]; - if (i2c_addr != SPARKFUN_MLX90640_DEFAULT_I2C_ADDR) { - status = sparkfun_mlx90640_set_slave_addr(i2cspm_instance, i2c_addr); - if (status == SL_STATUS_NOT_INITIALIZED) { - return SL_STATUS_NOT_INITIALIZED; - } + // Configure default i2csmp instance + mlx90640_i2c.handle = i2c_instance; + + i2c_master_configure_default(&mlx90640_cfg); + mlx90640_cfg.addr = i2c_addr; + +#if (SPARKFUN_MLX90640_I2C_UC == 1) + mlx90640_cfg.speed = SPARKFUN_MLX90640_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&mlx90640_i2c, &mlx90640_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; } - status = sparkfun_mlx90640_i2c_init(i2cspm_instance, i2c_addr); - app_assert_status(status); + i2c_master_set_speed(&mlx90640_i2c, mlx90640_cfg.speed); + i2c_master_set_timeout(&mlx90640_i2c, 0); status = sparkfun_mlx90640_dump_ee(eeMLX90640); - if (status != 0) { -#if MLX90640_CONFIG_ENABLE_LOG - app_log("\nFailed to load system parameters of MLX90640\n"); + if (status != SL_STATUS_OK) { +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG + app_printf("\nFailed to load system parameters of MLX90640\n"); #endif return SL_STATUS_NOT_INITIALIZED; } @@ -113,8 +128,8 @@ sl_status_t sparkfun_mlx90640_init(sl_i2cspm_t *i2cspm_instance, bad_pixel_count = sparkfun_mlx90640_extract_parameters(eeMLX90640, &mlx90640); if (bad_pixel_count != 0) { -#if MLX90640_CONFIG_ENABLE_LOG - app_log("\nNumber of pixel errors: %d\n", bad_pixel_count); +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG + app_printf("\nNumber of pixel errors: %d\n", bad_pixel_count); #endif } @@ -134,11 +149,11 @@ sl_status_t sparkfun_mlx90640_get_image_array(float *pixel_array) float Ta; // Read both sub-pages for (uint8_t x = 0 ; x < 2 ; x++) { - uint16_t mlx90640Frame[834]; + uint16_t mlx90640Frame[834] = { 0 }; int status = sparkfun_mlx90640_get_frame_data(mlx90640Frame); if (status < 0) { -#if MLX90640_CONFIG_ENABLE_LOG - app_log("GetFrame Error: %d", status); +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG + app_printf("GetFrame Error: %d", status); #endif return SL_STATUS_FAIL; } @@ -160,50 +175,49 @@ sl_status_t sparkfun_mlx90640_get_image_array(float *pixel_array) /***************************************************************************//** * Changes which I2C bus and slave address does the driver use ******************************************************************************/ -sl_status_t sparkfun_mlx90640_change_devices(sl_i2cspm_t *i2cspm_instance, +sl_status_t sparkfun_mlx90640_change_devices(mikroe_i2c_handle_t i2c_instance, uint8_t new_addr) { - sl_status_t status; - status = sparkfun_mlx90640_i2c_change_bus_and_address(i2cspm_instance, - new_addr); - return status; + if ((i2c_instance == NULL) || (new_addr == 0x00)) { + return SL_STATUS_INVALID_PARAMETER; + } + + mlx90640_i2c.handle = i2c_instance; + mlx90640_i2c.config.addr = new_addr; + + return SL_STATUS_OK; } /***************************************************************************//** * Change slave address to the value of "new_addr" ******************************************************************************/ -sl_status_t sparkfun_mlx90640_set_slave_addr(sl_i2cspm_t *i2cspm_instance, +sl_status_t sparkfun_mlx90640_set_slave_addr(mikroe_i2c_handle_t i2c_instance, uint8_t new_addr) { - if ((i2cspm_instance == NULL) || (new_addr == 0x00)) { + if ((i2c_instance == NULL) || (new_addr == 0x00)) { return SL_STATUS_INVALID_PARAMETER; } sl_status_t status = SL_STATUS_FAIL; - uint8_t current_address = 0x00; uint16_t temp_address = 0x0000; - sparkfun_mlx90640_i2c_init(i2cspm_instance, - SPARKFUN_MLX90640_DEFAULT_I2C_ADDR); - sparkfun_mlx90640_i2c_get_current_own_addr(¤t_address); // If currently used i2c address is the same as the new one, then there's no // need to change anything - if (current_address == new_addr) { + if (mlx90640_i2c.config.addr == new_addr) { status = SL_STATUS_OK; } else { status = sparkfun_mlx90640_i2c_read(0x240F, 1, &temp_address); - if (status == SL_STATUS_TIMEOUT) { - status = sparkfun_mlx90640_i2c_set_own_address(new_addr); - app_assert_status(status); + if (status == SL_STATUS_TRANSMIT) { + mlx90640_i2c.config.addr = new_addr; status = sparkfun_mlx90640_i2c_read(0x240F, 1, &temp_address); if (status == SL_STATUS_OK) { -#if MLX90640_CONFIG_ENABLE_LOG - app_log("\nCurrent address is 0x%x\n", temp_address & 0xFF); +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG + app_printf("\nCurrent address is 0x%x\n", temp_address & 0xFF); #endif return status; } else { -#if MLX90640_CONFIG_ENABLE_LOG - app_log( +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG + app_printf( "\nUnknown I2C address!\nPlease find out the current address of the device, then change the SPARKFUN_MLX90640_DEFAULT_I2C_ADDR macro to that address!\n"); #endif status = SL_STATUS_FAIL; @@ -231,16 +245,15 @@ sl_status_t sparkfun_mlx90640_set_slave_addr(sl_i2cspm_t *i2cspm_instance, app_assert_status(status); if ((temp_address & 0xFF) == new_addr) { -#if MLX90640_CONFIG_ENABLE_LOG - app_log("\nAddress change succesful\nPower-reset the device!\n"); +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG + app_printf("\nAddress change succesful\nPower-reset the device!\n"); #endif - status = SL_STATUS_NOT_INITIALIZED; } else { -#if MLX90640_CONFIG_ENABLE_LOG - app_log("\nAddress change failed\n"); +#if SPARKFUN_MLX90640_CONFIG_ENABLE_LOG + app_printf("\nAddress change failed\n"); #endif - status = SL_STATUS_NOT_INITIALIZED; } + status = SL_STATUS_NOT_INITIALIZED; } } } @@ -921,7 +934,7 @@ sl_status_t sparkfun_mlx90640_get_vdd(uint16_t *frameData, const paramsMLX90640 *params, float *vdd) { - float temp_vdd; + float temp_vdd = 0; float resolutionCorrection; int resolutionRAM; @@ -1757,3 +1770,77 @@ static int is_pixel_bad(uint16_t pixel, paramsMLX90640 *params) } return 0; } + +/***************************************************************************//** + * Initiates an I2C read of the device + ******************************************************************************/ +static sl_status_t sparkfun_mlx90640_i2c_read(uint16_t startAddress, + uint16_t nMemAddressRead, + uint16_t *data) +{ + uint8_t i2cData[2 * nMemAddressRead]; + uint16_t counter = 0; + uint16_t i = 0; + uint16_t *p = data; + + uint8_t cmd[2] = { 0, 0 }; + cmd[0] = startAddress >> 8; + cmd[1] = startAddress & 0x00FF; + + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&mlx90640_i2c, + cmd, + 2, + (uint8_t *)i2cData, + 2 * nMemAddressRead)) { + return SL_STATUS_TRANSMIT; + } + + for (counter = 0; counter < nMemAddressRead; counter++) { + i = counter << 1; + *p++ = (uint16_t)i2cData[i] * 256 + (uint16_t)i2cData[i + 1]; + } + + return SL_STATUS_OK; +} + +/***************************************************************************//** + * Initiates an I2C write to the device + ******************************************************************************/ +static sl_status_t sparkfun_mlx90640_i2c_write(uint16_t writeAddress, + uint16_t data) +{ + uint8_t cmd[4] = { 0, 0, 0, 0 }; + static uint16_t dataCheck; + + cmd[0] = writeAddress >> 8; + cmd[1] = writeAddress & 0x00FF; + cmd[2] = data >> 8; + cmd[3] = data & 0x00FF; + + if (I2C_MASTER_SUCCESS != i2c_master_write(&mlx90640_i2c, cmd, 4)) { + return SL_STATUS_TRANSMIT; + } + + if (SL_STATUS_OK != sparkfun_mlx90640_i2c_read(writeAddress, 1, &dataCheck)) { + return SL_STATUS_FAIL; + } + + if (dataCheck != data) { + return SL_STATUS_FAIL; + } + + return SL_STATUS_OK; +} + +/***************************************************************************//** + * Issues an I2C general reset + ******************************************************************************/ +static sl_status_t sparkfun_mlx90640_i2c_general_reset(void) +{ + uint8_t cmd[2] = { 0x00, 0x06 }; + + if (I2C_MASTER_SUCCESS != i2c_master_write(&mlx90640_i2c, cmd, 2)) { + return SL_STATUS_TRANSMIT; + } + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640_i2c.c b/driver/public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640_i2c.c deleted file mode 100644 index 1b87794e..00000000 --- a/driver/public/silabs/ir_array_mlx90640/src/sparkfun_mlx90640_i2c.c +++ /dev/null @@ -1,214 +0,0 @@ -/***************************************************************************//** - * @file sparkfun_mlx90640_i2c.c - * @brief SPARKFUN MLX90640 IR Array sensor I2C source file. - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ - -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- - -#include -#include - -// ----------------------------------------------------------------------------- -// Static Variables -// ----------------------------------------------------------------------------- - -static sl_i2cspm_t *i2cspm; -static uint8_t i2c_addr; - -// ----------------------------------------------------------------------------- -// Function definitions -// ----------------------------------------------------------------------------- - -/***************************************************************************//** - * Assigns an I2CSPM instance and the default slave address for the driver to - * use - ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_init(sl_i2cspm_t *i2cspm_instance, - uint8_t new_i2c_addr) -{ - if (i2cspm_instance != NULL) { - i2cspm = i2cspm_instance; - i2c_addr = new_i2c_addr; - } else { - return SL_STATUS_INVALID_PARAMETER; - } - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * Assigns an I2CSPM instance and a slave address for the driver to use - ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_change_bus_and_address( - sl_i2cspm_t *i2cspm_instance, - uint8_t new_i2c_addr) -{ - if ((i2cspm_instance != NULL) && (i2c_addr != 0x00)) { - i2cspm = i2cspm_instance; - i2c_addr = new_i2c_addr; - } else { - return SL_STATUS_INVALID_PARAMETER; - } - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * Updates the I2C slave address of the device. - ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_set_own_address(uint8_t slave_addr) -{ - i2c_addr = slave_addr; - return SL_STATUS_OK; -} - -/***************************************************************************//** - * Retrieves the current I2C slave address used by the driver - ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_get_current_own_addr(uint8_t *current_address) -{ - *current_address = i2c_addr; - return SL_STATUS_OK; -} - -/***************************************************************************//** - * Issues an I2C general reset - ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_general_reset(void) -{ - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - - uint8_t cmd[2] = { 0x00, 0x06 }; - - seq.addr = i2c_addr; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].len = 2; - seq.buf[0].data = cmd; - - ret = I2CSPM_Transfer(i2cspm, &seq); - - if (ret != i2cTransferDone) { - return -1; - } - return SL_STATUS_OK; -} - -/***************************************************************************//** - * Initiates an I2C read of the device - ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_read(uint16_t startAddress, - uint16_t nMemAddressRead, - uint16_t *data) -{ - uint8_t i2cData[1664] = { 0 }; - uint16_t counter = 0; - uint16_t i = 0; - uint16_t *p = data; - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - - uint8_t cmd[2] = { 0, 0 }; - cmd[0] = startAddress >> 8; - cmd[1] = startAddress & 0x00FF; - - seq.addr = i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE_READ; - seq.buf[0].len = 2; - seq.buf[0].data = cmd; - seq.buf[1].len = 2 * nMemAddressRead; - seq.buf[1].data = i2cData; - ret = I2CSPM_Transfer(i2cspm, &seq); - - if (ret != i2cTransferDone) { - return SL_STATUS_TIMEOUT; - } - - for (counter = 0; counter < nMemAddressRead; counter++) { - i = counter << 1; - *p++ = (uint16_t)i2cData[i] * 256 + (uint16_t)i2cData[i + 1]; - } - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * Sets I2C base frequency to a given setting - ******************************************************************************/ -void sparkfun_mlx90640_i2c_freq_set(int freq) -{ - I2C_BusFreqSet(i2cspm, 0, freq, i2cClockHLRStandard); -} - -/***************************************************************************//** - * Initiates an I2C write to the device - ******************************************************************************/ -sl_status_t sparkfun_mlx90640_i2c_write(uint16_t writeAddress, uint16_t data) -{ - uint8_t cmd[4] = { 0, 0, 0, 0 }; - static uint16_t dataCheck; - - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef i2c_ret; - int ret; - - cmd[0] = writeAddress >> 8; - cmd[1] = writeAddress & 0x00FF; - cmd[2] = data >> 8; - cmd[3] = data & 0x00FF; - - seq.addr = i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].len = 4; - seq.buf[0].data = cmd; - - i2c_ret = I2CSPM_Transfer(i2cspm, &seq); - - if (i2c_ret != i2cTransferDone) { - return SL_STATUS_TIMEOUT; - } - - ret = sparkfun_mlx90640_i2c_read(writeAddress, 1, &dataCheck); - - if (ret != 0) { - return SL_STATUS_FAIL; - } - - if (dataCheck != data) { - return SL_STATUS_FAIL; - } - - return SL_STATUS_OK; -} diff --git a/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h b/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h index e43a1149..503189f7 100644 --- a/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h +++ b/driver/public/silabs/micro_oled_ssd1306/config/micro_oled_ssd1306_config.h @@ -51,12 +51,12 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//MICRO OLED I2C Configuration +// MICRO OLED I2C Configuration -// MICRO OLED I2C UC Configuration -// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). -// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. -// Default: 0 +// MICRO OLED I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 #define MICRO_OLED_I2C__UC 0 // Speed mode @@ -68,7 +68,6 @@ extern "C" { // // -// <<< end of configuration section >>> // Connection // I2C Address <0x1..0x7E:0x1> diff --git a/driver/public/silabs/nfctag2_nt3h2111/config/brd2703a/mikroe_nt3h2111_config.h b/driver/public/silabs/nfctag2_nt3h2111/config/brd2703a/mikroe_nt3h2111_config.h index 3a841ce4..2c66fc3c 100644 --- a/driver/public/silabs/nfctag2_nt3h2111/config/brd2703a/mikroe_nt3h2111_config.h +++ b/driver/public/silabs/nfctag2_nt3h2111/config/brd2703a/mikroe_nt3h2111_config.h @@ -45,10 +45,28 @@ // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_NT3H211 I2C Configuration + +// MIKROE_NT3H211 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_NT3H211_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_NT3H211_I2C_SPEED_MODE 0 + +// +// + // Connection // I2C Address <0-0xFF> -// Default: 0xAA -#define MIKROE_NT3H211_ADDR 0xAA +// Default: 0x55 +#define MIKROE_NT3H211_ADDR 0x55 // // The block ends with the following line or at the end of the file: diff --git a/driver/public/silabs/nfctag2_nt3h2111/config/brd4108a/mikroe_nt3h2111_config.h b/driver/public/silabs/nfctag2_nt3h2111/config/brd4108a/mikroe_nt3h2111_config.h index 04b707ac..adb45bfc 100644 --- a/driver/public/silabs/nfctag2_nt3h2111/config/brd4108a/mikroe_nt3h2111_config.h +++ b/driver/public/silabs/nfctag2_nt3h2111/config/brd4108a/mikroe_nt3h2111_config.h @@ -45,10 +45,28 @@ // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_NT3H211 I2C Configuration + +// MIKROE_NT3H211 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_NT3H211_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_NT3H211_I2C_SPEED_MODE 0 + +// +// + // Connection // I2C Address <0-0xFF> -// Default: 0xAA -#define MIKROE_NT3H211_ADDR 0xAA +// Default: 0x55 +#define MIKROE_NT3H211_ADDR 0x55 // // The block ends with the following line or at the end of the file: diff --git a/driver/public/silabs/nfctag2_nt3h2111/config/brd4314a/mikroe_nt3h2111_config.h b/driver/public/silabs/nfctag2_nt3h2111/config/brd4314a/mikroe_nt3h2111_config.h index 04b707ac..adb45bfc 100644 --- a/driver/public/silabs/nfctag2_nt3h2111/config/brd4314a/mikroe_nt3h2111_config.h +++ b/driver/public/silabs/nfctag2_nt3h2111/config/brd4314a/mikroe_nt3h2111_config.h @@ -45,10 +45,28 @@ // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_NT3H211 I2C Configuration + +// MIKROE_NT3H211 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_NT3H211_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_NT3H211_I2C_SPEED_MODE 0 + +// +// + // Connection // I2C Address <0-0xFF> -// Default: 0xAA -#define MIKROE_NT3H211_ADDR 0xAA +// Default: 0x55 +#define MIKROE_NT3H211_ADDR 0x55 // // The block ends with the following line or at the end of the file: diff --git a/driver/public/mikroe/e_paper_154_inch/config/other/mikroe_e_paper_154_inch_config.h b/driver/public/silabs/nfctag2_nt3h2111/config/brd4338a/mikroe_nt3h2111_config.h similarity index 63% rename from driver/public/mikroe/e_paper_154_inch/config/other/mikroe_e_paper_154_inch_config.h rename to driver/public/silabs/nfctag2_nt3h2111/config/brd4338a/mikroe_nt3h2111_config.h index 373cc660..13a66f11 100644 --- a/driver/public/mikroe/e_paper_154_inch/config/other/mikroe_e_paper_154_inch_config.h +++ b/driver/public/silabs/nfctag2_nt3h2111/config/brd4338a/mikroe_nt3h2111_config.h @@ -1,6 +1,6 @@ /***************************************************************************//** - * @file mikroe_e_paper_config.h - * @brief Mikroe E-Paper Configuration + * @file mikroe_nt3h2111_config.h + * @brief SCL MIKROE NT3H2111 Configuration * @version 1.0.0 ******************************************************************************* * # License @@ -36,56 +36,48 @@ * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ -#ifndef MIKROE_E_PAPER_154_INCH_CONFIG_H_ -#define MIKROE_E_PAPER_154_INCH_CONFIG_H_ -#ifdef __cplusplus -extern "C" { -#endif - -#define MIKROE_E_PAPER_WIDTH 200 -#define MIKROE_E_PAPER_HEIGHT 200 +#ifndef MIKROE_NT3H211_CONFIG_H_ +#define MIKROE_NT3H211_CONFIG_H_ // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> -// ESL MODE setting -// ESL_MODE> Enable Peripheral -// Macro for the ESL mode -#define ESL_MODE 0 +// MIKROE_NT3H211 I2C Configuration + +// MIKROE_NT3H211 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_NT3H211_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_NT3H211_I2C_SPEED_MODE 0 + // // +// Connection +// I2C Address <0-0xFF> +// Default: 0x55 +#define MIKROE_NT3H211_ADDR 0x55 +// + // The block ends with the following line or at the end of the file: // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// E_PAPER_DC -// $[GPIO_E_PAPER_DC] -#warning "E_PAPER_154_INCH_DC is not configured" -// #define E_PAPER_DC_PORT gpioPortA -// #define E_PAPER_DC_PIN 0 -// [GPIO_E_PAPER_DC]$ - -// E_PAPER_RST -// $[GPIO_E_PAPER_RST] -#warning "E_PAPER_154_INCH_RST is not configured" -// #define E_PAPER_RST_PORT gpioPortC -// #define E_PAPER_RST_PIN 8 -// [GPIO_E_PAPER_RST]$ - -// E_PAPER_BSY -// $[GPIO_E_PAPER_BSY] -#warning "E_PAPER_BSY is not configured" -// #define E_PAPER_BSY_PORT gpioPortB -// #define E_PAPER_BSY_PIN 1 -// [GPIO_E_PAPER_BSY]$ +// MIKROE_NT3H211_FD +// $[GPIO_MIKROE_NT3H211_FD] +#define MIKROE_NT3H211_FD_PORT HP +#define MIKROE_NT3H211_FD_PIN 46 +// [GPIO_MIKROE_NT3H211_FD]$ // <<< sl:end pin_tool >>> -#ifdef __cplusplus -} -#endif - -#endif /* MIKROE_E_PAPER_154_INCH_CONFIG_H_ */ +#endif /* MIKROE_NT3H211_CONFIG_H_ */ diff --git a/driver/public/silabs/nfctag2_nt3h2111/config/other/mikroe_nt3h2111_config.h b/driver/public/silabs/nfctag2_nt3h2111/config/other/mikroe_nt3h2111_config.h index f1082684..8745e1da 100644 --- a/driver/public/silabs/nfctag2_nt3h2111/config/other/mikroe_nt3h2111_config.h +++ b/driver/public/silabs/nfctag2_nt3h2111/config/other/mikroe_nt3h2111_config.h @@ -40,15 +40,35 @@ #ifndef MIKROE_NT3H211_CONFIG_H_ #define MIKROE_NT3H211_CONFIG_H_ +#ifndef SLI_SI917 #include "em_gpio.h" +#endif // A CMSIS annotation block starts with the following line: // <<< Use Configuration Wizard in Context Menu >>> +// MIKROE_NT3H211 I2C Configuration + +// MIKROE_NT3H211 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define MIKROE_NT3H211_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define MIKROE_NT3H211_I2C_SPEED_MODE 0 + +// +// + // Connection // I2C Address <0-0xFF> -// Default: 0xAA -#define MIKROE_NT3H211_ADDR 0xAA +// Default: 0x55 +#define MIKROE_NT3H211_ADDR 0x55 // // The block ends with the following line or at the end of the file: diff --git a/driver/public/silabs/nfctag2_nt3h2111/inc/mikroe_nt3h2111.h b/driver/public/silabs/nfctag2_nt3h2111/inc/mikroe_nt3h2111.h index df1e597b..96ce42c7 100644 --- a/driver/public/silabs/nfctag2_nt3h2111/inc/mikroe_nt3h2111.h +++ b/driver/public/silabs/nfctag2_nt3h2111/inc/mikroe_nt3h2111.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file nt3h2111.h + * @file mikroe_nt3h2111.h * @brief APIs and types for high level NT3H2111 functionalities. ******************************************************************************* * # License @@ -42,9 +42,7 @@ #include #include #include "sl_status.h" - -#include "mikroe_nt3h2111_i2c.h" -#include "mikroe_nt3h2111_config.h" +#include "drv_i2c_master.h" #define ENABLED 1 #define DISABLED 0 @@ -276,7 +274,7 @@ typedef struct { * @return * SL_STATUS_OK on success. ******************************************************************************/ -sl_status_t nt3h2111_init(sl_i2cspm_t *i2cspm); +sl_status_t nt3h2111_init(mikroe_i2c_handle_t i2cspm); /***************************************************************************//** * @brief diff --git a/driver/public/silabs/nfctag2_nt3h2111/inc/mikroe_nt3h2111_i2c.h b/driver/public/silabs/nfctag2_nt3h2111/inc/mikroe_nt3h2111_i2c.h deleted file mode 100644 index 8fdc1797..00000000 --- a/driver/public/silabs/nfctag2_nt3h2111/inc/mikroe_nt3h2111_i2c.h +++ /dev/null @@ -1,105 +0,0 @@ -/***************************************************************************//** -* @file mikroe_nt3h2111_i2c.h -* @brief Types for I2C interface for NT3H2111. -******************************************************************************** -* # License -* Copyright 2023 Silicon Laboratories Inc. www.silabs.com -******************************************************************************** -* -* SPDX-License-Identifier: Zlib -* -* The licensor of this software is Silicon Laboratories Inc. -* -* This software is provided \'as-is\', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -* -******************************************************************************** -* # Evaluation Quality -* This code has been minimally tested to ensure that it builds and is suitable -* as a demonstration for evaluation purposes only. This code will be maintained -* at the sole discretion of Silicon Labs. -*******************************************************************************/ - -#ifndef _MIKROE_NT3H2111_I2C_H_ -#define _MIKROE_NT3H2111_I2C_H_ - -#include "sl_status.h" -#include "sl_i2cspm.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************************************************************//** - * @addtogroup NT3H2111 Driver - * @brief NT3H2111 I2C Types. - * @{ - ******************************************************************************/ - -/**************************************************************************//** - * @brief - * Read data through I2C. - * - * @param[in] i2c_handle - * The I2C instance to use - * - * @param[in] i2c_addr - * The I2C address to probe. - * - * @param[in] size - * Number of bytes to be read - * - * @param[out] pdata - * Buffer to store read data - * - * @returns - * I2C transfer result code. - *****************************************************************************/ -sl_status_t nt3h2111_i2c_read_bytes(sl_i2cspm_t *i2c_handle, - uint8_t i2c_addr, - uint32_t size, - uint8_t *pdata); - -/**************************************************************************//** - * @brief - * Write data through I2C. - * - * @param[in] i2c_handle - * The I2C instance to use - * - * @param[in] i2c_addr - * The I2C address to probe. - * - * @param[in] size - * Number of bytes to be written - * - * @param[out] pdata - * Buffer of data to be written - * - * @returns - * I2C transfer result code. - *****************************************************************************/ -sl_status_t nt3h2111_i2c_write_bytes(sl_i2cspm_t *i2c_handle, - uint8_t i2c_addr, - uint32_t size, - uint8_t *pdata); - -#ifdef __cplusplus -} -#endif - -/** @} (end addtogroup NT3H2111 I2C Driver) */ -#endif diff --git a/driver/public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111.c b/driver/public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111.c index e063a8b1..3bc38410 100644 --- a/driver/public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111.c +++ b/driver/public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111.c @@ -37,16 +37,24 @@ ******************************************************************************/ #include -#include "em_gpio.h" #include "sl_sleeptimer.h" #include "mikroe_nt3h2111.h" +#include "mikroe_nt3h2111_config.h" +#include "drv_i2c_master.h" +#include "drv_digital_in.h" #if !defined (min) #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif +typedef struct +{ + i2c_master_t i2c; + digital_in_t fd_pin; +}mikroe_nt3h2111_t; + // Global variables -static sl_i2cspm_t *nt3h2111_i2cspm_instance = NULL; +static mikroe_nt3h2111_t s_nt3h2111; static bool nt3h2111_is_initialized = false; /**************************************************************************//** @@ -56,7 +64,65 @@ static bool nt3h2111_is_initialized = false; * @param[in] init * Initialization settings. *****************************************************************************/ -sl_status_t nt3h2111_init(sl_i2cspm_t *i2cspm) + +/**************************************************************************//** + * @brief + * Read data through I2C. + * + * @param[in] size + * Number of bytes to be read + * + * @param[out] pdata + * Buffer to store read data + * + * @returns + * I2C transfer result code. + *****************************************************************************/ +static sl_status_t nt3h2111_i2c_read_bytes(uint32_t size, uint8_t *pdata) +{ + if (NULL == pdata) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (I2C_MASTER_SUCCESS != i2c_master_read(&s_nt3h2111.i2c, + pdata, + size)) { + return SL_STATUS_TRANSMIT; + } + + return SL_STATUS_OK; +} + +/**************************************************************************//** + * @brief + * Write data through I2C. + * + * @param[in] size + * Number of bytes to be written + * + * @param[out] pdata + * Buffer of data to be written + * + * @returns + * I2C transfer result code. + *****************************************************************************/ +sl_status_t nt3h2111_i2c_write_bytes(uint32_t size, + uint8_t *pdata) +{ + if (NULL == pdata) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (I2C_MASTER_SUCCESS != i2c_master_write(&s_nt3h2111.i2c, + pdata, + size)) { + return SL_STATUS_TRANSMIT; + } + + return SL_STATUS_OK; +} + +sl_status_t nt3h2111_init(mikroe_i2c_handle_t i2cspm) { if (i2cspm == NULL) { return SL_STATUS_NULL_POINTER; @@ -68,13 +134,27 @@ sl_status_t nt3h2111_init(sl_i2cspm_t *i2cspm) } // Update i2cspm instance and i2c addr - nt3h2111_i2cspm_instance = i2cspm; + s_nt3h2111.i2c.handle = i2cspm; + + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = MIKROE_NT3H211_ADDR; + i2c_cfg.timeout_pass_count = 0; + +#if (MIKROE_NT3H211_I2C_UC == 1) + i2c_cfg.speed = MIKROE_NT3H211_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&s_nt3h2111.i2c, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } #if defined(MIKROE_NT3H211_FD_PORT) && defined(MIKROE_NT3H211_FD_PIN) - GPIO_PinModeSet(MIKROE_NT3H211_FD_PORT, - MIKROE_NT3H211_FD_PIN, - gpioModeInputPullFilter, - 1); + pin_name_t pin = hal_gpio_pin_name(MIKROE_NT3H211_FD_PORT, + MIKROE_NT3H211_FD_PIN); + + digital_in_init(&s_nt3h2111.fd_pin, pin); #endif return SL_STATUS_OK; @@ -85,19 +165,13 @@ sl_status_t nt3h2111_init(sl_i2cspm_t *i2cspm) ******************************************************************************/ sl_status_t nt3h2111_deinit(void) { - if (nt3h2111_i2cspm_instance == false) { + if (s_nt3h2111.i2c.handle == false) { return SL_STATUS_NOT_INITIALIZED; } + i2c_master_close(&s_nt3h2111.i2c); - // De-initialization tasks -#if defined(MIKROE_NT3H211_FD_PORT) && defined(MIKROE_NT3H211_FD_PIN) - GPIO_PinModeSet(MIKROE_NT3H211_FD_PORT, - MIKROE_NT3H211_FD_PIN, - gpioModeDisabled, - 1); -#endif // Mark driver as not initialized - nt3h2111_i2cspm_instance = false; + nt3h2111_is_initialized = false; return SL_STATUS_OK; } @@ -121,19 +195,13 @@ sl_status_t nt3h2111_get_config(nt3h2111_config_reg_addr_t rega, uint8_t *data) buff[1] = rega; /* Write addresses. */ - result = nt3h2111_i2c_write_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - 2, - buff); + result = nt3h2111_i2c_write_bytes(2, buff); if (result != SL_STATUS_OK) { return result; } /* Read regdat from NT3H2111. */ - return nt3h2111_i2c_read_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - 1, - data); + return nt3h2111_i2c_read_bytes(1, data); } /***************************************************************************//** @@ -158,10 +226,7 @@ sl_status_t nt3h2111_set_config(nt3h2111_config_reg_addr_t rega, buff[3] = regd; /* Write to NT3H2111. */ - return nt3h2111_i2c_write_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - 4, - buff); + return nt3h2111_i2c_write_bytes(4, buff); } /***************************************************************************//** @@ -184,19 +249,13 @@ sl_status_t nt3h2111_get_session(nt3h2111_session_reg_addr_t rega, buff[1] = rega; /* Write addresses. */ - result = nt3h2111_i2c_write_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - 2, - buff); + result = nt3h2111_i2c_write_bytes(2, buff); if (result != SL_STATUS_OK) { return result; } /* Read regdat from NT3H2111. */ - return nt3h2111_i2c_read_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - 1, - data); + return nt3h2111_i2c_read_bytes(1, data); } /***************************************************************************//** @@ -221,10 +280,7 @@ sl_status_t nt3h2111_set_session(nt3h2111_session_reg_addr_t rega, buff[3] = regd; /* Write to NT3H2111. */ - return nt3h2111_i2c_write_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - 4, - buff); + return nt3h2111_i2c_write_bytes(4, buff); } /***************************************************************************//** @@ -239,19 +295,14 @@ sl_status_t nt3h2111_read_block(uint8_t mema, uint8_t *data) } /* Write memory address of the block of memory that is intended to be read */ - result = nt3h2111_i2c_write_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - 1, + result = nt3h2111_i2c_write_bytes(1, &mema); if (result != SL_STATUS_OK) { return result; } /* Read a block. */ - return nt3h2111_i2c_read_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - NT3H2111_BLOCK_SIZE, - data); + return nt3h2111_i2c_read_bytes(NT3H2111_BLOCK_SIZE, data); } /***************************************************************************//** @@ -275,10 +326,7 @@ sl_status_t nt3h2111_write_block(uint8_t mema, const uint8_t *data) memcpy(&buff[1], data, NT3H2111_BLOCK_SIZE); /* Write to NT3H2111. */ - result = nt3h2111_i2c_write_bytes(nt3h2111_i2cspm_instance, - MIKROE_NT3H211_ADDR, - sizeof(buff), - buff); + result = nt3h2111_i2c_write_bytes(sizeof(buff), buff); if (result != SL_STATUS_OK) { return result; } diff --git a/driver/public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111_i2c.c b/driver/public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111_i2c.c deleted file mode 100644 index e697ea51..00000000 --- a/driver/public/silabs/nfctag2_nt3h2111/src/mikroe_nt3h2111_i2c.c +++ /dev/null @@ -1,121 +0,0 @@ -/***************************************************************************//** -* @file mikroe_nt3h2111_i2c.c -* @brief Implementation for I2C interface for NT3H2111. -******************************************************************************** -* # License -* Copyright 2023 Silicon Laboratories Inc. www.silabs.com -******************************************************************************** -* -* SPDX-License-Identifier: Zlib -* -* The licensor of this software is Silicon Laboratories Inc. -* -* This software is provided \'as-is\', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -* -******************************************************************************* -* # Evaluation Quality -* This code has been minimally tested to ensure that it builds and is suitable -* as a demonstration for evaluation purposes only. This code will be maintained -* at the sole discretion of Silicon Labs. -*******************************************************************************/ - -#include -#include "mikroe_nt3h2111_i2c.h" - -/**************************************************************************//** - * @brief - * Read data through I2C. - * - * @param[in] i2c_handle - * The I2C instance to use - * - * @param[in] i2c_addr - * The I2C address to probe. - * - * @param[in] size - * Number of bytes to be read - * - * @param[out] pdata - * Buffer to store read data - * - * @returns - * I2C transfer result code. - *****************************************************************************/ -sl_status_t nt3h2111_i2c_read_bytes(sl_i2cspm_t *i2c_handle, - uint8_t i2c_addr, - uint32_t size, - uint8_t *pdata) -{ - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - - seq.addr = i2c_addr; - seq.flags = I2C_FLAG_READ; - - /* Select command to issue */ - seq.buf[0].data = pdata; - seq.buf[0].len = size; - - result = I2CSPM_Transfer(i2c_handle, &seq); - if (result != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * @brief - * Write data through I2C. - * - * @param[in] i2c_handle - * The I2C instance to use - * - * @param[in] i2c_addr - * The I2C address to probe. - * - * @param[in] size - * Number of bytes to be written - * - * @param[out] pdata - * Buffer of data to be written - * - * @returns - * I2C transfer result code. - *****************************************************************************/ -sl_status_t nt3h2111_i2c_write_bytes(sl_i2cspm_t *i2c_handle, - uint8_t i2c_addr, - uint32_t size, - uint8_t *pdata) -{ - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - - seq.addr = i2c_addr; - seq.flags = I2C_FLAG_WRITE; - - /* Select command to issue */ - seq.buf[0].data = pdata; - seq.buf[0].len = size; - - result = I2CSPM_Transfer(i2c_handle, &seq); - if (result != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - - return SL_STATUS_OK; -} diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/config/brd2703a/sl_iostream_usart_sps30_config.h b/driver/public/silabs/particulate_matter_sensor_sps30/config/brd2703a/sl_iostream_usart_sps30_config.h deleted file mode 100644 index fa6cb2c4..00000000 --- a/driver/public/silabs/particulate_matter_sensor_sps30/config/brd2703a/sl_iostream_usart_sps30_config.h +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_SPS30_CONFIG_H -#define SL_IOSTREAM_USART_SPS30_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_SPS30_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_SPS30_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_SPS30_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_SPS30_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_SPS30_RX_BUFFER_SIZE 256 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_SPS30_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_SPS30_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_SPS30 -// $[USART_SL_IOSTREAM_USART_SPS30] -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL USART0 -#endif -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO 0 -#endif - -// USART0 TX on PD04 -#ifndef SL_IOSTREAM_USART_SPS30_TX_PORT -#define SL_IOSTREAM_USART_SPS30_TX_PORT gpioPortD -#endif -#ifndef SL_IOSTREAM_USART_SPS30_TX_PIN -#define SL_IOSTREAM_USART_SPS30_TX_PIN 4 -#endif - -// USART0 RX on PD05 -#ifndef SL_IOSTREAM_USART_SPS30_RX_PORT -#define SL_IOSTREAM_USART_SPS30_RX_PORT gpioPortD -#endif -#ifndef SL_IOSTREAM_USART_SPS30_RX_PIN -#define SL_IOSTREAM_USART_SPS30_RX_PIN 5 -#endif - -// [USART_SL_IOSTREAM_USART_SPS30]$ -// <<< sl:end pin_tool >>> - -#endif diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/config/brd4108a/sl_iostream_usart_sps30_config.h b/driver/public/silabs/particulate_matter_sensor_sps30/config/brd4108a/sl_iostream_usart_sps30_config.h deleted file mode 100644 index e8f8c530..00000000 --- a/driver/public/silabs/particulate_matter_sensor_sps30/config/brd4108a/sl_iostream_usart_sps30_config.h +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_SPS30_CONFIG_H -#define SL_IOSTREAM_USART_SPS30_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_SPS30_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_SPS30_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_SPS30_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_SPS30_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_SPS30_RX_BUFFER_SIZE 256 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_SPS30_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_SPS30_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_SPS30 -// $[USART_SL_IOSTREAM_USART_SPS30] -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL USART1 -#endif -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO 1 -#endif - -// USART1 TX on PB01 -#ifndef SL_IOSTREAM_USART_SPS30_TX_PORT -#define SL_IOSTREAM_USART_SPS30_TX_PORT gpioPortB -#endif -#ifndef SL_IOSTREAM_USART_SPS30_TX_PIN -#define SL_IOSTREAM_USART_SPS30_TX_PIN 1 -#endif - -// USART1 RX on PB02 -#ifndef SL_IOSTREAM_USART_SPS30_RX_PORT -#define SL_IOSTREAM_USART_SPS30_RX_PORT gpioPortB -#endif -#ifndef SL_IOSTREAM_USART_SPS30_RX_PIN -#define SL_IOSTREAM_USART_SPS30_RX_PIN 2 -#endif - -// [USART_SL_IOSTREAM_USART_SPS30]$ -// <<< sl:end pin_tool >>> - -#endif diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/config/brd4314a/sl_iostream_usart_sps30_config.h b/driver/public/silabs/particulate_matter_sensor_sps30/config/brd4314a/sl_iostream_usart_sps30_config.h deleted file mode 100644 index e8f8c530..00000000 --- a/driver/public/silabs/particulate_matter_sensor_sps30/config/brd4314a/sl_iostream_usart_sps30_config.h +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_SPS30_CONFIG_H -#define SL_IOSTREAM_USART_SPS30_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_SPS30_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_SPS30_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_SPS30_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_SPS30_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_SPS30_RX_BUFFER_SIZE 256 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_SPS30_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_SPS30_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_SPS30 -// $[USART_SL_IOSTREAM_USART_SPS30] -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL USART1 -#endif -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO 1 -#endif - -// USART1 TX on PB01 -#ifndef SL_IOSTREAM_USART_SPS30_TX_PORT -#define SL_IOSTREAM_USART_SPS30_TX_PORT gpioPortB -#endif -#ifndef SL_IOSTREAM_USART_SPS30_TX_PIN -#define SL_IOSTREAM_USART_SPS30_TX_PIN 1 -#endif - -// USART1 RX on PB02 -#ifndef SL_IOSTREAM_USART_SPS30_RX_PORT -#define SL_IOSTREAM_USART_SPS30_RX_PORT gpioPortB -#endif -#ifndef SL_IOSTREAM_USART_SPS30_RX_PIN -#define SL_IOSTREAM_USART_SPS30_RX_PIN 2 -#endif - -// [USART_SL_IOSTREAM_USART_SPS30]$ -// <<< sl:end pin_tool >>> - -#endif diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/config/other/sl_iostream_usart_sps30_config.h b/driver/public/silabs/particulate_matter_sensor_sps30/config/other/sl_iostream_usart_sps30_config.h deleted file mode 100644 index 65ebb118..00000000 --- a/driver/public/silabs/particulate_matter_sensor_sps30/config/other/sl_iostream_usart_sps30_config.h +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************//** - * @file - * @brief IOSTREAM_USART Config. - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_IOSTREAM_USART_SPS30_CONFIG_H -#define SL_IOSTREAM_USART_SPS30_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu >>> - -// USART settings - -// Baud rate -// Default: 115200 -#define SL_IOSTREAM_USART_SPS30_BAUDRATE 115200 - -// Parity mode to use -// No Parity -// Even parity -// Odd parity -// Default: usartNoParity -#define SL_IOSTREAM_USART_SPS30_PARITY usartNoParity - -// Number of stop bits to use. -// 0.5 stop bits -// 1 stop bits -// 1.5 stop bits -// 2 stop bits -// Default: usartStopbits1 -#define SL_IOSTREAM_USART_SPS30_STOP_BITS usartStopbits1 - -// Flow control -// None -// CTS -// RTS -// CTS/RTS -// Software Flow control (XON/XOFF) -// Default: usartHwFlowControlNone -#define SL_IOSTREAM_USART_SPS30_FLOW_CONTROL_TYPE usartHwFlowControlNone - -// Receive buffer size -// Default: 32 -#define SL_IOSTREAM_USART_SPS30_RX_BUFFER_SIZE 256 - -// Convert \n to \r\n -// It can be changed at runtime using the C API. -// Default: 0 -#define SL_IOSTREAM_USART_SPS30_CONVERT_BY_DEFAULT_LF_TO_CRLF 0 - -// Restrict the energy mode to allow the reception. -// Default: 1 -// Limits the lowest energy mode the system can sleep to in order to keep the reception on. May cause higher power consumption. -#define SL_IOSTREAM_USART_SPS30_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION 1 - -// - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_IOSTREAM_USART_SPS30 -// $[USART_SL_IOSTREAM_USART_SPS30] -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL USART0 -#endif -#ifndef SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO -#define SL_IOSTREAM_USART_SPS30_PERIPHERAL_NO 0 -#endif - -// USART0 TX -#warning "USART_SPS30_TX is not configured" -// #define SL_IOSTREAM_USART_SPS30_TX_PORT gpioPortD -// #define SL_IOSTREAM_USART_SPS30_TX_PIN 4 - -// USART0 RX -#warning "USART_SPS30_RX is not configured" -// #define SL_IOSTREAM_USART_SPS30_RX_PORT gpioPortD -// #define SL_IOSTREAM_USART_SPS30_RX_PIN 5 - -// [USART_SL_IOSTREAM_USART_SPS30]$ -// <<< sl:end pin_tool >>> - -#endif diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/config/particulate_matter_sensor_sps30_i2c_config.h b/driver/public/silabs/particulate_matter_sensor_sps30/config/particulate_matter_sensor_sps30_i2c_config.h new file mode 100644 index 00000000..0898d923 --- /dev/null +++ b/driver/public/silabs/particulate_matter_sensor_sps30/config/particulate_matter_sensor_sps30_i2c_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file particulate_matter_sensor_sps30_i2c_config.h + * @brief Configuration file for PM SPS30 I2C + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef PM_SENSOR_SPS30_CONFIG_H +#define PM_SENSOR_SPS30_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// PM SENSOR SPS30 I2C Configuration + +// PM SENSOR SPS30 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define PM_SENSOR_SPS30_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define PM_SENSOR_SPS30_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // PM_SENSOR_SPS30_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c.h b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c.h index 4c944cd9..0363c17f 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c.h +++ b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c.h @@ -31,9 +31,8 @@ #ifndef SENSIRION_I2C_H #define SENSIRION_I2C_H - -#include "sl_i2cspm.h" #include "sl_status.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -61,7 +60,7 @@ sl_status_t sensirion_i2c_check_crc(const uint8_t *data, uint16_t count, uint8_t checksum); -sl_status_t sensirion_i2c_init(sl_i2cspm_t *i2c_handle); +sl_status_t sensirion_i2c_init(mikroe_i2c_handle_t i2c_handle); /** * sensirion_i2c_general_call_reset() - Send a general call reset. diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c_hal.h b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c_hal.h index 5ebea9dd..156ec138 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c_hal.h +++ b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_i2c_hal.h @@ -31,9 +31,8 @@ #ifndef SENSIRION_I2C_HAL_H #define SENSIRION_I2C_HAL_H - -#include "sl_i2cspm_instances.h" #include "sl_status.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -55,7 +54,7 @@ sl_status_t sensirion_i2c_hal_select_bus(uint8_t bus_idx); * Initialize all hard- and software components that are needed for the I2C * communication. */ -sl_status_t sensirion_i2c_hal_init(sl_i2cspm_t *i2c_handle); +sl_status_t sensirion_i2c_hal_init(mikroe_i2c_handle_t i2c_handle); /** * Release all resources initialized by sensirion_i2c_hal_init(). diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_uart_hal.h b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_uart_hal.h index 6c46d742..ac03b34a 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_uart_hal.h +++ b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sensirion_uart_hal.h @@ -31,9 +31,9 @@ #ifndef SENSIRION_UART_H #define SENSIRION_UART_H - #include "sensirion_common.h" -#include "sl_iostream.h" +#include "sl_status.h" +#include "drv_uart.h" #ifdef __cplusplus extern "C" { @@ -43,7 +43,7 @@ extern "C" { * Initialize all hard- and software components that are needed for the UART * communication. */ -sl_status_t sensirion_uart_init(sl_iostream_t *iostream_handle); +sl_status_t sensirion_uart_init(mikroe_uart_handle_t uart_handle); /** * sensirion_uart_select_port() - select the UART port index to use diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_i2c.h b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_i2c.h index 41ad1a72..8217f074 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_i2c.h +++ b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_i2c.h @@ -74,7 +74,7 @@ typedef struct _sps30_measurement { * Initialize sps30 with i2cspm * */ -sl_status_t sps30_init(sl_i2cspm_t *i2cspm); +sl_status_t sps30_init(mikroe_i2c_handle_t i2cspm); /** * sps30_probe() - check if SPS sensor is available and initialize it diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_uart.h b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_uart.h index 877b6932..fa3552a1 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_uart.h +++ b/driver/public/silabs/particulate_matter_sensor_sps30/inc/sparkfun_sps30_uart.h @@ -33,8 +33,8 @@ #define SPS30_H #include "sensirion_common.h" -#include "sl_iostream.h" - +#include "drv_uart.h" +#include "sl_status.h" #ifdef __cplusplus extern "C" { #endif @@ -70,7 +70,7 @@ typedef struct _sps30_version_information { * Initialize sps30 with sl_iostream_t * */ -sl_status_t sps30_init(sl_iostream_t *uart_handle); +uint32_t sps30_init(mikroe_uart_handle_t uart_handle); /** * sps_get_driver_version() - Return the driver version diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c.c b/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c.c index c1e76360..40106bfb 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c.c +++ b/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c.c @@ -33,7 +33,7 @@ #include "sensirion_common.h" #include "sensirion_i2c_hal.h" -sl_status_t sensirion_i2c_init(sl_i2cspm_t *i2c_handle) +sl_status_t sensirion_i2c_init(mikroe_i2c_handle_t i2c_handle) { return sensirion_i2c_hal_init(i2c_handle); } diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c_hal.c b/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c_hal.c index dc978e45..c4f60cc1 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c_hal.c +++ b/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_i2c_hal.c @@ -32,10 +32,10 @@ #include "sensirion_i2c_hal.h" #include "sensirion_common.h" #include "sl_status.h" -#include "sl_udelay.h" +#include "particulate_matter_sensor_sps30_i2c_config.h" // Variable to store the i2cspm instance -static sl_i2cspm_t *s_i2c_handle = NULL; +static i2c_master_t s_i2c_handle; /* * INSTRUCTIONS @@ -68,14 +68,29 @@ sl_status_t sensirion_i2c_hal_select_bus(uint8_t bus_idx) * Initialize all hard- and software components that are needed for the I2C * communication. */ -sl_status_t sensirion_i2c_hal_init(sl_i2cspm_t *i2c_handle) +sl_status_t sensirion_i2c_hal_init(mikroe_i2c_handle_t i2c_handle) { uint32_t stt = SL_STATUS_INVALID_PARAMETER; if (NULL != i2c_handle) { - s_i2c_handle = i2c_handle; + s_i2c_handle.handle = i2c_handle; + + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + i2c_cfg.speed = I2C_MASTER_SPEED_STANDARD; + i2c_cfg.scl = HAL_PIN_NC; + i2c_cfg.sda = HAL_PIN_NC; + +#if (PM_SENSOR_SPS30_I2C_UC == 1) + i2c_cfg.speed = PM_SENSOR_SPS30_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&s_i2c_handle, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } stt = SL_STATUS_OK; } + return stt; } @@ -101,20 +116,14 @@ sl_status_t sensirion_i2c_hal_read(uint8_t address, uint8_t *data, uint8_t count) { if ((NULL != data) && (0 != count)) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - - seq.addr = address << 1; - seq.flags = I2C_FLAG_READ; - seq.buf[0].data = (uint8_t *)data; - seq.buf[0].len = count; + i2c_master_set_slave_address(&s_i2c_handle, address); - ret = I2CSPM_Transfer(s_i2c_handle, &seq); - - if (ret == i2cTransferDone) { - return SL_STATUS_OK; + if (I2C_MASTER_SUCCESS != i2c_master_read(&s_i2c_handle, + data, + count)) { + return SL_STATUS_FAIL; } - return SL_STATUS_FAIL; + return SL_STATUS_OK; } return SL_STATUS_INVALID_PARAMETER; } @@ -134,19 +143,14 @@ sl_status_t sensirion_i2c_hal_write(uint8_t address, const uint8_t *data, uint8_t count) { if (NULL != data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - - seq.addr = address << 1; - seq.flags = I2C_FLAG_WRITE; - seq.buf[0].data = (uint8_t *)data; - seq.buf[0].len = count; + i2c_master_set_slave_address(&s_i2c_handle, address); - ret = I2CSPM_Transfer(s_i2c_handle, &seq); - if (ret == i2cTransferDone) { - return SL_STATUS_OK; + if (I2C_MASTER_SUCCESS != i2c_master_write(&s_i2c_handle, + data, + count)) { + return SL_STATUS_FAIL; } - return SL_STATUS_FAIL; + return SL_STATUS_OK; } return SL_STATUS_INVALID_PARAMETER; } @@ -161,5 +165,11 @@ sl_status_t sensirion_i2c_hal_write(uint8_t address, const uint8_t *data, */ void sensirion_i2c_hal_sleep_usec(uint32_t useconds) { - sl_udelay_wait(useconds); + uint32_t delay_ms = 1; + + if (useconds > 1000) { + delay_ms = (useconds / 1000) + 1; + } + + sl_sleeptimer_delay_millisecond(delay_ms); } diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_uart_hal.c b/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_uart_hal.c index 02a844e1..93843049 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_uart_hal.c +++ b/driver/public/silabs/particulate_matter_sensor_sps30/src/sensirion_uart_hal.c @@ -31,9 +31,10 @@ #include "sensirion_uart_hal.h" #include "sl_status.h" -#include "sl_udelay.h" -static sl_iostream_t *s_iostream_handle = NULL; +static uart_t s_sensirion_uart; +static uint8_t s_sensirion_tx_buffer[256]; +static uint8_t s_sensirion_rx_buffer[256]; /* * INSTRUCTIONS @@ -47,12 +48,29 @@ static sl_iostream_t *s_iostream_handle = NULL; * Initialize all hard- and software components that are needed for the UART * communication. */ -sl_status_t sensirion_uart_init(sl_iostream_t *iostream_handle) +sl_status_t sensirion_uart_init(mikroe_uart_handle_t uart_handle) { uint32_t stt = SL_STATUS_INVALID_PARAMETER; - if (NULL != iostream_handle) { - s_iostream_handle = iostream_handle; + if (NULL != uart_handle) { + uart_config_t cfg; + + s_sensirion_uart.handle = uart_handle; + s_sensirion_uart.tx_ring_buffer = s_sensirion_tx_buffer; + s_sensirion_uart.rx_ring_buffer = s_sensirion_rx_buffer; + s_sensirion_uart.is_blocking = false; + + uart_configure_default(&cfg); + + cfg.tx_ring_size = sizeof(s_sensirion_tx_buffer); + cfg.rx_ring_size = sizeof(s_sensirion_rx_buffer); + + if (uart_open(&s_sensirion_uart, &cfg) != 0) { + return SL_STATUS_FAIL; + } + + uart_set_blocking(&s_sensirion_uart, false); + stt = SL_STATUS_OK; } return stt; @@ -104,16 +122,16 @@ sl_status_t sensirion_uart_tx(uint16_t data_len, const uint8_t *data, uint16_t *tx_bytes) { - if ((NULL != data) && (NULL != s_iostream_handle)) { - sl_status_t status = sl_iostream_write(s_iostream_handle, - data, - data_len); - if (SL_STATUS_OK == status) { + if ((NULL != data) && (NULL != s_sensirion_uart.handle)) { + err_t status = uart_write(&s_sensirion_uart, (uint8_t *)data, data_len); + + if (UART_ERROR != status) { if (NULL != tx_bytes) { - *tx_bytes = data_len; + *tx_bytes = status; } + return SL_STATUS_OK; } - return status; + return SL_STATUS_FAIL; } return SL_STATUS_INVALID_PARAMETER; } @@ -130,34 +148,16 @@ sl_status_t sensirion_uart_rx(uint16_t max_data_len, uint8_t *data, uint16_t *rx_bytes) { - if ((NULL != data) && (NULL != s_iostream_handle)) { - sl_status_t status = SL_STATUS_OK; - size_t read_size; - int32_t total_size = 0; - - while (max_data_len && (SL_STATUS_OK == status)) - { - status = sl_iostream_read(s_iostream_handle, - data, - max_data_len, - &read_size); - if (SL_STATUS_OK == status) { - if (read_size > 0) { - if (read_size <= max_data_len) { - max_data_len -= read_size; - data += read_size; - total_size += read_size; - } else { - max_data_len = 0; - } - } - } - } + if ((NULL != data) && (NULL != s_sensirion_uart.handle)) { + err_t status = uart_read(&s_sensirion_uart, data, max_data_len); - if (NULL != rx_bytes) { - *rx_bytes = total_size; + if (UART_ERROR != status) { + if (NULL != rx_bytes) { + *rx_bytes = status; + } + return SL_STATUS_OK; } - return SL_STATUS_OK; + return SL_STATUS_FAIL; } return SL_STATUS_INVALID_PARAMETER; } @@ -172,5 +172,11 @@ sl_status_t sensirion_uart_rx(uint16_t max_data_len, */ void sensirion_sleep_usec(uint32_t useconds) { - sl_udelay_wait(useconds); + uint32_t delay_ms = 1; + + if (useconds > 1000) { + delay_ms = (useconds / 1000) + 1; + } + + sl_sleeptimer_delay_millisecond(delay_ms); } diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_i2c.c b/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_i2c.c index de7e73e3..d6a0d250 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_i2c.c +++ b/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_i2c.c @@ -53,7 +53,7 @@ #define SPS30_SERIAL_NUM_WORDS ((SPS30_MAX_SERIAL_LEN) / 2) -sl_status_t sps30_init(sl_i2cspm_t *i2cspm) +sl_status_t sps30_init(mikroe_i2c_handle_t i2cspm) { return sensirion_i2c_init(i2cspm); } diff --git a/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_uart.c b/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_uart.c index 6496edbe..69906ed6 100644 --- a/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_uart.c +++ b/driver/public/silabs/particulate_matter_sensor_sps30/src/sparkfun_sps30_uart.c @@ -52,7 +52,7 @@ #define SPS30_CMD_RESET (0xd3) #define SPS30_ERR_STATE(state) (SPS30_ERR_STATE_MASK | (state)) -uint32_t sps30_init(sl_iostream_t *uart_handle) +uint32_t sps30_init(mikroe_uart_handle_t uart_handle) { return sensirion_uart_init(uart_handle); } diff --git a/driver/public/silabs/pir_ira_s210st01/inc/pir_ira_s210st01.h b/driver/public/silabs/pir_ira_s210st01/inc/pir_ira_s210st01.h deleted file mode 100644 index 0fe595d8..00000000 --- a/driver/public/silabs/pir_ira_s210st01/inc/pir_ira_s210st01.h +++ /dev/null @@ -1,224 +0,0 @@ -/***************************************************************************//** - * @file - * @brief Driver for PIR sensor - * @version 1.0.2 - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef PIR_H -#define PIR_H - -#include -#include -#include "sl_status.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************************************************************//** - * @addtogroup PIR - * @{ - * - * @brief - * The implementation of PIR sensor driver using the PIR sensor on the - * occupancy - * sensor EXP board. - * - * The target application of the PIR sensor would be smart lighting or alarm - * systems in home automation. Whenever certain motion of the human body is - * detected, the system will either turn on the light or the alarm. - ******************************************************************************/ - -/// Configures whether to use the internal opamp or an external opamp. -typedef enum { - pir_opamp_mode_internal = 0, - pir_opamp_mode_external = 1, -} pir_opamp_mode_t; - -/// Selects whether to use the dedicated main opamp ports or use the APORT -/// selection. -typedef enum { - pir_opamp_main_ports = 0, - pir_opamp_aport = 1, -} pir_opamp_port_t; - -/// Selects whether to operate the ADC in single ended positive, negative or -/// differential mode. -typedef enum { - pir_adc_source_pos = 0, - pir_adc_source_neg = 1, - pir_adc_source_diff = 2, -} pir_adc_source_t; - -/***************************************************************************//** - * @brief - * ADC IRQ callback function - * - * @note - * This function is called whenever an ADC interrupt is received. It's up to - * the application to decide how to handle the interrupt. However, in order to - * detect motion properly, pir_detect_motion function must be called within - * 30ms after receiving the interrupt to process the latest ADC sample . - ******************************************************************************/ -typedef void (*pir_adc_irq_callback_t)(); - -/***************************************************************************//** - * @brief - * Motion detection result callback function - * - * @param[in] motion_status - * True indicates motion on is detected - * False indicates motion off is detected - * - * @note - * This function is called whenever motion on/off status is detected in the - * algorithm. The application should check the motion_status and take actions - * accordingly. - ******************************************************************************/ -typedef void (*pir_motion_detection_callback_t)(bool motion_status); - -/// Structure for PIR sample. -typedef struct { - int32_t timestamp_ms; ///< A 16-bit timestamp from the 1024 Hz counter. - int32_t adc_sample; ///< The ADC sample measuring the PIR voltage. - int32_t win_base; ///< The center of the detector window. - int32_t adc_upper_threshold; ///< The upper threshold of the detector window. - int32_t adc_lower_threshold; ///< The lower threshold of the detector window. - bool motion_status; ///< Whether motion was detected. -} pir_sample_t; - -/// Initialization structure for PIR driver. -typedef struct { - ///< Use internal or external opamp. - pir_opamp_mode_t opamp_mode; - ///< The duration of time(in seconds) motion on being asserted after detected. - uint32_t motion_on_time; - ///< The peak to peak window size for motion detection in lsb. - uint32_t win_size; - ///< ADC IRQ callback. - pir_adc_irq_callback_t adc_irq_callback; - ///< Motion detection result callback. - pir_motion_detection_callback_t motion_detection_callback; - ///< PIR sample queue size. Must be no smaller than 4. - uint16_t sample_queue_size; - ///< A sample buffer supplied by the user. - pir_sample_t *sample_queue; - ///< Whether to apply timestamp to PIR samples or not. - bool use_timestamp; -} pir_init_t; - -/// Default initialization structure for PIR driver. -#define PIR_INIT_DEFAULT \ - { \ - .opamp_mode = pir_opamp_mode_external, \ - .motion_on_time = 4, \ - .win_size = 1024, \ - .adc_irq_callback = NULL, \ - .motion_detection_callback = NULL, \ - .sample_queue_size = 4, \ - .sample_queue = NULL, \ - .use_timestamp = true, \ - } - -/***************************************************************************//** - * @brief - * Initializes peripherals for PIR - * - * @param[in] pir_init - * Pointer to PIR initialization structure - * - * @param[in] adc_enter_em2 - * Sets up ADC to run in EM2 when set to true - * - * @return - * Returns zero on OK, non-zero otherwise - ******************************************************************************/ -sl_status_t pir_init(pir_init_t *pir_init, bool adc_enter_em2); - -/***************************************************************************//** - * @brief - * Runs the motion detection algorithm - * - * @note - * This algorithms takes roughly 150us and must run on the latest ADC sample - * after receiving the ADC interrupt. - * - * @return - * Returns zero on OK, non-zero otherwise - ******************************************************************************/ -sl_status_t pir_detect_motion(void); - -/***************************************************************************//** - * @brief - * Starts PIR sensor sampling - * - * @return - * Returns zero on OK, non-zero otherwise - ******************************************************************************/ -sl_status_t pir_start(void); - -/***************************************************************************//** - * @brief - * Stops PIR sensor sampling - * - * @return - * Returns zero on OK, non-zero otherwise - ******************************************************************************/ -sl_status_t pir_stop(void); - -/***************************************************************************//** - * @brief - * Reads out a sample from the PIR sample queue - * - * @param[out] pir_sample - * Pointer to the PIR sample - * - * @return - * Returns zero on OK, non-zero otherwise - ******************************************************************************/ -sl_status_t pir_read_queue(pir_sample_t *pir_sample); - -/***************************************************************************//** - * @brief - * Gets number of samples in the queue. - * - * @param[out] status - * Pointer to the status - * - * @return - * The number of samples in the queue. - ******************************************************************************/ -sl_status_t pir_get_queue_size(uint16_t *size); - -/** @} (end addtogroup PIR) */ - -#ifdef __cplusplus -} -#endif - -#endif // PIR_H diff --git a/driver/public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s1.c b/driver/public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s1.c deleted file mode 100644 index d512ace3..00000000 --- a/driver/public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s1.c +++ /dev/null @@ -1,838 +0,0 @@ -/***************************************************************************//** - * @file - * @brief PIR driver. - * @version 1.0.2 - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ -#include "em_cmu.h" -#include "em_emu.h" -#include "em_gpio.h" -#include "em_prs.h" -#include "em_cryotimer.h" -#include "em_opamp.h" -#include "em_adc.h" -#include "em_vdac.h" -#include "em_opamp.h" -#include "em_letimer.h" - -#include -#include -#include -#include - -#define ADC_PERIPHERAL ADC0 -#define ADC_PERIPHERAL_NO 0 - -#define ADC_SAMPLE_QUEUE_SIZE 4 // Must be at least 4 - -/// The adcSource variable should be set to adcSourceAdcDiff for PIR operation. -/// The single ended modes are additional modes for signal chain analysis with a -/// voltage source. -#define PIR_SOURCE_POS 0 -#define PIR_SOURCE_NEG 1 -#define PIR_SOURCE_DIFF 2 -#if defined(PIR_IRA_S210ST01_ADC_P_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_P_PIN) && \ - defined(PIR_IRA_S210ST01_ADC_N_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_N_PIN) -#define PIR_SOURCE PIR_SOURCE_DIFF -#elif defined(PIR_IRA_S210ST01_ADC_P_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_P_PIN) -#define PIR_SOURCE PIR_SOURCE_POS -#else -#define PIR_SOURCE PIR_SOURCE_NEG -#error "The posSel of the ADC is not defined for the kit, only the negSel" -#endif - -/// PIR sample queue structure -typedef struct { - volatile uint16_t head; ///< Index of next byte to get. - volatile uint16_t tail; ///< Index of where to enqueue next - ///< byte. - volatile uint16_t used; ///< Number of bytes queued. - uint16_t size; ///< Size of queue. - pir_sample_t *sample; ///< Pointer to PIR sample buffer. -} sample_queue_t; - -static pir_init_t pir_instance; // An instance that holds the configuration -static uint32_t lockout_counter = 0; // The time, in samples, remaining on the - // lockout window after detection. -static int32_t win_base = 0; // The low frequency mean of the PIR input - // signal. - -static sample_queue_t app_queue; // Buffer PIR samples for application layer - // debugging. -static sample_queue_t adc_queue; // Buffer ADC samples for motion detection - // algorithm. -static pir_sample_t adc_sample_queue[ADC_SAMPLE_QUEUE_SIZE]; // ADC sample - // buffer. - -#if PIR_SOURCE == PIR_SOURCE_DIFF || PIR_SOURCE == PIR_SOURCE_POS -static const ADC_PosSel_TypeDef adc_aportx_table_A[] = { - adcPosSelAPORT3XCH8, - adcPosSelAPORT4XCH9, - adcPosSelAPORT3XCH10, - adcPosSelAPORT4XCH11, - adcPosSelAPORT3XCH12, - adcPosSelAPORT4XCH13, - adcPosSelAPORT3XCH14, - adcPosSelAPORT4XCH15 -}; -static const ADC_PosSel_TypeDef adc_aportx_table_B[] = { - adcPosSelAPORT3XCH22, - adcPosSelAPORT4XCH23, - adcPosSelAPORT3XCH24, - adcPosSelAPORT4XCH25, - adcPosSelAPORT3XCH26, - adcPosSelAPORT4XCH27, - adcPosSelAPORT3XCH28, - adcPosSelAPORT4XCH29, - adcPosSelAPORT3XCH30, - adcPosSelAPORT4XCH31 -}; -static const ADC_PosSel_TypeDef adc_aportx_table_C[] = { - adcPosSelAPORT1XCH0, - adcPosSelAPORT2XCH1, - adcPosSelAPORT1XCH2, - adcPosSelAPORT2XCH3, - adcPosSelAPORT1XCH4, - adcPosSelAPORT2XCH5, - adcPosSelAPORT1XCH6, - adcPosSelAPORT2XCH7, - adcPosSelAPORT1XCH8, - adcPosSelAPORT2XCH9, - adcPosSelAPORT1XCH10, - adcPosSelAPORT2XCH11, -}; -static const ADC_PosSel_TypeDef adc_aportx_table_D[] = { - adcPosSelAPORT3XCH0, - adcPosSelAPORT4XCH1, - adcPosSelAPORT3XCH2, - adcPosSelAPORT4XCH3, - adcPosSelAPORT3XCH4, - adcPosSelAPORT4XCH5, - adcPosSelAPORT3XCH6, - adcPosSelAPORT4XCH7, -}; -static const ADC_PosSel_TypeDef adc_aportx_table_F[] = { - adcPosSelAPORT1XCH16, - adcPosSelAPORT2XCH17, - adcPosSelAPORT1XCH18, - adcPosSelAPORT2XCH19, - adcPosSelAPORT1XCH20, - adcPosSelAPORT2XCH21, - adcPosSelAPORT1XCH22, - adcPosSelAPORT2XCH23, - adcPosSelAPORT1XCH24, - adcPosSelAPORT2XCH25, - adcPosSelAPORT1XCH26, - adcPosSelAPORT2XCH27, - adcPosSelAPORT1XCH28, - adcPosSelAPORT2XCH29, - adcPosSelAPORT1XCH30, - adcPosSelAPORT2XCH31 -}; -static const ADC_PosSel_TypeDef adc_aportx_table_I[] = { - adcPosSelAPORT0XCH0, - adcPosSelAPORT0XCH1, - adcPosSelAPORT0XCH2, - adcPosSelAPORT0XCH3 -}; -#endif - -#if PIR_SOURCE == PIR_SOURCE_DIFF || PIR_SOURCE == PIR_SOURCE_NEG -static const ADC_NegSel_TypeDef adc_aporty_table_A[] = { - adcNegSelAPORT4YCH8, - adcNegSelAPORT3YCH9, - adcNegSelAPORT4YCH10, - adcNegSelAPORT3YCH11, - adcNegSelAPORT4YCH12, - adcNegSelAPORT3YCH13, - adcNegSelAPORT4YCH14, - adcNegSelAPORT3YCH15 -}; -static const ADC_NegSel_TypeDef adc_aporty_table_B[] = { - adcNegSelAPORT4YCH22, - adcNegSelAPORT3YCH23, - adcNegSelAPORT4YCH24, - adcNegSelAPORT3YCH25, - adcNegSelAPORT4YCH26, - adcNegSelAPORT3YCH27, - adcNegSelAPORT4YCH28, - adcNegSelAPORT3YCH29, - adcNegSelAPORT4YCH30, - adcNegSelAPORT3YCH31 -}; -static const ADC_NegSel_TypeDef adc_aporty_table_C[] = { - adcNegSelAPORT2YCH0, - adcNegSelAPORT1YCH1, - adcNegSelAPORT2YCH2, - adcNegSelAPORT1YCH3, - adcNegSelAPORT2YCH4, - adcNegSelAPORT1YCH5, - adcNegSelAPORT2YCH6, - adcNegSelAPORT1YCH7, - adcNegSelAPORT2YCH8, - adcNegSelAPORT1YCH9, - adcNegSelAPORT2YCH10, - adcNegSelAPORT1YCH11, -}; -static const ADC_NegSel_TypeDef adc_aporty_table_D[] = { - adcNegSelAPORT4YCH0, - adcNegSelAPORT3YCH1, - adcNegSelAPORT4YCH2, - adcNegSelAPORT3YCH3, - adcNegSelAPORT4YCH4, - adcNegSelAPORT3YCH5, - adcNegSelAPORT4YCH6, - adcNegSelAPORT3YCH7, -}; -static const ADC_NegSel_TypeDef adc_aporty_table_F[] = { - adcNegSelAPORT2YCH16, - adcNegSelAPORT1YCH17, - adcNegSelAPORT2YCH18, - adcNegSelAPORT1YCH19, - adcNegSelAPORT2YCH20, - adcNegSelAPORT1YCH21, - adcNegSelAPORT2YCH22, - adcNegSelAPORT1YCH23, - adcNegSelAPORT2YCH24, - adcNegSelAPORT1YCH25, - adcNegSelAPORT2YCH26, - adcNegSelAPORT1YCH27, - adcNegSelAPORT2YCH28, - adcNegSelAPORT1YCH29, - adcNegSelAPORT2YCH30, - adcNegSelAPORT1YCH31 -}; -static const ADC_NegSel_TypeDef adc_aporty_table_I[] = { - adcNegSelAPORT0YCH0, - adcNegSelAPORT0YCH1, - adcNegSelAPORT0YCH2, - adcNegSelAPORT0YCH3 -}; -#endif - -#if PIR_SOURCE == PIR_SOURCE_DIFF || PIR_SOURCE == PIR_SOURCE_POS -static ADC_PosSel_TypeDef get_adc_aportx(GPIO_Port_TypeDef port_index, - unsigned int pin_index) -{ - switch (port_index) { - case gpioPortA: - if (pin_index <= 7) { - return adc_aportx_table_A[pin_index]; - } else { - return adcPosSelVSS; - } - - case gpioPortB: - if ((pin_index >= 6) && (pin_index <= 15)) { - return adc_aportx_table_B[pin_index - 6]; - } else { - return adcPosSelVSS; - } - - case gpioPortC: - if (pin_index <= 11) { - return adc_aportx_table_C[pin_index]; - } else { - return adcPosSelVSS; - } - - case gpioPortD: - if ((pin_index >= 8) && (pin_index <= 15)) { - return adc_aportx_table_D[pin_index - 8]; - } else { - return adcPosSelVSS; - } - - case gpioPortF: - if (pin_index <= 15) { - return adc_aportx_table_F[pin_index]; - } else { - return adcPosSelVSS; - } - - case gpioPortI: - if (pin_index <= 3) { - return adc_aportx_table_I[pin_index]; - } else { - return adcPosSelVSS; - } - - default: - return adcPosSelVSS; - } - return adcPosSelVSS; -} - -#endif - -#if PIR_SOURCE == PIR_SOURCE_DIFF || PIR_SOURCE == PIR_SOURCE_NEG -static ADC_NegSel_TypeDef get_adc_aporty(GPIO_Port_TypeDef port_index, - unsigned int pin_index) -{ - switch (port_index) { - case gpioPortA: - if (pin_index <= 7) { - return adc_aporty_table_A[pin_index]; - } else { - return adcNegSelVSS; - } - - case gpioPortB: - if ((pin_index >= 6) && (pin_index <= 15)) { - return adc_aporty_table_B[pin_index - 6]; - } else { - return adcNegSelVSS; - } - - case gpioPortC: - if (pin_index <= 11) { - return adc_aporty_table_C[pin_index]; - } else { - return adcNegSelVSS; - } - - case gpioPortD: - if ((pin_index >= 8) && (pin_index <= 15)) { - return adc_aporty_table_D[pin_index - 8]; - } else { - return adcNegSelVSS; - } - - case gpioPortF: - if (pin_index <= 15) { - return adc_aporty_table_F[pin_index]; - } else { - return adcNegSelVSS; - } - - case gpioPortI: - if (pin_index <= 3) { - return adc_aporty_table_I[pin_index]; - } else { - return adcNegSelVSS; - } - - default: - return adcNegSelVSS; - } - return adcNegSelVSS; -} - -#endif - -/***************************************************************************//** - * @brief - * Updates the ADC hardware thresholds for a motion event trigger. - * - * Inputs must mast the conversion data representation. For oversampled - * conversions, the resolution is 16-bit, regardless if the OVS setting - * does not achieve 16-bit resolution. - * - * @param[in] win_base - * The midpoint of the window. Thresholds are the base +/- 0.5*winSize - * - * @param[in] win_size - * The total peak to peak width of the window. - ******************************************************************************/ -static void update_adc_thresholds(int32_t win_base, uint32_t win_size) -{ - int32_t pos_thresh = win_base + win_size / 2; - int32_t neg_thresh = win_base - win_size / 2; - - // Ensure thresholds are within int16_t for ADC window comparator. - int32_t pos_thresh_max, neg_thresh_min; -#if PIR_SOURCE == PIR_SOURCE_DIFF - pos_thresh_max = 32767; - neg_thresh_min = -32768; -#else - pos_thresh_max = 65535; - neg_thresh_min = 0; -#endif - - if (pos_thresh > pos_thresh_max) { - pos_thresh = pos_thresh_max; - } - if (neg_thresh < neg_thresh_min) { - neg_thresh = neg_thresh_min; - } - - ADC0->CMPTHR = - ((pos_thresh << _ADC_CMPTHR_ADGT_SHIFT) & _ADC_CMPTHR_ADGT_MASK) - | ((neg_thresh << - _ADC_CMPTHR_ADLT_SHIFT) & _ADC_CMPTHR_ADLT_MASK); -} - -/***************************************************************************//** - * @brief - * Initializes the non inverting amplifier for PIR signal chain. - ******************************************************************************/ -static void init_opamp(void) -{ - CMU_ClockEnable(cmuClock_VDAC0, true); - - // Errata VDAC_E201 for PG/JG/MG/BG12 causes contention if APORT is used for - // output. - // Use of dedicated opamp output pin or careful mapping of APORT buses is - // recommended. - OPAMP_Init_TypeDef opaInit = OPA_INIT_NON_INVERTING; - opaInit.resInMux = opaResInMuxDisable; - opaInit.resSel = opaResSelDefault; - - opaInit.posSel = opaPosSelPosPad; - opaInit.negSel = opaNegSelNegPad; - opaInit.outMode = opaOutModeDisable; - opaInit.outPen = VDAC_OPA_OUT_MAINOUTEN; - - const uint32_t opampCh = 1; - OPAMP_Enable(VDAC0, OPA1, &opaInit); - - // Set INCBW for 2.5x increase in GBW, only stable for G > 3. - VDAC0->OPA[opampCh].CTRL |= VDAC_OPA_CTRL_INCBW; - - // Set DRIVESTRENGTH=0 to minimize current. - VDAC0->OPA[opampCh].CTRL &= ~_VDAC_OPA_CTRL_DRIVESTRENGTH_MASK; - VDAC0->OPA[opampCh].CTRL |= (0 << _VDAC_OPA_CTRL_DRIVESTRENGTH_SHIFT); -} - -/***************************************************************************//** - * @brief - * Initializes the ADC, CRYOTIMER and PRS for PIR operation. - * - * @details - * PRS triggering of the ADC in EM2 is only possible on > Series 1 MCUs. - * - * @param[in] adc_enter_em2 - * Sets up ADC to run in EM2 when set to true. - ******************************************************************************/ -static sl_status_t init_adc(bool adc_enter_em2) -{ - // Initialize the ADC. - CMU_ClockEnable(cmuClock_ADC0, true); - - ADC_Init_TypeDef adcInit = ADC_INIT_DEFAULT; - adcInit.ovsRateSel = adcOvsRateSel2; - - if (adc_enter_em2) { - CMU_AUXHFRCOBandSet(cmuAUXHFRCOFreq_4M0Hz); - CMU->ADCCTRL = CMU_ADCCTRL_ADC0CLKSEL_AUXHFRCO; - adcInit.em2ClockConfig = adcEm2ClockOnDemand; - adcInit.prescale = ADC_PrescaleCalc(cmuAUXHFRCOFreq_4M0Hz, - CMU_AUXHFRCOBandGet()); - adcInit.timebase = ADC_TimebaseCalc(CMU_AUXHFRCOBandGet()); - } else { - adcInit.timebase = ADC_TimebaseCalc(0); - } - - ADC_InitSingle_TypeDef adcInitSingle = ADC_INITSINGLE_DEFAULT; - adcInitSingle.resolution = adcResOVS; - adcInitSingle.reference = adcRef1V25; - adcInitSingle.prsEnable = true; - adcInitSingle.prsSel = adcPRSSELCh0; - adcInitSingle.leftAdjust = true; - adcInitSingle.acqTime = adcAcqTime64; - -#if PIR_SOURCE == PIR_SOURCE_POS - adcInitSingle.posSel = get_adc_aportx(PIR_IRA_S210ST01_ADC_P_PORT, - PIR_IRA_S210ST01_ADC_P_PIN); - adcInitSingle.negSel = adcNegSelVSS; - if (adcInitSingle.posSel == adcPosSelVSS) { - return SL_STATUS_INVALID_CONFIGURATION; - } - adcInitSingle.diff = false; -#elif PIR_SOURCE == PIR_SOURCE_NEG - // The posSel of the ADC_N is not defined for the kit, only the negSel. - adcInitSingle.posSel = adcPosSelAVDD; - adcInitSingle.negSel = get_adc_aporty(PIR_IRA_S210ST01_ADC_N_PORT, - PIR_IRA_S210ST01_ADC_N_PIN); - if (adcInitSingle.negSel == adcNegSelVSS) { - return SL_STATUS_INVALID_CONFIGURATION; - } - adcInitSingle.diff = false; -#elif PIR_SOURCE == PIR_SOURCE_DIFF - adcInitSingle.posSel = get_adc_aportx(PIR_IRA_S210ST01_ADC_P_PORT, - PIR_IRA_S210ST01_ADC_P_PIN); - adcInitSingle.negSel = get_adc_aporty(PIR_IRA_S210ST01_ADC_N_PORT, - PIR_IRA_S210ST01_ADC_N_PIN); - if ((adcInitSingle.posSel == adcPosSelVSS) - || (adcInitSingle.negSel == adcNegSelVSS)) { - return SL_STATUS_INVALID_CONFIGURATION; - } - adcInitSingle.diff = true; -#endif - - ADC_Init(ADC0, &adcInit); - ADC_InitSingle(ADC0, &adcInitSingle); - - // Set ADC FIFO level to max to minimize EM0 wakeups when the ADC sample - // remains within window. - static const uint32_t dataValidLevel = 3; // ADC SINGLE IRQ is when DVL+1 - // single channels are available - // in the FIFO. - ADC0->SINGLECTRLX &= ~_ADC_SINGLECTRLX_DVL_MASK; - ADC0->SINGLECTRLX |= (dataValidLevel << _ADC_SINGLECTRLX_DVL_SHIFT); - - update_adc_thresholds(win_base, pir_instance.win_size); -// -// // Initialize the CRYOTIMER. -// CMU_OscillatorEnable(cmuOsc_ULFRCO, true, true); - CMU_ClockEnable(cmuClock_CRYOTIMER, true); - - // Run CRYOTIMER on ULFRCO (1024 Hz) and trigger ADC to set the sampling - // period. - CRYOTIMER_Init_TypeDef cryoInit = CRYOTIMER_INIT_DEFAULT; - cryoInit.osc = cryotimerOscULFRCO; - cryoInit.presc = cryotimerPresc_1; - cryoInit.period = cryotimerPeriod_8; // Sampling frequency is 1024 / 32 = 32 - // Hz. - CRYOTIMER_Init(&cryoInit); - - // PRS is the triggering connection between CRYOTIMER and ADC. - CMU_ClockEnable(cmuClock_PRS, true); - PRS_SourceAsyncSignalSet(0, - PRS_CH_CTRL_SOURCESEL_CRYOTIMER, - PRS_CH_CTRL_SIGSEL_CRYOTIMERPERIOD); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Initialize GPIO. - ******************************************************************************/ -static void init_gpio(void) -{ - CMU_ClockEnable(cmuClock_GPIO, true); - GPIO_PinModeSet(PIR_IRA_S210ST01_LDO_SHDN_B_PORT, - PIR_IRA_S210ST01_LDO_SHDN_B_PIN, - gpioModePushPull, - 0); -#if defined(PIR_IRA_S210ST01_ADC_P_PORT) && defined(PIR_IRA_S210ST01_ADC_P_PIN) - // ADC_P - GPIO_PinModeSet(PIR_IRA_S210ST01_ADC_P_PORT, - PIR_IRA_S210ST01_ADC_P_PIN, - gpioModeDisabled, - 0); -#endif -#if defined(PIR_IRA_S210ST01_ADC_N_PORT) && defined(PIR_IRA_S210ST01_ADC_N_PIN) - // ADC_N - GPIO_PinModeSet(PIR_IRA_S210ST01_ADC_N_PORT, - PIR_IRA_S210ST01_ADC_N_PIN, - gpioModeDisabled, - 0); -#endif -} - -/***************************************************************************//** - * @brief - * Initialize timers for time stamping samples to the GUI. - * - * @details - * LETIMER0 will operate at 1024 Hz time stamp clock. - ******************************************************************************/ -static void init_timestamp_clock(void) -{ - // LETIMER Initialization - CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO); - CMU_ClockEnable(cmuClock_HFLE, true); - CMU_ClockEnable(cmuClock_LETIMER0, true); - CMU_ClockDivSet(cmuClock_LETIMER0, cmuClkDiv_32); // 32,768 Hz / 32 = 1024 Hz - // = 976.5625 us period - - LETIMER_Init_TypeDef letimerInit = LETIMER_INIT_DEFAULT; - LETIMER_Init(LETIMER0, &letimerInit); -} - -/***************************************************************************//** - * @brief - * Enqueue the PIR sample. - ******************************************************************************/ -static void enqueue_sample(sample_queue_t *queue, pir_sample_t sample) -{ - queue->sample[queue->head] = sample; - queue->head++; - if (queue->head == queue->size) { - queue->head = 0; - } - queue->used++; - - if (queue->head == queue->tail) { - // If buffer is full, drop the oldest sample in the circular buffer and - // update the tail pointer. - queue->tail++; - if (queue->tail == queue->size) { - queue->tail = 0; - } - queue->used = queue->size; - } -} - -/***************************************************************************//** - * @brief - * Dequeue the PIR sample. - ******************************************************************************/ -static void dequeue_sample(sample_queue_t *queue, pir_sample_t *sample) -{ - if (queue->used < 1) { - sample = NULL; - } - - *sample = queue->sample[queue->tail]; - queue->tail++; - if (queue->tail == queue->size) { - queue->tail = 0; - } - queue->used -= 1; -} - -/***************************************************************************//** - * @brief - * Initializes peripherals for PIR - * - * @param[in] pir_init - * A pointer to PIR initialization structure - * - * @param[in] adc_enter_em2 - * Sets up ADC to run in EM2 when set to true - ******************************************************************************/ -sl_status_t pir_init(pir_init_t *pir_init, bool adc_enter_em2) -{ - init_gpio(); - // Enable LDO to startup VPIR. - GPIO_PinOutSet(PIR_IRA_S210ST01_LDO_SHDN_B_PORT, - PIR_IRA_S210ST01_LDO_SHDN_B_PIN); - - pir_instance.opamp_mode = pir_init->opamp_mode; - pir_instance.motion_on_time = pir_init->motion_on_time; - pir_instance.win_size = pir_init->win_size; - pir_instance.motion_detection_callback = pir_init->motion_detection_callback; - pir_instance.adc_irq_callback = pir_init->adc_irq_callback; - pir_instance.use_timestamp = pir_init->use_timestamp; - if ((pir_instance.motion_detection_callback == NULL) - || (pir_instance.adc_irq_callback == NULL)) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - app_queue.size = pir_init->sample_queue_size; - app_queue.sample = pir_init->sample_queue; - if (app_queue.size < 4) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - adc_queue.size = ADC_SAMPLE_QUEUE_SIZE; - adc_queue.sample = adc_sample_queue; - - // Peripheral initialization - if (pir_init->opamp_mode == pir_opamp_mode_internal) { - init_opamp(); - } - if (pir_init->use_timestamp) { - init_timestamp_clock(); - } - if (SL_STATUS_OK == init_adc(adc_enter_em2)) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - // Default to motion off state - pir_instance.motion_detection_callback(false); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Starts PIR sensor sampling. - ******************************************************************************/ -sl_status_t pir_start(void) -{ - lockout_counter = 0; - - ADC_Start(ADC0, adcStartSingle); - // Wake up on FIFO reaching threshold. - ADC_IntEnable(ADC0, ADC_IF_SINGLE); - // Wake up on ADC exceeding window threshold. - ADC_IntEnable(ADC0, ADC_IF_SINGLECMP); - NVIC_EnableIRQ(ADC0_IRQn); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Stops PIR sensor sampling. - ******************************************************************************/ -sl_status_t pir_stop(void) -{ - ADC_IntDisable(ADC0, ADC_IF_SINGLE); - ADC_IntDisable(ADC0, ADC_IF_SINGLECMP); - NVIC_DisableIRQ(ADC0_IRQn); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Runs the motion detection algorithm - * - * @note - * This algorithms takes roughly 150us and must run on the latest ADC sample - * after receiving the ADC interrupt. - ******************************************************************************/ -sl_status_t pir_detect_motion(void) -{ - bool motion = false; - uint32_t num_of_samples = 0; - pir_sample_t adc_sample; - pir_sample_t pir_sample; - int32_t adc_thresh_high, adc_thresh_low; - - // Read out each ADC sample, update the LPF mean, and check if it was within - // the window thresholds - while (adc_queue.used > 0) { - num_of_samples++; - dequeue_sample(&adc_queue, &adc_sample); - // Capture the ADC and winBase of the current sample. - pir_sample.adc_sample = adc_sample.adc_sample; - pir_sample.win_base = win_base; -#if PIR_SOURCE == PIR_SOURCE_DIFF - adc_thresh_high = - ((int16_t) ((ADC0->CMPTHR & _ADC_CMPTHR_ADGT_MASK) >> - _ADC_CMPTHR_ADGT_SHIFT)); - adc_thresh_low = - ((int16_t) ((ADC0->CMPTHR & _ADC_CMPTHR_ADLT_MASK) >> - _ADC_CMPTHR_ADLT_SHIFT)); -#elif PIR_SOURCE == PIR_SOURCE_POS || PIR_SOURCE == PIR_SOURCE_NEG - adc_thresh_high = - ((uint16_t) ((ADC0->CMPTHR & _ADC_CMPTHR_ADGT_MASK) >> - _ADC_CMPTHR_ADGT_SHIFT)); - adc_thresh_low = - ((uint16_t) ((ADC0->CMPTHR & _ADC_CMPTHR_ADLT_MASK) >> - _ADC_CMPTHR_ADLT_SHIFT)); -#endif - - // If window was broken, move window thresholds to include the latest ADC - // reading. - // Thresholds are recalculated in software because samples are batch - // processed. - if (adc_sample.adc_sample > adc_thresh_high) { - win_base = adc_sample.adc_sample - pir_instance.win_size / 2; - motion = true; - } else if (adc_sample.adc_sample < adc_thresh_low) { - win_base = adc_sample.adc_sample + pir_instance.win_size / 2; - motion = true; - } else { - // Window was not broken, update winBase to follow the low frequency drift - // using a DT 1st order LPF. - // Let a = 2^-a_shift - // Equivalent continuous RC is given by Ts * (1-a) / a - uint32_t a_shift = 5; - win_base = - (adc_sample.adc_sample >> a_shift) + (win_base - (win_base >> a_shift)); - } - - update_adc_thresholds(win_base, pir_instance.win_size); - - // Enqueue the PIR sample - pir_sample.timestamp_ms = adc_sample.timestamp_ms; - pir_sample.motion_status = (lockout_counter > 0 || motion); - pir_sample.adc_upper_threshold = adc_thresh_high; - pir_sample.adc_lower_threshold = adc_thresh_low; - enqueue_sample(&app_queue, pir_sample); - } // while (data_valid) - - if (lockout_counter > 0) { - lockout_counter -= - (num_of_samples < lockout_counter) ? num_of_samples : lockout_counter; - if (lockout_counter == 0) { - // Motion off - pir_instance.motion_detection_callback(false); - } - } - - // Motion On - if (motion) { - lockout_counter = pir_instance.motion_on_time * 32; // 32Hz - pir_instance.motion_detection_callback(true); - } - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * ADC interrupt handler - ******************************************************************************/ -void ADC0_IRQHandler(void) -{ - uint32_t flags; - pir_sample_t adc_sample; - static int32_t last_timestamp = -1; - - flags = ADC_IntGetEnabled(ADC0); - ADC_IntClear(ADC0, flags); - NVIC_ClearPendingIRQ(ADC0_IRQn); - - // Enqueue the ADC sample - while (ADC0->SINGLEFIFOCOUNT > 0) - { - if ((last_timestamp < 0) && pir_instance.use_timestamp) { - last_timestamp = ~LETIMER_CounterGet(LETIMER0); - } - // adjust this with over-sampling for OSR < 64. Need to left shift to get to - // 16b. - adc_sample.adc_sample = ADC_DataSingleGet(ADC0) << 3; - adc_sample.timestamp_ms = last_timestamp; - enqueue_sample(&adc_queue, adc_sample); - } - - pir_instance.adc_irq_callback(); -} - -/***************************************************************************//** - * @brief - * Reads out a sample from the PIR sample queue. - * - * @param[out] pir_sample - * Pointer to the PIR sample - ******************************************************************************/ -sl_status_t pir_read_queue(pir_sample_t *pir_sample) -{ - if (app_queue.sample == NULL) { - return SL_STATUS_FAIL; - } - dequeue_sample(&app_queue, pir_sample); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Gets number of samples in the queue. - * - * @return - * The number of samples in the queue. - ******************************************************************************/ -sl_status_t pir_get_queue_size(uint16_t *size) -{ - if ((app_queue.sample == NULL) || (app_queue.used == 0)) { - *size = 0; - return SL_STATUS_FAIL; - } else { - *size = app_queue.used; - } - - return SL_STATUS_OK; -} diff --git a/driver/public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s2.c b/driver/public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s2.c deleted file mode 100644 index 92a8a19d..00000000 --- a/driver/public/silabs/pir_ira_s210st01/src/pir_ira_s210st01_s2.c +++ /dev/null @@ -1,752 +0,0 @@ -/***************************************************************************//** - * @file - * @brief PIR driver. - * @version 1.0.2 - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ -#include "em_cmu.h" -#include "em_emu.h" -#include "em_gpio.h" -#include "em_iadc.h" -#include "em_letimer.h" - -#include -#include -#include -#include - -#define ADC_PERIPHERAL IADC0 -#define ADC_CLOCK cmuClock_IADC0 - -// Set CLK_ADC to 10 MHz -#define CLK_SRC_ADC_FREQ 5000000 // CLK_SRC_ADC -#define CLK_ADC_FREQ 1000000 // CLK_ADC - 10 MHz max in normal mode - -// Desired Sampling frequency in Hz -#define SAMPLING_FREQ 32 -#define ADC_SAMPLING_FREQ 96 - -// Set IADC timer cycles -#define ADC_TIMER_CYCLES (CLK_SRC_ADC_FREQ / ADC_SAMPLING_FREQ) - -#define ADC_SAMPLE_QUEUE_SIZE 4 // Must be at least 4 - -/// The adcSource variable should be set to adcSourceAdcDiff for PIR operation. -/// The single ended modes are additional modes for signal chain analysis with a -/// voltage source. -#define PIR_SOURCE_POS 0 -#define PIR_SOURCE_NEG 1 -#define PIR_SOURCE_DIFF 2 -#if defined(PIR_IRA_S210ST01_ADC_P_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_P_PIN) && \ - defined(PIR_IRA_S210ST01_ADC_N_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_N_PIN) -#define PIR_SOURCE PIR_SOURCE_DIFF -#elif defined(PIR_IRA_S210ST01_ADC_P_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_P_PIN) -#define PIR_SOURCE PIR_SOURCE_POS -#else -#define PIR_SOURCE PIR_SOURCE_NEG -#error "The posInput of the ADC is not defined for the kit, only the negInput" -#endif - -#define adc_mux_even(ref, adc, bus, index) \ - GPIO->bus ## BUSALLOC |= \ - GPIO_ ## bus ## BUSALLOC_ ## bus ## EVEN ## index ## _ ## adc; -#define adc_mux_odd(ref, adc, bus, index) \ - GPIO->bus ## BUSALLOC |= \ - GPIO_ ## bus ## BUSALLOC_ ## bus ## ODD ## index ## _ ## adc; - -/// PIR sample queue structure -typedef struct { - volatile uint16_t head; ///< Index of next byte to get. - volatile uint16_t tail; ///< Index of where to enqueue next - ///< byte. - volatile uint16_t used; ///< Number of bytes queued. - uint16_t size; ///< Size of queue. - pir_sample_t *sample; ///< Pointer to PIR sample buffer. -} sample_queue_t; - -static pir_init_t pir_instance; // An instance that holds the configuration -static uint32_t lockout_counter = 0; // The time, in samples, remaining on the - // lockout window after detection. -static int32_t win_base = 0; // The low frequency mean of the PIR input - // signal. - -static int32_t pos_thresh = 0; -static int32_t neg_thresh = 0; - -static sample_queue_t app_queue; // Buffer PIR samples for application layer - // debugging. -static sample_queue_t adc_queue; // Buffer ADC samples for motion detection - // algorithm. -static pir_sample_t adc_sample_queue[ADC_SAMPLE_QUEUE_SIZE]; // ADC sample - // buffer. - -#if PIR_SOURCE == PIR_SOURCE_DIFF || PIR_SOURCE == PIR_SOURCE_POS -static sl_status_t allocate_analog_bus_even0(IADC_TypeDef *iadc, - GPIO_Port_TypeDef port) -{ - switch (port) { - case gpioPortA: -#if (IADC_COUNT == 1) - if (iadc == IADC0) { - adc_mux_even(iadc, ADC0, A, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (iadc == IADC1) { - adc_mux_even(iadc, ADC1, A, 0); - return SL_STATUS_OK; -#endif - } else { - return SL_STATUS_FAIL; - } - - case gpioPortB: -#if (IADC_COUNT == 1) - if (iadc == IADC0) { - adc_mux_even(iadc, ADC0, B, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (iadc == IADC1) { - adc_mux_even(iadc, ADC1, B, 0); - return SL_STATUS_OK; -#endif - } else { - return SL_STATUS_FAIL; - } - - case gpioPortC: - case gpioPortD: -#if (IADC_COUNT == 1) - if (iadc == IADC0) { - adc_mux_even(iadc, ADC0, CD, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (iadc == IADC1) { - adc_mux_even(iadc, ADC1, CD, 0); - return SL_STATUS_OK; -#endif - } else { - return SL_STATUS_FAIL; - } - - default: - return SL_STATUS_FAIL; - } -} - -#endif - -#if PIR_SOURCE == PIR_SOURCE_DIFF || PIR_SOURCE == PIR_SOURCE_NEG -static sl_status_t allocate_analog_bus_odd0(IADC_TypeDef *iadc, - GPIO_Port_TypeDef port) -{ - switch (port) { - case gpioPortA: -#if (IADC_COUNT == 1) - if (iadc == IADC0) { - adc_mux_odd(iadc, ADC0, A, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (iadc == IADC1) { - adc_mux_odd(iadc, ADC1, A, 0); - return SL_STATUS_OK; -#endif - } else { - return SL_STATUS_FAIL; - } - - case gpioPortB: -#if (IADC_COUNT == 1) - if (iadc == IADC0) { - adc_mux_odd(iadc, ADC0, B, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (iadc == IADC1) { - adc_mux_odd(iadc, ADC1, B, 0); - return SL_STATUS_OK; -#endif - } else { - return SL_STATUS_FAIL; - } - - case gpioPortC: - case gpioPortD: -#if (IADC_COUNT == 1) - if (iadc == IADC0) { - adc_mux_odd(iadc, ADC0, CD, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (iadc == IADC1) { - adc_mux_odd(iadc, ADC1, CD, 0); - return SL_STATUS_OK; -#endif - } else { - return SL_STATUS_FAIL; - } - - default: - return SL_STATUS_FAIL; - } -} - -#endif - -/***************************************************************************//** - * @brief - * Updates the ADC hardware thresholds for a motion event trigger. - * - * Inputs must mast the conversion data representation. For oversampled - * conversions, the resolution is 16-bit, regardless if the OVS setting - * does not achieve 16-bit resolution. - * - * @param[in] win_base - * The midpoint of the window. Thresholds are the base +/- 0.5*winSize - * - * @param[in] win_size - * The total peak to peak width of the window. - ******************************************************************************/ -static void update_adc_thresholds(int32_t win_base, uint32_t win_size) -{ - pos_thresh = win_base + win_size / 2; - neg_thresh = win_base - win_size / 2; - - // Ensure thresholds are within int16_t for ADC window comparator. - int32_t pos_thresh_max, neg_thresh_min; -#if PIR_SOURCE == PIR_SOURCE_DIFF - pos_thresh_max = 32767; - neg_thresh_min = -32768; -#else - pos_thresh_max = 65535; - neg_thresh_min = 0; -#endif - - if (pos_thresh > pos_thresh_max) { - pos_thresh = pos_thresh_max; - } - if (neg_thresh < neg_thresh_min) { - neg_thresh = neg_thresh_min; - } -} - -/***************************************************************************//** - * @brief - * Initializes the ADC, CRYOTIMER and PRS for PIR operation. - * - * @details - * PRS triggering of the ADC in EM2 is only possible on > Series 1 MCUs. - * - * @param[in] adc_enter_em2 - * Sets up ADC to run in EM2 when set to true. - ******************************************************************************/ -static sl_status_t init_adc(bool adc_enter_em2) -{ - // Declare initialization structures - IADC_Init_t adcInit = IADC_INIT_DEFAULT; - IADC_AllConfigs_t initAllConfigs = IADC_ALLCONFIGS_DEFAULT; - IADC_InitSingle_t initSingle = IADC_INITSINGLE_DEFAULT; - // Single input structure - IADC_SingleInput_t adcInitSingle = IADC_SINGLEINPUT_DEFAULT; - - CMU_ClockEnable(ADC_CLOCK, true); - - // Reset IADC to reset configuration in case it has been modified - IADC_reset(ADC_PERIPHERAL); - - // Use the FSRC0 as the IADC clock so it can run in EM2 - CMU_ClockSelectSet(ADC_CLOCK, cmuSelect_FSRCO); - - // Set the prescaler needed for the intended IADC clock frequency - adcInit.srcClkPrescale = IADC_calcSrcClkPrescale(ADC_PERIPHERAL, - CLK_SRC_ADC_FREQ, - 0); - - // Shutdown between conversions to reduce current - adcInit.warmup = iadcWarmupNormal; - - // Set timer cycles to configure sampling rate -#if ADC_TIMER_CYCLES > 65535 - adcInit.timerCycles = 65535; -#else - adcInit.timerCycles = ADC_TIMER_CYCLES; -#endif - - /* - * Configuration 0 is used by both scan and single conversions by - * default. Use internal bandgap as the reference and specify the - * reference voltage in mV. - * - * Resolution is not configurable directly but is based on the - * selected oversampling ratio (osrHighSpeed), which defaults to - * 2x and generates 12-bit results. - */ - initAllConfigs.configs[0].reference = iadcCfgReferenceVddx; - initAllConfigs.configs[0].vRef = 3300; - initAllConfigs.configs[0].osrHighSpeed = iadcCfgOsrHighSpeed2x; - initAllConfigs.configs[0].analogGain = iadcCfgAnalogGain1x; - - /* - * CLK_SRC_ADC is prescaled to derive the intended CLK_ADC frequency. - * - * Based on the default 2x oversampling rate (OSRHS)... - * - * conversion time = ((4 * OSRHS) + 2) / fCLK_ADC - * - * ...which, results in a maximum sampling rate of 833 ksps with the - * 2-clock input multiplexer switching time is included. - */ - initAllConfigs.configs[0].adcClkPrescale = IADC_calcAdcClkPrescale( - ADC_PERIPHERAL, - CLK_ADC_FREQ, - 0, - iadcCfgModeNormal, - adcInit.srcClkPrescale); -#if PIR_SOURCE == PIR_SOURCE_POS - adcInitSingle.posInput = IADC_portPinToPosInput(PIR_IRA_S210ST01_ADC_P_PORT, - PIR_IRA_S210ST01_ADC_P_PIN); - adcInitSingle.negInput = iadcNegInputGnd; - - // Allocate the analog bus for ADC inputs - if (SL_STATUS_OK != allocate_analog_bus_even0(ADC_PERIPHERAL, - PIR_IRA_S210ST01_ADC_P_PORT)) { - return SL_STATUS_INVALID_CONFIGURATION; - } -#elif PIR_SOURCE == PIR_SOURCE_NEG - // The posSel of the ADC_N is not defined for the kit, only the negSel. - adcInitSingle.posInput = iadcPosInputAvdd; - adcInitSingle.negInput = IADC_portPinToNegInput(PIR_IRA_S210ST01_ADC_N_PORT, - PIR_IRA_S210ST01_ADC_N_PIN); - - // Allocate the analog bus for ADC inputs - if (SL_STATUS_OK != allocate_analog_bus_odd0(ADC_PERIPHERAL, - PIR_IRA_S210ST01_ADC_N_PORT)) { - return SL_STATUS_INVALID_CONFIGURATION; - } -#elif PIR_SOURCE == PIR_SOURCE_DIFF - adcInitSingle.posInput = IADC_portPinToPosInput(PIR_IRA_S210ST01_ADC_P_PORT, - PIR_IRA_S210ST01_ADC_P_PIN); - adcInitSingle.negInput = IADC_portPinToNegInput(PIR_IRA_S210ST01_ADC_N_PORT, - PIR_IRA_S210ST01_ADC_N_PIN); - - // Allocate the analog bus for ADC inputs - if (SL_STATUS_OK != allocate_analog_bus_even0(ADC_PERIPHERAL, - PIR_IRA_S210ST01_ADC_P_PORT)) { - return SL_STATUS_INVALID_CONFIGURATION; - } - if (SL_STATUS_OK != allocate_analog_bus_odd0(ADC_PERIPHERAL, - PIR_IRA_S210ST01_ADC_N_PORT)) { - return SL_STATUS_INVALID_CONFIGURATION; - } -#endif - - // Single initialization - initSingle.triggerSelect = iadcTriggerSelTimer; - - // Enable triggering of single conversion - initSingle.start = true; - - // Initialize IADC - IADC_init(ADC_PERIPHERAL, &adcInit, &initAllConfigs); - - // Initialize a single-channel conversion - IADC_initSingle(ADC_PERIPHERAL, &initSingle, &adcInitSingle); - - // Clear any previous interrupt flags - IADC_clearInt(ADC_PERIPHERAL, _IADC_IF_MASK); - - // Enable single-channel done interrupts - IADC_enableInt(ADC_PERIPHERAL, IADC_IEN_SINGLEDONE); - - // Enable IADC interrupts - NVIC_ClearPendingIRQ(IADC_IRQn); - NVIC_EnableIRQ(IADC_IRQn); - - update_adc_thresholds(win_base, pir_instance.win_size); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Initialize GPIO. - ******************************************************************************/ -static void init_gpio(void) -{ - CMU_ClockEnable(cmuClock_GPIO, true); - GPIO_PinModeSet(PIR_IRA_S210ST01_LDO_SHDN_B_PORT, - PIR_IRA_S210ST01_LDO_SHDN_B_PIN, - gpioModePushPull, - 0); -#if defined(PIR_IRA_S210ST01_ADC_P_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_P_PIN) - // ADC_P - GPIO_PinModeSet(PIR_IRA_S210ST01_ADC_P_PORT, - PIR_IRA_S210ST01_ADC_P_PIN, - gpioModeDisabled, - 0); -#endif -#if defined(PIR_IRA_S210ST01_ADC_N_PORT) && \ - defined(PIR_IRA_S210ST01_ADC_N_PIN) - // ADC_N - GPIO_PinModeSet(PIR_IRA_S210ST01_ADC_N_PORT, - PIR_IRA_S210ST01_ADC_N_PIN, - gpioModeDisabled, - 0); -#endif -} - -/***************************************************************************//** - * @brief - * Initialize timers for time stamping samples to the GUI. - * - * @details - * LETIMER0 will operate at 1024 Hz time stamp clock. - ******************************************************************************/ - -/***************************************************************************//** - * @brief - * Initialize timers for time stamping samples to the GUI. - * - * @details - * LETIMER0 will operate at 1024 Hz time stamp clock. - ******************************************************************************/ -static void init_timestamp_clock(void) -{ - CMU_LFXOInit_TypeDef lfxoInit = CMU_LFXOINIT_DEFAULT; - LETIMER_Init_TypeDef letimerInit = LETIMER_INIT_DEFAULT; - - // Initialize the LFXO and use it as the EM23GRPACLK source - CMU_LFXOInit(&lfxoInit); - CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFXO); - CMU_ClockEnable(cmuClock_LETIMER0, true); - - LETIMER_Init(LETIMER0, &letimerInit); - -// // Clear any previous interrupt flags -// LETIMER_IntClear(LETIMER0, _LETIMER_IF_MASK); -// -// // Enable underflow interrupts -// LETIMER_IntEnable(LETIMER0, LETIMER_IEN_UF); -// -// // Enable LETIMER interrupts -// NVIC_ClearPendingIRQ(LETIMER0_IRQn); -// NVIC_EnableIRQ(LETIMER0_IRQn); -} - -/***************************************************************************//** - * @brief - * Enqueue the PIR sample. - ******************************************************************************/ -static void enqueue_sample(sample_queue_t *queue, pir_sample_t sample) -{ - queue->sample[queue->head] = sample; - queue->head++; - if (queue->head == queue->size) { - queue->head = 0; - } - queue->used++; - - if (queue->head == queue->tail) { - // If buffer is full, drop the oldest sample in the circular buffer and - // update the tail pointer. - queue->tail++; - if (queue->tail == queue->size) { - queue->tail = 0; - } - queue->used = queue->size; - } -} - -/***************************************************************************//** - * @brief - * Dequeue the PIR sample. - ******************************************************************************/ -static void dequeue_sample(sample_queue_t *queue, pir_sample_t *sample) -{ - if (queue->used < 1) { - sample = NULL; - } - - *sample = queue->sample[queue->tail]; - queue->tail++; - if (queue->tail == queue->size) { - queue->tail = 0; - } - queue->used -= 1; -} - -/***************************************************************************//** - * @brief - * Initializes peripherals for PIR - * - * @param[in] pir_init - * A pointer to PIR initialization structure - * - * @param[in] adc_enter_em2 - * Sets up ADC to run in EM2 when set to true - ******************************************************************************/ -sl_status_t pir_init(pir_init_t *pir_init, bool adc_enter_em2) -{ - init_gpio(); - // Enable LDO to startup VPIR. - GPIO_PinOutSet(PIR_IRA_S210ST01_LDO_SHDN_B_PORT, - PIR_IRA_S210ST01_LDO_SHDN_B_PIN); - - pir_instance.opamp_mode = pir_init->opamp_mode; - pir_instance.motion_on_time = pir_init->motion_on_time; - pir_instance.win_size = pir_init->win_size; - pir_instance.motion_detection_callback = pir_init->motion_detection_callback; - pir_instance.adc_irq_callback = pir_init->adc_irq_callback; - pir_instance.use_timestamp = pir_init->use_timestamp; - if ((pir_instance.motion_detection_callback == NULL) - || (pir_instance.adc_irq_callback == NULL)) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - app_queue.size = pir_init->sample_queue_size; - app_queue.sample = pir_init->sample_queue; - if (app_queue.size < 4) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - adc_queue.size = ADC_SAMPLE_QUEUE_SIZE; - adc_queue.sample = adc_sample_queue; - - // Peripheral initialization - if (pir_init->opamp_mode == pir_opamp_mode_internal) { - return SL_STATUS_NOT_SUPPORTED; - } - - if (pir_init->use_timestamp) { - init_timestamp_clock(); - } - - if (SL_STATUS_OK != init_adc(adc_enter_em2)) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - // Default to motion off state - pir_instance.motion_detection_callback(false); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Starts PIR sensor sampling. - ******************************************************************************/ -sl_status_t pir_start(void) -{ - lockout_counter = 0; - - // Clear any previous interrupt flags - IADC_clearInt(ADC_PERIPHERAL, _IADC_IF_MASK); - - // Enable single-channel done interrupts - IADC_enableInt(ADC_PERIPHERAL, IADC_IEN_SINGLEDONE); - - // Enable IADC interrupts - NVIC_ClearPendingIRQ(IADC_IRQn); - NVIC_EnableIRQ(IADC_IRQn); - - // IADC single already enabled; must enable timer block in order to trigger - IADC_command(ADC_PERIPHERAL, iadcCmdEnableTimer); - -// // Enable underflow interrupts -// LETIMER_IntEnable(LETIMER0, LETIMER_IEN_UF); -// -// // Enable LETIMER interrupts -// NVIC_ClearPendingIRQ(LETIMER0_IRQn); -// NVIC_EnableIRQ(LETIMER0_IRQn); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Stops PIR sensor sampling. - ******************************************************************************/ -sl_status_t pir_stop(void) -{ - // Disable single-channel done interrupts - IADC_disableInt(ADC_PERIPHERAL, IADC_IEN_SINGLEDONE); - - NVIC_DisableIRQ(IADC_IRQn); - - // Stop an IADC conversion - IADC_command(ADC_PERIPHERAL, iadcCmdDisableTimer); - -// // Disable underflow interrupts -// LETIMER_IntDisable(LETIMER0, LETIMER_IEN_UF); -// -// // Disable LETIMER interrupts -// NVIC_DisableIRQ(LETIMER0_IRQn); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Runs the motion detection algorithm - * - * @note - * This algorithms takes roughly 150us and must run on the latest ADC sample - * after receiving the ADC interrupt. - ******************************************************************************/ -sl_status_t pir_detect_motion(void) -{ - bool motion = false; - uint32_t num_of_samples = 0; - pir_sample_t adc_sample; - pir_sample_t pir_sample; - - // Read out each ADC sample, update the LPF mean, and check if it was within - // the window thresholds - while (adc_queue.used > 0) { - num_of_samples++; - dequeue_sample(&adc_queue, &adc_sample); - // Capture the ADC and winBase of the current sample. - pir_sample.adc_sample = adc_sample.adc_sample; - pir_sample.win_base = win_base; - - // If window was broken, move window thresholds to include the latest ADC - // reading. - // Thresholds are recalculated in software because samples are batch - // processed. - if (adc_sample.adc_sample > pos_thresh) { - win_base = adc_sample.adc_sample - pir_instance.win_size / 2; - motion = true; - } else if (adc_sample.adc_sample < neg_thresh) { - win_base = adc_sample.adc_sample + pir_instance.win_size / 2; - motion = true; - } else { - // Window was not broken, update winBase to follow the low frequency drift - // using a DT 1st order LPF. - // Let a = 2^-a_shift - // Equivalent continuous RC is given by Ts * (1-a) / a - uint32_t a_shift = 5; - win_base = - (adc_sample.adc_sample >> a_shift) + (win_base - (win_base >> a_shift)); - } - - update_adc_thresholds(win_base, pir_instance.win_size); - - // Enqueue the PIR sample - pir_sample.timestamp_ms = adc_sample.timestamp_ms; - pir_sample.motion_status = (lockout_counter > 0 || motion); - pir_sample.adc_upper_threshold = pos_thresh; - pir_sample.adc_lower_threshold = neg_thresh; - enqueue_sample(&app_queue, pir_sample); - } // while (data_valid) - - if (lockout_counter > 0) { - lockout_counter -= - (num_of_samples < lockout_counter) ? num_of_samples : lockout_counter; - if (lockout_counter == 0) { - // Motion off - pir_instance.motion_detection_callback(false); - } - } - - // Motion On - if (motion) { - lockout_counter = pir_instance.motion_on_time * 32; // 32Hz - pir_instance.motion_detection_callback(true); - } - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * ADC interrupt handler - ******************************************************************************/ -void IADC_IRQHandler(void) -{ - pir_sample_t adc_sample; - static int32_t last_timestamp = -1; - static uint8_t irq_count = 0; - - IADC_clearInt(ADC_PERIPHERAL, IADC_IF_SINGLEDONE); - NVIC_ClearPendingIRQ(IADC_IRQn); - - // IADC_Result_t sample = IADC_pullSingleFifoResult(ADC_PERIPHERAL); - IADC_Result_t sample = IADC_readSingleResult(ADC_PERIPHERAL); - if ((++irq_count % (ADC_SAMPLING_FREQ / SAMPLING_FREQ)) == 0) { - // Enqueue the ADC sample - if ((last_timestamp < 0) && pir_instance.use_timestamp) { - last_timestamp = ~LETIMER_CounterGet(LETIMER0); - } - - // adjust this with over-sampling for OSR < 64. Need to left shift to get to - // 16b. - adc_sample.adc_sample = sample.data << 3; - adc_sample.timestamp_ms = last_timestamp; - enqueue_sample(&adc_queue, adc_sample); - - pir_instance.adc_irq_callback(); - irq_count = 0; - } -} - -/**************************************************************************//** - * @brief LETIMER IRQ Handler - *****************************************************************************/ -void LETIMER0_IRQHandler(void) -{ - uint32_t flags = LETIMER_IntGet(LETIMER0); - - // Trigger an IADC scan conversion -// IADC_command(ADC_PERIPHERAL, iadcCmdStartSingle); - - // Clear LETIMER interrupt flags - LETIMER_IntClear(LETIMER0, flags); -} - -/***************************************************************************//** - * @brief - * Reads out a sample from the PIR sample queue. - * - * @param[out] pir_sample - * Pointer to the PIR sample - ******************************************************************************/ -sl_status_t pir_read_queue(pir_sample_t *pir_sample) -{ - if (app_queue.sample == NULL) { - return SL_STATUS_FAIL; - } - dequeue_sample(&app_queue, pir_sample); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Gets number of samples in the queue. - * - * @return - * The number of samples in the queue. - ******************************************************************************/ -sl_status_t pir_get_queue_size(uint16_t *size) -{ - if ((app_queue.sample == NULL) || (app_queue.used == 0)) { - *size = 0; - return SL_STATUS_FAIL; - } else { - *size = app_queue.used; - } - - return SL_STATUS_OK; -} diff --git a/driver/public/silabs/proximity_vcnl4040/config/sparkfun_vcnl4040_config.h b/driver/public/silabs/proximity_vcnl4040/config/sparkfun_vcnl4040_config.h index 82950d3b..b28d3939 100644 --- a/driver/public/silabs/proximity_vcnl4040/config/sparkfun_vcnl4040_config.h +++ b/driver/public/silabs/proximity_vcnl4040/config/sparkfun_vcnl4040_config.h @@ -41,17 +41,29 @@ extern "C" { #endif -// <<< sl:start pin_tool >>> +// <<< Use Configuration Wizard in Context Menu >>> -// SPARKFUN_VCNL4040_INT -// $[GPIO_SPARKFUN_VCNL4040_INT] -#define SPARKFUN_VCNL4040_INT_PORT gpioPortB -#define SPARKFUN_VCNL4040_INT_PIN 0 -// [GPIO_SPARKFUN_VCNL4040_INT]$ +//SPARKFUN VCNL4040 I2C Configuration + +// SPARKFUN VCNL4040 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_VCNL4040_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_VCNL4040_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> -// <<< sl:end pin_tool >>> #ifdef __cplusplus } #endif -#endif /* SL_VCNL4040_CONFIG_H_ */ +#endif // SL_VCNL4040_CONFIG_H_ diff --git a/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040.h b/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040.h index a848f14e..a64e5681 100644 --- a/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040.h +++ b/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040.h @@ -326,7 +326,7 @@ typedef void (*sparkfun_vcnl4040_norm_interrupt_callback_t)( * @retval SL_STATUS_OK Success * @retval SL_STATUS_INITIALIZATION Initialization Failure ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t sparkfun_vcnl4040_init(mikroe_i2c_handle_t i2cspm_instance); /***************************************************************************//** * @brief @@ -1105,4 +1105,4 @@ sl_status_t sparkfun_vcnl4040_get_core_version( } #endif -#endif /* SPARKFUN_VCNL4040_H_ */ +#endif // SPARKFUN_VCNL4040_H_ diff --git a/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040_platform.h b/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040_platform.h index 18830dc5..6713fc27 100644 --- a/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040_platform.h +++ b/driver/public/silabs/proximity_vcnl4040/inc/sparkfun_vcnl4040_platform.h @@ -44,7 +44,7 @@ #include #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #define LOWER true #define UPPER false @@ -80,8 +80,7 @@ extern "C" { * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_read_command(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_read_command(i2c_master_t *i2cspm, uint8_t command, uint16_t *data); @@ -99,8 +98,7 @@ sl_status_t sparkfun_vcnl4040_i2c_read_command(sl_i2cspm_t *i2cspm, * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_write_command(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_write_command(i2c_master_t *i2cspm, uint8_t command, uint16_t data); @@ -118,8 +116,7 @@ sl_status_t sparkfun_vcnl4040_i2c_write_command(sl_i2cspm_t *i2cspm, * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_read_command_lower(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_read_command_lower(i2c_master_t *i2cspm, uint8_t command, uint8_t *data); @@ -137,8 +134,7 @@ sl_status_t sparkfun_vcnl4040_i2c_read_command_lower(sl_i2cspm_t *i2cspm, * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_read_command_upper(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_read_command_upper(i2c_master_t *i2cspm, uint8_t command, uint8_t *data); @@ -156,8 +152,7 @@ sl_status_t sparkfun_vcnl4040_i2c_read_command_upper(sl_i2cspm_t *i2cspm, * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_write_command_lower(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_write_command_lower(i2c_master_t *i2cspm, uint8_t command, uint8_t data); @@ -175,8 +170,7 @@ sl_status_t sparkfun_vcnl4040_i2c_write_command_lower(sl_i2cspm_t *i2cspm, * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_write_command_upper(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_write_command_upper(i2c_master_t *i2cspm, uint8_t command, uint8_t data); @@ -200,8 +194,7 @@ sl_status_t sparkfun_vcnl4040_i2c_write_command_upper(sl_i2cspm_t *i2cspm, * SL_STATUS_OK if there are no errors. * SL_STATUS_TRANSMIT if I2C transmit failed. ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_masked_write_command(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_masked_write_command(i2c_master_t *i2cspm, uint8_t command, bool command_height, uint8_t mask, @@ -213,4 +206,4 @@ sl_status_t sparkfun_vcnl4040_i2c_masked_write_command(sl_i2cspm_t *i2cspm, } #endif -#endif /* SPARKFUN_VCNL4040_PLATFORM_H_ */ +#endif // SPARKFUN_VCNL4040_PLATFORM_H_ diff --git a/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040.c b/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040.c index 134b6eea..cd31a72d 100644 --- a/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040.c +++ b/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040.c @@ -46,12 +46,18 @@ // Local Variables // ----------------------------------------------------------------------------- +typedef struct +{ + i2c_master_t i2c; + uint8_t slave_address; +} sparkfun_proximity_t; + static sparkfun_vcnl4040_core_version_t core_version = { .major = 0, .minor = 1, .build = 0, .revision = 100, -}; /* Structure to hold the software version of the core driver */ +}; // Structure to hold the software version of the core driver static SPARKFUN_VCNL4040_Sensor_Config_TypeDef vcnl4040_cfg = { .PSDuty = 0x0, @@ -76,12 +82,11 @@ static SPARKFUN_VCNL4040_Sensor_Config_TypeDef vcnl4040_cfg = { .ALSIntEnabled = false, .WhiteEnabled = false -}; /* Structure to hold VCNL4040 driver config */ +}; // Structure to hold VCNL4040 driver config -static sl_i2cspm_t *vcnl4040_i2cspm_instance = NULL; -static bool vcnl4040_is_initialized = false; -static sparkfun_vcnl4040_norm_interrupt_callback_t vcnl4040_interrupt_callback = - NULL; +static sparkfun_proximity_t sparkfun_proximity; +static sparkfun_vcnl4040_norm_interrupt_callback_t + vcnl4040_interrupt_callback = NULL; // ----------------------------------------------------------------------------- // Public Function // ----------------------------------------------------------------------------- @@ -89,20 +94,35 @@ static sparkfun_vcnl4040_norm_interrupt_callback_t vcnl4040_interrupt_callback = /**************************************************************************//** * Initialize the VCNL4040 sensor. *****************************************************************************/ -sl_status_t sparkfun_vcnl4040_init(sl_i2cspm_t *i2cspm_instance) +sl_status_t sparkfun_vcnl4040_init(mikroe_i2c_handle_t i2cspm_instance) { + i2c_master_config_t i2c_cfg; sl_status_t sc = SL_STATUS_OK; uint16_t id; if (i2cspm_instance == NULL) { return SL_STATUS_NULL_POINTER; } - if (vcnl4040_is_initialized == true) { - return SL_STATUS_ALREADY_INITIALIZED; + + sparkfun_proximity.i2c.handle = i2cspm_instance; + + i2c_master_configure_default(&i2c_cfg); + i2c_cfg.addr = SPARKFUN_VCNL4040_I2C_BUS_ADDRESS; + + sparkfun_proximity.slave_address = i2c_cfg.addr; + +#if (SPARKFUN_VCNL4040_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_VCNL4040_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&sparkfun_proximity.i2c, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; } - vcnl4040_i2cspm_instance = i2cspm_instance; - vcnl4040_is_initialized = true; + i2c_master_set_slave_address(&sparkfun_proximity.i2c, + sparkfun_proximity.slave_address); + i2c_master_set_speed(&sparkfun_proximity.i2c, i2c_cfg.speed); + i2c_master_set_timeout(&sparkfun_proximity.i2c, 0); if (sparkfun_vcnl4040_get_id(&id) != SL_STATUS_OK) { return SL_STATUS_FAIL; @@ -124,7 +144,6 @@ sl_status_t sparkfun_vcnl4040_init(sl_i2cspm_t *i2cspm_instance) if (sc != SL_STATUS_OK) { return SL_STATUS_FAIL; } else { - vcnl4040_is_initialized = true; return SL_STATUS_OK; } } @@ -134,8 +153,7 @@ sl_status_t sparkfun_vcnl4040_init(sl_i2cspm_t *i2cspm_instance) *****************************************************************************/ sl_status_t sparkfun_vcnl4040_deinit(void) { - vcnl4040_i2cspm_instance = NULL; - vcnl4040_is_initialized = false; + sparkfun_proximity.i2c.handle = NULL; return SL_STATUS_OK; } @@ -149,8 +167,7 @@ sl_status_t sparkfun_vcnl4040_get_id(uint16_t *id) return SL_STATUS_NULL_POINTER; } return sparkfun_vcnl4040_i2c_read_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ID, id); } @@ -181,8 +198,7 @@ sl_status_t sparkfun_vcnl4040_set_ir_duty_cycle(uint8_t duty_value) vcnl4040_cfg.PSDuty = duty_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF1, LOWER, (uint8_t)SPARKFUN_VCNL4040_PS_DUTY_MASK, @@ -240,8 +256,7 @@ sl_status_t sparkfun_vcnl4040_set_ir_led_sink_current(uint8_t current_value) vcnl4040_cfg.IRLEDCurrent = current_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_MS, UPPER, SPARKFUN_VCNL4040_LED_I_MASK, @@ -288,8 +303,7 @@ sl_status_t sparkfun_vcnl4040_set_proximity_interrupt_persistence( vcnl4040_cfg.PSPersistence = pers_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF1, LOWER, SPARKFUN_VCNL4040_PS_PERS_MASK, @@ -348,8 +362,7 @@ sl_status_t sparkfun_vcnl4040_set_proximity_integration_time(uint8_t time_value) vcnl4040_cfg.PSIntegrationTime = time_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_CONF, LOWER, SPARKFUN_VCNL4040_PS_IT_MASK, @@ -385,8 +398,7 @@ sl_status_t sparkfun_vcnl4040_power_on_proximity(bool enable) vcnl4040_cfg.PSEnabled = enable; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF1, LOWER, SPARKFUN_VCNL4040_PS_SD_MASK, @@ -421,8 +433,7 @@ sl_status_t sparkfun_vcnl4040_set_proximity_resolution(uint8_t resolution_value) vcnl4040_cfg.PSResolution = resolution_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF2, UPPER, SPARKFUN_VCNL4040_PS_HD_MASK, @@ -469,8 +480,7 @@ sl_status_t sparkfun_vcnl4040_set_proximity_int_type(uint8_t interrupt_value) vcnl4040_cfg.PSInterruptType = interrupt_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF2, UPPER, SPARKFUN_VCNL4040_PS_INT_MASK, @@ -505,8 +515,7 @@ sl_status_t sparkfun_vcnl4040_enable_smart_persistence(bool enable) vcnl4040_cfg.PSSmartPersEnabled = enable; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF3, LOWER, SPARKFUN_VCNL4040_PS_SMART_PERS_MASK, @@ -540,8 +549,7 @@ sl_status_t sparkfun_vcnl4040_enable_active_force_mode(bool enable) vcnl4040_cfg.PSActiveForceEnabled = enable; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF3, LOWER, SPARKFUN_VCNL4040_PS_AF_MASK, @@ -567,8 +575,7 @@ sl_status_t sparkfun_vcnl4040_get_active_force_mode_enabled(bool *enabled) sl_status_t sparkfun_vcnl4040_trigger_proximity_measurement(void) { return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CONF3, LOWER, SPARKFUN_VCNL4040_PS_TRIG_MASK, @@ -589,8 +596,7 @@ sl_status_t sparkfun_vcnl4040_enable_proximity_logic_mode(bool enable) vcnl4040_cfg.PSLogicEnabled = enable; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_MS, UPPER, SPARKFUN_VCNL4040_PS_MS_MASK, @@ -618,8 +624,7 @@ sl_status_t sparkfun_vcnl4040_set_proximity_cancelation(uint16_t cancel_value) vcnl4040_cfg.PSCancelThresh = cancel_value; return sparkfun_vcnl4040_i2c_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_CANC, cancel_value); } @@ -646,8 +651,7 @@ sl_status_t sparkfun_vcnl4040_set_proximity_low_threshold( vcnl4040_cfg.PSLowThreshold = threshold_value; return sparkfun_vcnl4040_i2c_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_THDL, threshold_value); } @@ -675,8 +679,7 @@ sl_status_t sparkfun_vcnl4040_set_proximity_high_threshold( vcnl4040_cfg.PSHighThreshold = threshold_value; return sparkfun_vcnl4040_i2c_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_THDH, threshold_value); } @@ -704,8 +707,7 @@ sl_status_t sparkfun_vcnl4040_get_proximity(uint16_t *proximity_data) return SL_STATUS_NULL_POINTER; } return sparkfun_vcnl4040_i2c_read_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_DATA, proximity_data); } @@ -722,8 +724,7 @@ sl_status_t sparkfun_vcnl4040_is_close(bool *is_close) return SL_STATUS_NULL_POINTER; } ret = sparkfun_vcnl4040_i2c_read_command_upper( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_INT_FLAG, &data); *is_close = (bool)(data & SPARKFUN_VCNL4040_INT_FLAG_CLOSE); @@ -743,8 +744,7 @@ sl_status_t sparkfun_vcnl4040_is_away(bool *is_away) return SL_STATUS_NULL_POINTER; } ret = sparkfun_vcnl4040_i2c_read_command_upper( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_INT_FLAG, &data); *is_away = (bool)(data & SPARKFUN_VCNL4040_INT_FLAG_AWAY); @@ -779,8 +779,7 @@ sl_status_t sparkfun_vcnl4040_set_ambient_interrupt_persistence( vcnl4040_cfg.ALSPersistence = pers_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_CONF, LOWER, SPARKFUN_VCNL4040_ALS_PERS_MASK, @@ -816,8 +815,7 @@ sl_status_t sparkfun_vcnl4040_enable_ambient_interrupts(bool enable) vcnl4040_cfg.ALSIntEnabled = enable; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_CONF, LOWER, SPARKFUN_VCNL4040_ALS_INT_EN_MASK, @@ -852,8 +850,7 @@ sl_status_t sparkfun_vcnl4040_power_on_ambient(bool enable) vcnl4040_cfg.ALSEnabled = enable; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_CONF, LOWER, SPARKFUN_VCNL4040_ALS_SD_MASK, @@ -899,8 +896,7 @@ sl_status_t sparkfun_vcnl4040_set_ambient_integration_time(uint8_t time_value) vcnl4040_cfg.ALSIntegrationTime = time_value; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_CONF, LOWER, (uint8_t)SPARKFUN_VCNL4040_ALS_IT_MASK, @@ -929,8 +925,7 @@ sl_status_t sparkfun_vcnl4040_set_ambient_low_threshold( vcnl4040_cfg.ALSLowThreshold = threshold_value; return sparkfun_vcnl4040_i2c_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_THDL, threshold_value); } @@ -958,8 +953,7 @@ sl_status_t sparkfun_vcnl4040_set_ambient_high_threshold( vcnl4040_cfg.ALSHighThreshold = threshold_value; return sparkfun_vcnl4040_i2c_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_THDH, threshold_value); } @@ -987,8 +981,7 @@ sl_status_t sparkfun_vcnl4040_get_ambient(uint16_t *ambient_data) return SL_STATUS_NULL_POINTER; } return sparkfun_vcnl4040_i2c_read_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_ALS_DATA, ambient_data); } @@ -1008,8 +1001,7 @@ sl_status_t sparkfun_vcnl4040_enable_white_channel(bool enable) vcnl4040_cfg.WhiteEnabled = enable; return sparkfun_vcnl4040_i2c_masked_write_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_PS_MS, UPPER, (uint8_t)SPARKFUN_VCNL4040_WHITE_EN_MASK, @@ -1038,8 +1030,7 @@ sl_status_t sparkfun_vcnl4040_get_white(uint16_t *white_data) return SL_STATUS_NULL_POINTER; } return sparkfun_vcnl4040_i2c_read_command( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_WHITE_DATA, white_data); } @@ -1056,8 +1047,7 @@ sl_status_t sparkfun_vcnl4040_is_light(bool *is_light) return SL_STATUS_NULL_POINTER; } ret = sparkfun_vcnl4040_i2c_read_command_upper( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_INT_FLAG, &data); *is_light = data & SPARKFUN_VCNL4040_INT_FLAG_ALS_HIGH; @@ -1077,8 +1067,7 @@ sl_status_t sparkfun_vcnl4040_is_dark(bool *is_dark) return SL_STATUS_NULL_POINTER; } ret = sparkfun_vcnl4040_i2c_read_command_upper( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_INT_FLAG, &data); *is_dark = data & SPARKFUN_VCNL4040_INT_FLAG_ALS_LOW; @@ -1113,8 +1102,7 @@ sl_status_t sparkfun_vcnl4040_is_interrupt(bool *is_light, uint8_t data; ret = sparkfun_vcnl4040_i2c_read_command_upper( - vcnl4040_i2cspm_instance, - SPARKFUN_VCNL4040_I2C_BUS_ADDRESS, + &sparkfun_proximity.i2c, SPARKFUN_VCNL4040_INT_FLAG, &data); if (data & SPARKFUN_VCNL4040_INT_AWAY_MASK) { diff --git a/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040_platform.c b/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040_platform.c index e7c7643a..602cb438 100644 --- a/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040_platform.c +++ b/driver/public/silabs/proximity_vcnl4040/src/sparkfun_vcnl4040_platform.c @@ -39,6 +39,7 @@ #include #include "sl_status.h" #include "sparkfun_vcnl4040_platform.h" +#include "drv_i2c_master.h" // ----------------------------------------------------------------------------- // Public functions @@ -47,78 +48,52 @@ /***************************************************************************//** * Read two consecutive bytes from a given 'command code' location ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_read_command(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_read_command(i2c_master_t *i2cspm, uint8_t command, uint16_t *data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; uint8_t pdata[2]; - if ((i2cspm == NULL) || (data == NULL)) { - return SL_STATUS_NULL_POINTER; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(i2cspm, &command, 1, + pdata, 2)) { + return SL_STATUS_TRANSMIT; } - seq.addr = (uint16_t)(address << 1); - seq.flags = I2C_FLAG_WRITE_READ; - - seq.buf[0].data = &command; - seq.buf[0].len = 1; - - seq.buf[1].data = pdata; - seq.buf[1].len = 2; - - ret = I2CSPM_Transfer(i2cspm, &seq); *data = (uint16_t)(pdata[1] << 8) + pdata[0]; - return ret; + return SL_STATUS_OK; } /***************************************************************************//** * Write two consecutive bytes to a given 'command code' location ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_write_command(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_write_command(i2c_master_t *i2cspm, uint8_t command, uint16_t data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; uint8_t send_data[3]; - if (i2cspm == NULL) { - return SL_STATUS_NULL_POINTER; - } send_data[0] = command; send_data[1] = (uint8_t)(data & 0xFF); send_data[2] = (uint8_t)(data >> 8); - seq.addr = (uint16_t)(address << 1); - seq.flags = I2C_FLAG_WRITE; - - seq.buf[0].data = send_data; - seq.buf[0].len = 3; - - ret = I2CSPM_Transfer(i2cspm, &seq); + if (I2C_MASTER_SUCCESS != i2c_master_write(i2cspm, send_data, 3)) { + return SL_STATUS_TRANSMIT; + } - return ret; + return SL_STATUS_OK; } /***************************************************************************//** * Read lower byte from a given 'command code' location ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_read_command_lower(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_read_command_lower(i2c_master_t *i2cspm, uint8_t command, uint8_t *data) { - uint16_t pdata; sl_status_t ret; + uint16_t pdata = 0; - if ((i2cspm == NULL) || (data == NULL)) { - return SL_STATUS_NULL_POINTER; - } - ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, address, command, &pdata); + ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, command, &pdata); *data = (uint8_t)(pdata & 0xFF); return ret; @@ -127,18 +102,14 @@ sl_status_t sparkfun_vcnl4040_i2c_read_command_lower(sl_i2cspm_t *i2cspm, /***************************************************************************//** * Read upper byte from a given 'command code' location ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_read_command_upper(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_read_command_upper(i2c_master_t *i2cspm, uint8_t command, uint8_t *data) { - uint16_t pdata; + uint16_t pdata = 0; sl_status_t ret; - if ((i2cspm == NULL) || (data == NULL)) { - return SL_STATUS_NULL_POINTER; - } - ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, address, command, &pdata); + ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, command, &pdata); *data = (uint8_t)(pdata >> 8); return ret; @@ -147,21 +118,14 @@ sl_status_t sparkfun_vcnl4040_i2c_read_command_upper(sl_i2cspm_t *i2cspm, /***************************************************************************//** * Write lower byte to a given 'command code' location ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_write_command_lower(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_write_command_lower(i2c_master_t *i2cspm, uint8_t command, uint8_t data) { uint16_t command_value; sl_status_t ret; - if (i2cspm == NULL) { - return SL_STATUS_NULL_POINTER; - } - ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, - address, - command, - &command_value); + ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, command, &command_value); if (ret != SL_STATUS_OK) { return ret; @@ -170,7 +134,6 @@ sl_status_t sparkfun_vcnl4040_i2c_write_command_lower(sl_i2cspm_t *i2cspm, command_value |= (uint16_t)(data); return sparkfun_vcnl4040_i2c_write_command(i2cspm, - address, command, command_value); } @@ -178,8 +141,7 @@ sl_status_t sparkfun_vcnl4040_i2c_write_command_lower(sl_i2cspm_t *i2cspm, /***************************************************************************//** * Write upper byte to a given 'command code' location ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_write_command_upper(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_write_command_upper(i2c_master_t *i2cspm, uint8_t command, uint8_t data) { @@ -189,10 +151,7 @@ sl_status_t sparkfun_vcnl4040_i2c_write_command_upper(sl_i2cspm_t *i2cspm, if (i2cspm == NULL) { return SL_STATUS_NULL_POINTER; } - ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, - address, - command, - &command_value); + ret = sparkfun_vcnl4040_i2c_read_command(i2cspm, command, &command_value); if (ret != SL_STATUS_OK) { return ret; @@ -200,17 +159,13 @@ sl_status_t sparkfun_vcnl4040_i2c_write_command_upper(sl_i2cspm_t *i2cspm, command_value &= 0x00FF; command_value |= (uint16_t)data << 8; - return sparkfun_vcnl4040_i2c_write_command(i2cspm, - address, - command, - command_value); + return sparkfun_vcnl4040_i2c_write_command(i2cspm, command, command_value); } /***************************************************************************//** * Masked write of upper/lower byte at a given 'command code' location ******************************************************************************/ -sl_status_t sparkfun_vcnl4040_i2c_masked_write_command(sl_i2cspm_t *i2cspm, - uint8_t address, +sl_status_t sparkfun_vcnl4040_i2c_masked_write_command(i2c_master_t *i2cspm, uint8_t command, bool command_height, uint8_t mask, @@ -223,29 +178,23 @@ sl_status_t sparkfun_vcnl4040_i2c_masked_write_command(sl_i2cspm_t *i2cspm, return SL_STATUS_NULL_POINTER; } if (command_height == LOWER) { - if (sparkfun_vcnl4040_i2c_read_command_lower(i2cspm, address, command, + if (sparkfun_vcnl4040_i2c_read_command_lower(i2cspm, command, ®_value) != SL_STATUS_OK) { return SL_STATUS_FAIL; } reg_value &= mask; reg_value |= data; - ret = sparkfun_vcnl4040_i2c_write_command_lower(i2cspm, - address, - command, - data); + ret = sparkfun_vcnl4040_i2c_write_command_lower(i2cspm, command, data); return ret; } else { - if (sparkfun_vcnl4040_i2c_read_command_upper(i2cspm, address, command, + if (sparkfun_vcnl4040_i2c_read_command_upper(i2cspm, command, ®_value) != SL_STATUS_OK) { return SL_STATUS_FAIL; } reg_value &= mask; reg_value |= data; - ret = sparkfun_vcnl4040_i2c_write_command_upper(i2cspm, - address, - command, - data); + ret = sparkfun_vcnl4040_i2c_write_command_upper(i2cspm, command, data); return ret; } diff --git a/driver/public/silabs/qwiic_joystick/config/sparkfun_qwiic_joystick_config.h b/driver/public/silabs/qwiic_joystick/config/sparkfun_qwiic_joystick_config.h new file mode 100644 index 00000000..68e9d60f --- /dev/null +++ b/driver/public/silabs/qwiic_joystick/config/sparkfun_qwiic_joystick_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file sparkfun_sgp40_config.h + * @brief sparkfun sgp40 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SPARKFUN_QWIIC_JOYSTICK_CONFIG_H +#define SPARKFUN_QWIIC_JOYSTICK_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//SPARKFUN QWIIC JOYSTICK I2C Configuration + +// SPARKFUN QWIIC JOYSTICK I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_QWIIC_JOYSTICK_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_QWIIC_JOYSTICK_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // SPARKFUN_QWIIC_JOYSTICK_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/qwiic_joystick/inc/sparkfun_qwiic_joystick.h b/driver/public/silabs/qwiic_joystick/inc/sparkfun_qwiic_joystick.h index 27c137a7..908f9ccf 100644 --- a/driver/public/silabs/qwiic_joystick/inc/sparkfun_qwiic_joystick.h +++ b/driver/public/silabs/qwiic_joystick/inc/sparkfun_qwiic_joystick.h @@ -37,7 +37,8 @@ #include "sl_status.h" #include "stdbool.h" -#include "sl_i2cspm.h" + +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -137,7 +138,8 @@ typedef struct frw_rev { * @retval SL_STATUS_OK An joystick device is present on the I2C bus * @retval SL_STATUS_INITIALIZATION No Joystick device present ******************************************************************************/ -sl_status_t sparkfun_joystick_init(sl_i2cspm_t *i2c_handle, uint8_t address); +sl_status_t sparkfun_joystick_init(mikroe_i2c_handle_t i2c_handle, + uint8_t address); /***************************************************************************//** * @brief @@ -308,4 +310,4 @@ sl_status_t sparkfun_joystick_write_register(uint8_t reg_addr, uint8_t data); /** @} (end addtogroup sparkfun_joystick) */ -#endif /* SPARKFUN_QWIIC_JOYSTICK_H__ */ +#endif // SPARKFUN_QWIIC_JOYSTICK_H__ diff --git a/driver/public/silabs/qwiic_joystick/src/sparkfun_qwiic_joystick.c b/driver/public/silabs/qwiic_joystick/src/sparkfun_qwiic_joystick.c index db4d776e..b3607d03 100644 --- a/driver/public/silabs/qwiic_joystick/src/sparkfun_qwiic_joystick.c +++ b/driver/public/silabs/qwiic_joystick/src/sparkfun_qwiic_joystick.c @@ -33,16 +33,21 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ #include "sl_sleeptimer.h" - #include "sparkfun_qwiic_joystick.h" +#include "sparkfun_qwiic_joystick_config.h" + +typedef struct +{ + i2c_master_t i2c; +} joystick_handle_t; -static sl_i2cspm_t *joystick_i2cspm_instance = NULL; -static uint8_t joystick_i2c_addr = SPARKFUN_JOYSTICK_DEFAULT_ADDR; +static joystick_handle_t joystick_handle; /***************************************************************************//** * Initialize the Joystick. ******************************************************************************/ -sl_status_t sparkfun_joystick_init(sl_i2cspm_t *i2c_handle, uint8_t address) +sl_status_t sparkfun_joystick_init(mikroe_i2c_handle_t i2c_handle, + uint8_t address) { if (i2c_handle == NULL) { return SL_STATUS_NULL_POINTER; @@ -52,18 +57,33 @@ sl_status_t sparkfun_joystick_init(sl_i2cspm_t *i2c_handle, uint8_t address) return SL_STATUS_INVALID_PARAMETER; } - joystick_i2cspm_instance = i2c_handle; + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = address; + + joystick_handle.i2c.handle = i2c_handle; + +#if (SPARKFUN_QWIIC_JOYSTICK_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_QWIIC_JOYSTICK_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&joystick_handle.i2c, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&joystick_handle.i2c, i2c_cfg.speed); + i2c_master_set_timeout(&joystick_handle.i2c, 0); if (!sparkfun_joystick_present(address)) { // Wait for joystick to become ready sl_sleeptimer_delay_millisecond(80); if (!sparkfun_joystick_present(address)) { - return SL_STATUS_INITIALIZATION; + return SL_STATUS_NOT_AVAILABLE; } } - joystick_i2c_addr = address; return SL_STATUS_OK; } @@ -76,12 +96,12 @@ bool sparkfun_joystick_present(uint8_t device_id) uint8_t backup_addr; // Back up the current i2c addr - backup_addr = joystick_i2c_addr; + backup_addr = joystick_handle.i2c.config.addr; // Use special addr to check - joystick_i2c_addr = device_id; + i2c_master_set_slave_address(&joystick_handle.i2c, device_id); sc = sparkfun_joystick_read_data(SPARKFUN_JOYSTICK_ID, &device_id); // Restore to the backed up i2c addr - joystick_i2c_addr = backup_addr; + i2c_master_set_slave_address(&joystick_handle.i2c, backup_addr); if (sc != SL_STATUS_OK) { return false; } @@ -100,8 +120,9 @@ sl_status_t sparkfun_joystick_set_address(uint8_t address) return SL_STATUS_INVALID_PARAMETER; } - // SPARKFUN_JOYSTICK_LOCK_REGISTER must be changed to 0x13 - // before I2C address can be changed + /* SPARKFUN_JOYSTICK_LOCK_REGISTER must be changed to 0x13 + * before I2C address can be changed + */ sc = sparkfun_joystick_write_register(SPARKFUN_JOYSTICK_LOCK_REGISTER, 0x13); if (sc != SL_STATUS_OK) { return sc; @@ -112,8 +133,8 @@ sl_status_t sparkfun_joystick_set_address(uint8_t address) if (sc != SL_STATUS_OK) { return sc; } + i2c_master_set_slave_address(&joystick_handle.i2c, address); - joystick_i2c_addr = address; return SL_STATUS_OK; } @@ -122,7 +143,7 @@ sl_status_t sparkfun_joystick_set_address(uint8_t address) ******************************************************************************/ uint8_t sparkfun_joystick_get_address(void) { - return joystick_i2c_addr; + return joystick_handle.i2c.config.addr; } /***************************************************************************//** @@ -155,7 +176,7 @@ sl_status_t sparkfun_joystick_select_device(uint8_t address) return SL_STATUS_INVALID_PARAMETER; } - joystick_i2c_addr = address; + i2c_master_set_slave_address(&joystick_handle.i2c, address); return SL_STATUS_OK; } @@ -303,27 +324,13 @@ sl_status_t sparkfun_joystick_check_button(uint8_t *data) ******************************************************************************/ sl_status_t sparkfun_joystick_read_data(uint8_t reg_addr, uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - - uint8_t i2c_write_data[1]; - - seq.addr = joystick_i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE_READ; - - i2c_write_data[0] = reg_addr; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - - seq.buf[1].data = data; - seq.buf[1].len = 1; - - result = I2CSPM_Transfer(joystick_i2cspm_instance, &seq); - - if (result != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&joystick_handle.i2c, + ®_addr, + 1, + data, + 1)) { return SL_STATUS_TRANSMIT; } - return SL_STATUS_OK; } @@ -332,25 +339,11 @@ sl_status_t sparkfun_joystick_read_data(uint8_t reg_addr, uint8_t *data) ******************************************************************************/ sl_status_t sparkfun_joystick_write_register(uint8_t reg_addr, uint8_t data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - uint8_t i2c_write_data[2]; - uint8_t i2c_read_data[1]; - - seq.addr = joystick_i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE; - - i2c_write_data[0] = reg_addr; - i2c_write_data[1] = data; - - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 2; - - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; + uint8_t i2c_write_data[2] = { reg_addr, data }; - result = I2CSPM_Transfer(joystick_i2cspm_instance, &seq); - if (result != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&joystick_handle.i2c, + i2c_write_data, + 2)) { return SL_STATUS_TRANSMIT; } diff --git a/driver/public/silabs/qwiic_keypad/config/brd2601b/sparkfun_keypad_config.h b/driver/public/silabs/qwiic_keypad/config/brd2601b/sparkfun_keypad_config.h index 01ad3010..bb8e0b48 100644 --- a/driver/public/silabs/qwiic_keypad/config/brd2601b/sparkfun_keypad_config.h +++ b/driver/public/silabs/qwiic_keypad/config/brd2601b/sparkfun_keypad_config.h @@ -1,24 +1,61 @@ /***************************************************************************//** - * @file - * @brief Sparkfun Qwiic Keypad Driver Configuration + * @file sparkfun_keypad_config.h + * @brief Configuration file for qwiic_keypad ******************************************************************************* * # License - * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - #ifndef SPARKFUN_KEYPAD_CONFIG_H #define SPARKFUN_KEYPAD_CONFIG_H // <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN KEYPAD I2C Configuration + +// SPARKFUN KEYPAD I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_SPEED_MODE 0 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +68,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_KEYPAD_CONFIG_H*/ \ No newline at end of file +#endif // SPARKFUN_KEYPAD_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/qwiic_keypad/config/brd2703a/sparkfun_keypad_config.h b/driver/public/silabs/qwiic_keypad/config/brd2703a/sparkfun_keypad_config.h index 08436a90..bbfa9001 100644 --- a/driver/public/silabs/qwiic_keypad/config/brd2703a/sparkfun_keypad_config.h +++ b/driver/public/silabs/qwiic_keypad/config/brd2703a/sparkfun_keypad_config.h @@ -1,24 +1,61 @@ /***************************************************************************//** - * @file - * @brief Sparkfun Qwiic Keypad Driver Configuration + * @file sparkfun_keypad_config.h + * @brief Configuration file for qwiic_keypad ******************************************************************************* * # License - * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - #ifndef SPARKFUN_KEYPAD_CONFIG_H #define SPARKFUN_KEYPAD_CONFIG_H // <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN KEYPAD I2C Configuration + +// SPARKFUN KEYPAD I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_SPEED_MODE 0 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +68,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_KEYPAD_CONFIG_H/ \ No newline at end of file +#endif // SPARKFUN_KEYPAD_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/qwiic_keypad/config/brd2704a/sparkfun_keypad_config.h b/driver/public/silabs/qwiic_keypad/config/brd2704a/sparkfun_keypad_config.h index 781e7022..bb8e0b48 100644 --- a/driver/public/silabs/qwiic_keypad/config/brd2704a/sparkfun_keypad_config.h +++ b/driver/public/silabs/qwiic_keypad/config/brd2704a/sparkfun_keypad_config.h @@ -1,24 +1,61 @@ /***************************************************************************//** - * @file - * @brief Sparkfun Qwiic Keypad Driver Configuration + * @file sparkfun_keypad_config.h + * @brief Configuration file for qwiic_keypad ******************************************************************************* * # License - * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib * - ******************************************************************************// - + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ #ifndef SPARKFUN_KEYPAD_CONFIG_H #define SPARKFUN_KEYPAD_CONFIG_H // <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN KEYPAD I2C Configuration + +// SPARKFUN KEYPAD I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_SPEED_MODE 0 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +68,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_KEYPAD_CONFIG_H*/ \ No newline at end of file +#endif // SPARKFUN_KEYPAD_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/qwiic_keypad/config/brd4108a/sparkfun_keypad_config.h b/driver/public/silabs/qwiic_keypad/config/brd4108a/sparkfun_keypad_config.h index 5ec01317..eef5e358 100644 --- a/driver/public/silabs/qwiic_keypad/config/brd4108a/sparkfun_keypad_config.h +++ b/driver/public/silabs/qwiic_keypad/config/brd4108a/sparkfun_keypad_config.h @@ -1,24 +1,61 @@ /***************************************************************************//** - * @file - * @brief Sparkfun Qwiic Keypad Driver Configuration + * @file sparkfun_keypad_config.h + * @brief Configuration file for qwiic_keypad ******************************************************************************* * # License - * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - #ifndef SPARKFUN_KEYPAD_CONFIG_H #define SPARKFUN_KEYPAD_CONFIG_H // <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN KEYPAD I2C Configuration + +// SPARKFUN KEYPAD I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_SPEED_MODE 0 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -31,4 +68,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_KEYPAD_CONFIG_H/ \ No newline at end of file +#endif // SPARKFUN_KEYPAD_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/qwiic_keypad/config/brd4314a/sparkfun_keypad_config.h b/driver/public/silabs/qwiic_keypad/config/brd4314a/sparkfun_keypad_config.h index 5ec01317..56e94f69 100644 --- a/driver/public/silabs/qwiic_keypad/config/brd4314a/sparkfun_keypad_config.h +++ b/driver/public/silabs/qwiic_keypad/config/brd4314a/sparkfun_keypad_config.h @@ -1,34 +1,75 @@ /***************************************************************************//** - * @file - * @brief Sparkfun Qwiic Keypad Driver Configuration + * @file sparkfun_keypad_config.h + * @brief Configuration file for qwiic_keypad ******************************************************************************* * # License - * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - #ifndef SPARKFUN_KEYPAD_CONFIG_H #define SPARKFUN_KEYPAD_CONFIG_H // <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN KEYPAD I2C Configuration + +// SPARKFUN KEYPAD I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_SPEED_MODE 0 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> // SPARKFUN_KEYPAD_GPIO_INT // $[GPIO_SPARKFUN_KEYPAD_GPIO_INT] -#define SPARKFUN_KEYPAD_GPIO_INT_PORT gpioPortB -#define SPARKFUN_KEYPAD_GPIO_INT_PIN 3 +#ifndef SPARKFUN_KEYPAD_GPIO_INT_PORT +#define SPARKFUN_KEYPAD_GPIO_INT_PORT gpioPortB +#endif +#ifndef SPARKFUN_KEYPAD_GPIO_INT_PIN +#define SPARKFUN_KEYPAD_GPIO_INT_PIN 3 +#endif // [GPIO_SPARKFUN_KEYPAD_GPIO_INT]$ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_KEYPAD_CONFIG_H/ \ No newline at end of file +#endif // SPARKFUN_KEYPAD_CONFIG_H diff --git a/driver/public/silabs/qwiic_keypad/config/brd4338a/sparkfun_keypad_config.h b/driver/public/silabs/qwiic_keypad/config/brd4338a/sparkfun_keypad_config.h new file mode 100644 index 00000000..eacc8baf --- /dev/null +++ b/driver/public/silabs/qwiic_keypad/config/brd4338a/sparkfun_keypad_config.h @@ -0,0 +1,71 @@ +/***************************************************************************//** + * @file sparkfun_keypad_config.h + * @brief Configuration file for qwiic_keypad + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef SPARKFUN_KEYPAD_CONFIG_H +#define SPARKFUN_KEYPAD_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN KEYPAD I2C Configuration + +// SPARKFUN KEYPAD I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// SPARKFUN_KEYPAD_GPIO_INT +// $[GPIO_SPARKFUN_KEYPAD_GPIO_INT] +#define SPARKFUN_KEYPAD_GPIO_INT_PORT HP +#define SPARKFUN_KEYPAD_GPIO_INT_PIN 46 +// [GPIO_SPARKFUN_KEYPAD_GPIO_INT]$ + +// <<< sl:end pin_tool >>> + +#endif // SPARKFUN_KEYPAD_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/qwiic_keypad/config/other/sparkfun_keypad_config.h b/driver/public/silabs/qwiic_keypad/config/other/sparkfun_keypad_config.h index 74c68d54..0080e610 100644 --- a/driver/public/silabs/qwiic_keypad/config/other/sparkfun_keypad_config.h +++ b/driver/public/silabs/qwiic_keypad/config/other/sparkfun_keypad_config.h @@ -1,24 +1,61 @@ /***************************************************************************//** - * @file - * @brief Sparkfun Qwiic Keypad Driver Configuration + * @file sparkfun_keypad_config.h + * @brief Configuration file for qwiic_keypad ******************************************************************************* * # License - * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com ******************************************************************************* * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. * ******************************************************************************/ - #ifndef SPARKFUN_KEYPAD_CONFIG_H #define SPARKFUN_KEYPAD_CONFIG_H // <<< Use Configuration Wizard in Context Menu >>> +//SPARKFUN KEYPAD I2C Configuration + +// SPARKFUN KEYPAD I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_KEYPAD_I2C_SPEED_MODE 0 + +// +// // <<< end of configuration section >>> // <<< sl:start pin_tool >>> @@ -32,4 +69,4 @@ // <<< sl:end pin_tool >>> -#endif /*SPARKFUN_KEYPAD_CONFIG_H/ \ No newline at end of file +#endif // SPARKFUN_KEYPAD_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/qwiic_keypad/inc/sparkfun_qwiic_keypad.h b/driver/public/silabs/qwiic_keypad/inc/sparkfun_qwiic_keypad.h index 80a26941..8eb2bf2d 100644 --- a/driver/public/silabs/qwiic_keypad/inc/sparkfun_qwiic_keypad.h +++ b/driver/public/silabs/qwiic_keypad/inc/sparkfun_qwiic_keypad.h @@ -36,13 +36,16 @@ #ifndef SPARKFUN_QWIIC_KEYPAD_H_ #define SPARKFUN_QWIIC_KEYPAD_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include -#include "stdbool.h" -#include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" +#include "drv_digital_in.h" #include "sl_sleeptimer.h" -// #define SAPRKFUN_KEYPAD_INT_PIN_EN +typedef void (*buttonEvent_callback)(const uint8_t); enum sparkfun_keypad_registers { SPARKFUN_KEYPAD_ID = 0x00, // Reg: 0x00 - Default I2C Address @@ -78,11 +81,16 @@ typedef struct frw_rev { * @param[in] address * The I2C address to probe. * + * @param[in] address + * The I2C address to probe. + * * @return * @retval SL_STATUS_OK An keypad device is present on the I2C bus * @retval SL_STATUS_INITIALIZATION No keypad device present ******************************************************************************/ -sl_status_t sparkfun_keypad_init(sl_i2cspm_t *i2c_handle, uint8_t address); +sl_status_t sparkfun_keypad_init(mikroe_i2c_handle_t i2c_handle, + uint8_t address, + buttonEvent_callback user_callback); /***************************************************************************//** * @brief @@ -233,4 +241,4 @@ sl_status_t sparkfun_keypad_write_register(uint8_t reg_addr, uint8_t data); } #endif -#endif /* SPARKFUN_QWIIC_KEYPAD_H_ */ +#endif // SPARKFUN_QWIIC_KEYPAD_H_ diff --git a/driver/public/silabs/qwiic_keypad/src/sparkfun_qwiic_keypad.c b/driver/public/silabs/qwiic_keypad/src/sparkfun_qwiic_keypad.c index bbf10720..9743333b 100644 --- a/driver/public/silabs/qwiic_keypad/src/sparkfun_qwiic_keypad.c +++ b/driver/public/silabs/qwiic_keypad/src/sparkfun_qwiic_keypad.c @@ -33,33 +33,32 @@ * at the sole discretion of Silicon Labs. ******************************************************************************/ #include "sparkfun_qwiic_keypad.h" +#include "sparkfun_keypad_config.h" -static sl_i2cspm_t *keypad_i2cspm_instance = NULL; -static uint8_t keypad_i2c_addr = SPARKFUN_KEYPAD_DEFAULT_ADDR; +#if (defined(SLI_SI917)) +#include "sl_driver_gpio.h" +#define GPIO_M4_INTR 7 // M4 Pin interrupt number +#define AVL_INTR_NO 0 // available interrupt number +#else +#include "gpiointerrupt.h" +#endif + +typedef struct +{ + i2c_master_t i2c; + buttonEvent_callback user_callback; + digital_in_t interrupt_pin; +}qwiic_keypad_t; + +static qwiic_keypad_t qwiic_keypad; /***************************************************************************//** * Initialize the keypad. ******************************************************************************/ -sl_status_t sparkfun_keypad_init(sl_i2cspm_t *i2c_handle, uint8_t address) +sl_status_t sparkfun_keypad_init(mikroe_i2c_handle_t i2c_handle, + uint8_t address, + buttonEvent_callback user_callback) { -#ifdef SAPRKFUN_KEYPAD_INT_PIN_EN - - GPIO_PinModeSet(SPARKFUN_KEYPAD_GPIO_INT_PORT, - SPARKFUN_KEYPAD_GPIO_INT_PIN, - gpioModeInput, - 0); - GPIO_ExtIntConfig(SPARKFUN_KEYPAD_GPIO_INT_PORT, - SPARKFUN_KEYPAD_GPIO_INT_PIN, - SPARKFUN_KEYPAD_GPIO_INT_PIN, - true, - false, - true); - GPIOINT_CallbackRegister(SPARKFUN_KEYPAD_GPIO_INT_PIN, - app_sparkfun_buttonEvent_callback); - GPIO_IntEnable(SPARKFUN_KEYPAD_GPIO_INT_PIN); - -#endif /* SAPRKFUN_KEYPAD_INT_PIN_EN */ - if (i2c_handle == NULL) { return SL_STATUS_NULL_POINTER; } @@ -68,18 +67,62 @@ sl_status_t sparkfun_keypad_init(sl_i2cspm_t *i2c_handle, uint8_t address) return SL_STATUS_INVALID_PARAMETER; } - keypad_i2cspm_instance = i2c_handle; + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = address; + + qwiic_keypad.i2c.handle = i2c_handle; + +#if (SPARKFUN_KEYPAD_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_KEYPAD_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&qwiic_keypad.i2c, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&qwiic_keypad.i2c, i2c_cfg.speed); + i2c_master_set_timeout(&qwiic_keypad.i2c, 0); + + if (NULL != user_callback) { + qwiic_keypad.user_callback = user_callback; + +#ifdef SPARKFUN_KEYPAD_GPIO_INT_PIN + pin_name_t int_pin_1 = hal_gpio_pin_name(SPARKFUN_KEYPAD_GPIO_INT_PORT, + SPARKFUN_KEYPAD_GPIO_INT_PIN); + digital_in_init(&qwiic_keypad.interrupt_pin, int_pin_1); + +#if (defined(SLI_SI917)) + sl_gpio_t gpio_port_pin = { SPARKFUN_KEYPAD_GPIO_INT_PIN / 16, + SPARKFUN_KEYPAD_GPIO_INT_PIN % 16 }; + sl_gpio_driver_configure_interrupt(&gpio_port_pin, + GPIO_M4_INTR, + SL_GPIO_INTERRUPT_FALLING_EDGE, + (void *)qwiic_keypad.user_callback, + AVL_INTR_NO); +#else // None Si91x device + GPIOINT_CallbackRegister(SPARKFUN_KEYPAD_GPIO_INT_PIN, + qwiic_keypad.user_callback); + GPIO_ExtIntConfig(SPARKFUN_KEYPAD_GPIO_INT_PORT, + SPARKFUN_KEYPAD_GPIO_INT_PIN, + SPARKFUN_KEYPAD_GPIO_INT_PIN, + false, + true, + true); +#endif +#endif + } if (!sparkfun_keypad_present(address)) { // Wait for keypad to become ready sl_sleeptimer_delay_millisecond(80); if (!sparkfun_keypad_present(address)) { - return SL_STATUS_INITIALIZATION; + return SL_STATUS_NOT_AVAILABLE; } } - keypad_i2c_addr = address; return SL_STATUS_OK; } @@ -92,12 +135,14 @@ bool sparkfun_keypad_present(uint8_t device_id) uint8_t backup_addr; // Back up the current i2c addr - backup_addr = keypad_i2c_addr; + backup_addr = qwiic_keypad.i2c.config.addr; + // Use special addr to check - keypad_i2c_addr = device_id; + i2c_master_set_slave_address(&qwiic_keypad.i2c, device_id); sc = sparkfun_keypad_read_data(SPARKFUN_KEYPAD_ID, &device_id); + // Restore to the backed up i2c addr - keypad_i2c_addr = backup_addr; + i2c_master_set_slave_address(&qwiic_keypad.i2c, backup_addr); if (sc != SL_STATUS_OK) { return false; } @@ -122,7 +167,7 @@ sl_status_t sparkfun_keypad_set_address(uint8_t address) return sc; } - keypad_i2c_addr = address; + i2c_master_set_slave_address(&qwiic_keypad.i2c, address); return SL_STATUS_OK; } @@ -131,7 +176,7 @@ sl_status_t sparkfun_keypad_set_address(uint8_t address) ******************************************************************************/ uint8_t sparkfun_keypad_get_address(void) { - return keypad_i2c_addr; + return qwiic_keypad.i2c.config.addr; } /***************************************************************************//** @@ -164,7 +209,7 @@ sl_status_t sparkfun_keypad_select_device(uint8_t address) return SL_STATUS_INVALID_PARAMETER; } - keypad_i2c_addr = address; + i2c_master_set_slave_address(&qwiic_keypad.i2c, address); return SL_STATUS_OK; } @@ -177,7 +222,7 @@ sl_status_t sparkfun_keypad_get_firmware_version(frw_rev_t *fwRev) uint8_t major; uint8_t minor; - if (fwRev == NULL) { + if ((fwRev == NULL) || (NULL == qwiic_keypad.i2c.handle)) { return SL_STATUS_NULL_POINTER; } @@ -204,7 +249,7 @@ sl_status_t sparkfun_keypad_read_last_button(uint8_t *data) { sl_status_t sc; - if (data == NULL) { + if ((data == NULL) || (NULL == qwiic_keypad.i2c.handle)) { return SL_STATUS_NULL_POINTER; } @@ -268,27 +313,13 @@ sl_status_t sparkfun_keypad_update_fifo() ******************************************************************************/ sl_status_t sparkfun_keypad_read_data(uint8_t reg_addr, uint8_t *data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - - uint8_t i2c_write_data[1]; - - seq.addr = keypad_i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE_READ; - - i2c_write_data[0] = reg_addr; - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 1; - - seq.buf[1].data = data; - seq.buf[1].len = 1; - - result = I2CSPM_Transfer(keypad_i2cspm_instance, &seq); - - if (result != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&qwiic_keypad.i2c, + ®_addr, + 1, + data, + 1)) { return SL_STATUS_TRANSMIT; } - return SL_STATUS_OK; } @@ -297,25 +328,11 @@ sl_status_t sparkfun_keypad_read_data(uint8_t reg_addr, uint8_t *data) ******************************************************************************/ sl_status_t sparkfun_keypad_write_register(uint8_t reg_addr, uint8_t data) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef result; - uint8_t i2c_write_data[2]; - uint8_t i2c_read_data[1]; - - seq.addr = keypad_i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE; - - i2c_write_data[0] = reg_addr; - i2c_write_data[1] = data; - - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 2; - - seq.buf[1].data = i2c_read_data; - seq.buf[1].len = 0; + uint8_t i2c_write_data[2] = { reg_addr, data }; - result = I2CSPM_Transfer(keypad_i2cspm_instance, &seq); - if (result != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&qwiic_keypad.i2c, + i2c_write_data, + 2)) { return SL_STATUS_TRANSMIT; } diff --git a/driver/public/silabs/rfid_id12la/config/brd2601b/sl_i2cspm_rfid_config.h b/driver/public/silabs/rfid_id12la/config/brd2601b/sl_i2cspm_rfid_config.h deleted file mode 100644 index 312e468e..00000000 --- a/driver/public/silabs/rfid_id12la/config/brd2601b/sl_i2cspm_rfid_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_RFID_CONFIG_H -#define SL_I2CSPM_RFID_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_RFID_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_RFID_SPEED_MODE 1 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_RFID -// $[I2C_SL_I2CSPM_RFID] -#define SL_I2CSPM_RFID_PERIPHERAL I2C1 -#define SL_I2CSPM_RFID_PERIPHERAL_NO 1 - -// I2C0 SCL on PC06 -#define SL_I2CSPM_RFID_SCL_PORT gpioPortC -#define SL_I2CSPM_RFID_SCL_PIN 4 - -// I2C0 SDA on PC05 -#define SL_I2CSPM_RFID_SDA_PORT gpioPortC -#define SL_I2CSPM_RFID_SDA_PIN 5 -// [I2C_SL_I2CSPM_RFID]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_RFID_CONFIG_H diff --git a/driver/public/silabs/rfid_id12la/config/brd2703a/sl_i2cspm_rfid_config.h b/driver/public/silabs/rfid_id12la/config/brd2703a/sl_i2cspm_rfid_config.h deleted file mode 100644 index 3a594416..00000000 --- a/driver/public/silabs/rfid_id12la/config/brd2703a/sl_i2cspm_rfid_config.h +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_RFID_CONFIG_H -#define SL_I2CSPM_RFID_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_RFID_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_RFID_SPEED_MODE 1 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_RFID -// $[I2C_SL_I2CSPM_RFID] -#define SL_I2CSPM_RFID_PERIPHERAL I2C1 -#define SL_I2CSPM_RFID_PERIPHERAL_NO 1 - -// I2C1 SCL on PC04 -#define SL_I2CSPM_RFID_SCL_PORT gpioPortC -#define SL_I2CSPM_RFID_SCL_PIN 4 - -// I2C1 SDA on PC05 -#define SL_I2CSPM_RFID_SDA_PORT gpioPortC -#define SL_I2CSPM_RFID_SDA_PIN 5 - -// [I2C_SL_I2CSPM_RFID]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_RFID_CONFIG_H diff --git a/driver/public/silabs/rfid_id12la/config/brd2704a/sl_i2cspm_rfid_config.h b/driver/public/silabs/rfid_id12la/config/brd2704a/sl_i2cspm_rfid_config.h deleted file mode 100644 index c7b4bc3a..00000000 --- a/driver/public/silabs/rfid_id12la/config/brd2704a/sl_i2cspm_rfid_config.h +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_RFID_CONFIG_H -#define SL_I2CSPM_RFID_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_RFID_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_RFID_SPEED_MODE 1 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_RFID -// $[I2C_SL_I2CSPM_RFID] -#define SL_I2CSPM_RFID_PERIPHERAL I2C0 -#define SL_I2CSPM_RFID_PERIPHERAL_NO 0 - -// I2C0 SCL on PB03 -#define SL_I2CSPM_RFID_SCL_PORT gpioPortB -#define SL_I2CSPM_RFID_SCL_PIN 3 - -// I2C0 SDA on PB04 -#define SL_I2CSPM_RFID_SDA_PORT gpioPortB -#define SL_I2CSPM_RFID_SDA_PIN 4 - -// [I2C_SL_I2CSPM_RFID]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_RFID_CONFIG_H diff --git a/driver/public/silabs/rfid_id12la/config/brd4108a/sl_i2cspm_rfid_config.h b/driver/public/silabs/rfid_id12la/config/brd4108a/sl_i2cspm_rfid_config.h deleted file mode 100644 index 1d39c300..00000000 --- a/driver/public/silabs/rfid_id12la/config/brd4108a/sl_i2cspm_rfid_config.h +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_RFID_CONFIG_H -#define SL_I2CSPM_RFID_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_RFID_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_RFID_SPEED_MODE 1 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_RFID -// $[I2C_SL_I2CSPM_RFID] -#define SL_I2CSPM_RFID_PERIPHERAL I2C1 -#define SL_I2CSPM_RFID_PERIPHERAL_NO 1 - -// I2C1 SCL on PD02 -#define SL_I2CSPM_RFID_SCL_PORT gpioPortD -#define SL_I2CSPM_RFID_SCL_PIN 2 - -// I2C1 SDA on PD03 -#define SL_I2CSPM_RFID_SDA_PORT gpioPortD -#define SL_I2CSPM_RFID_SDA_PIN 3 - -// [I2C_SL_I2CSPM_RFID]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_RFID_CONFIG_H diff --git a/driver/public/silabs/rfid_id12la/config/brd4314a/sl_i2cspm_rfid_config.h b/driver/public/silabs/rfid_id12la/config/brd4314a/sl_i2cspm_rfid_config.h deleted file mode 100644 index 1d39c300..00000000 --- a/driver/public/silabs/rfid_id12la/config/brd4314a/sl_i2cspm_rfid_config.h +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************//** - * @file - * @brief I2CSPM Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * The licensor of this software is Silicon Laboratories Inc. Your use of this - * software is governed by the terms of Silicon Labs Master Software License - * Agreement (MSLA) available at - * www.silabs.com/about-us/legal/master-software-license-agreement. This - * software is distributed to you in Source Code format and is governed by the - * sections of the MSLA applicable to Source Code. - * - ******************************************************************************/ - -#ifndef SL_I2CSPM_RFID_CONFIG_H -#define SL_I2CSPM_RFID_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu - -// I2CSPM settings - -// Reference clock frequency -// Frequency in Hz of the reference clock. -// Select 0 to use the frequency of the currently selected clock. -// Default: 0 -#define SL_I2CSPM_RFID_REFERENCE_CLOCK 0 - -// Speed mode -// <0=> Standard mode (100kbit/s) -// <1=> Fast mode (400kbit/s) -// <2=> Fast mode plus (1Mbit/s) -// Default: 0 -#define SL_I2CSPM_RFID_SPEED_MODE 1 -// end I2CSPM config - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_I2CSPM_RFID -// $[I2C_SL_I2CSPM_RFID] -#define SL_I2CSPM_RFID_PERIPHERAL I2C1 -#define SL_I2CSPM_RFID_PERIPHERAL_NO 1 - -// I2C1 SCL on PD02 -#define SL_I2CSPM_RFID_SCL_PORT gpioPortD -#define SL_I2CSPM_RFID_SCL_PIN 2 - -// I2C1 SDA on PD03 -#define SL_I2CSPM_RFID_SDA_PORT gpioPortD -#define SL_I2CSPM_RFID_SDA_PIN 3 - -// [I2C_SL_I2CSPM_RFID]$ -// <<< sl:end pin_tool >>> - -#endif // SL_I2CSPM_RFID_CONFIG_H diff --git a/driver/public/silabs/rfid_id12la/config/sparkfun_rfid_id12la_config.h b/driver/public/silabs/rfid_id12la/config/sparkfun_rfid_id12la_config.h new file mode 100644 index 00000000..e9235c44 --- /dev/null +++ b/driver/public/silabs/rfid_id12la/config/sparkfun_rfid_id12la_config.h @@ -0,0 +1,60 @@ +/***************************************************************************//** + * @file sparkfun_rfid_id12la_config.h + * @brief RFID Configuration + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software.s + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SPARKFUN_RFID_ID12LA_CONFIG_H_ +#define SPARKFUN_RFID_ID12LA_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// Address settings + +// I2C Address <0x1..0x7E:0x1> +// Default: 0x7D +#define SPARKFUN_RFID_ID12LA_ADDR 0x7D + +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif + +#endif // SPARKFUN_RFID_ID12LA_CONFIG_H_ diff --git a/driver/public/silabs/rfid_id12la/inc/sparkfun_rfid_id12la.h b/driver/public/silabs/rfid_id12la/inc/sparkfun_rfid_id12la.h index 5667c709..508f41f7 100644 --- a/driver/public/silabs/rfid_id12la/inc/sparkfun_rfid_id12la.h +++ b/driver/public/silabs/rfid_id12la/inc/sparkfun_rfid_id12la.h @@ -40,10 +40,8 @@ /******************************************************************************* * Includes ******************************************************************************/ -#include -#include "stddef.h" #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" /***************************************************************************//** * @addtogroup id12la - RFID @@ -109,13 +107,13 @@ typedef struct { * @brief * Initialize the id12la * - * @param[in] i2cspm + * @param[in] i2c * The I2C peripheral to use. * * @return * sl_status_t error code ******************************************************************************/ -sl_status_t sparkfun_id12la_init(sl_i2cspm_t *i2cspm); +sl_status_t sparkfun_id12la_init(mikroe_i2c_handle_t i2c); /***************************************************************************//** * @brief @@ -170,4 +168,4 @@ uint8_t sparkfun_id12la_get_i2c_address(void); #ifdef __cplusplus } #endif -#endif /* RFID_ID12LA_H_ */ +#endif // RFID_ID12LA_H_ diff --git a/driver/public/silabs/rfid_id12la/src/sparkfun_rfid_id12la.c b/driver/public/silabs/rfid_id12la/src/sparkfun_rfid_id12la.c index 8b2e982a..a3163161 100644 --- a/driver/public/silabs/rfid_id12la/src/sparkfun_rfid_id12la.c +++ b/driver/public/silabs/rfid_id12la/src/sparkfun_rfid_id12la.c @@ -38,14 +38,14 @@ * Includes ******************************************************************************/ #include "sparkfun_rfid_id12la.h" +#include "sparkfun_rfid_id12la_config.h" #include "sl_sleeptimer.h" /******************************************************************************* * Variables ******************************************************************************/ -static sl_i2cspm_t *id12la_i2cpsm_instance; static bool id12la_is_initialized = false; -static uint8_t id12la_address_i2c = 0x7D; +static i2c_master_t rfid_id12la_i2c; /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */ // Local prototypes @@ -59,11 +59,12 @@ static sl_status_t get_tag(uint8_t *i2c_rx_buffer); /***************************************************************************//** * Initialize the id12la ******************************************************************************/ -sl_status_t sparkfun_id12la_init(sl_i2cspm_t *i2cspm) +sl_status_t sparkfun_id12la_init(mikroe_i2c_handle_t i2c) { - sl_status_t ret; + i2c_master_config_t rfid_id12la_cfg; + uint8_t data; - if (i2cspm == NULL) { + if (i2c == NULL) { return SL_STATUS_NULL_POINTER; } @@ -73,11 +74,24 @@ sl_status_t sparkfun_id12la_init(sl_i2cspm_t *i2cspm) } // Update i2cspm instance - id12la_i2cpsm_instance = i2cspm; + rfid_id12la_i2c.handle = i2c; + rfid_id12la_cfg.addr = SPARKFUN_RFID_ID12LA_ADDR; + rfid_id12la_cfg.speed = I2C_MASTER_SPEED_FULL; // ID12LA only run at 400KHz - ret = i2c_write_blocking(NULL, 0); - if (ret != SL_STATUS_OK) { - return ret; + if (i2c_master_open(&rfid_id12la_i2c, &rfid_id12la_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&rfid_id12la_i2c, rfid_id12la_cfg.speed); + i2c_master_set_timeout(&rfid_id12la_i2c, 0); + // Wait for module to become ready + sl_sleeptimer_delay_millisecond(100); + + /* Try to read a byte from device to check device is + * present on the I2C bus or not + */ + if (i2c_read_blocking(&data, 1) != SL_STATUS_OK) { + return SL_STATUS_NOT_AVAILABLE; } id12la_is_initialized = true; @@ -95,10 +109,6 @@ sl_status_t sparkfun_id12la_get_all_tag(id12la_tag_list_t *tag_list, uint8_t i; uint8_t tag_infor[10] = { 0 }; - if (!id12la_i2cpsm_instance) { - return SL_STATUS_INVALID_PARAMETER; - } - if (tag_list == NULL) { return SL_STATUS_INVALID_PARAMETER; } @@ -145,10 +155,6 @@ sl_status_t sparkfun_id12la_change_address_i2c(uint8_t new_address) { sl_status_t ret; - if (!id12la_i2cpsm_instance) { - return SL_STATUS_INVALID_PARAMETER; - } - // Range of legal addresses if ((new_address < 0x07) || (new_address > 0x78)) { return SL_STATUS_FAIL; @@ -163,7 +169,7 @@ sl_status_t sparkfun_id12la_change_address_i2c(uint8_t new_address) ret = i2c_write_blocking(data_to_send, 2); if (ret == SL_STATUS_OK) { - id12la_address_i2c = new_address; + i2c_master_set_slave_address(&rfid_id12la_i2c, new_address); } return ret; } @@ -173,12 +179,11 @@ sl_status_t sparkfun_id12la_change_address_i2c(uint8_t new_address) ******************************************************************************/ sl_status_t sparkfun_id12la_scan_address() { - if (!id12la_i2cpsm_instance) { - return SL_STATUS_INVALID_PARAMETER; - } + uint8_t data; + for (uint8_t address = 1; address < 127; address++) { - id12la_address_i2c = address; - if (i2c_write_blocking(NULL, 0) == SL_STATUS_OK) { + i2c_master_set_slave_address(&rfid_id12la_i2c, address); + if (i2c_read_blocking(&data, 1) == SL_STATUS_OK) { return SL_STATUS_OK; } } @@ -190,7 +195,7 @@ sl_status_t sparkfun_id12la_scan_address() ******************************************************************************/ uint8_t sparkfun_id12la_get_i2c_address(void) { - return id12la_address_i2c; + return rfid_id12la_i2c.config.addr; } /***************************************************************************//** @@ -226,38 +231,24 @@ static bool compare_checksum(uint8_t *ptag) } } -/*Block write to RFID*/ +// Block write to RFID static sl_status_t i2c_write_blocking(uint8_t *src, uint32_t len) { - I2C_TransferSeq_TypeDef seq; - - seq.addr = id12la_address_i2c << 1; - seq.flags = I2C_FLAG_WRITE; - - /*Write buffer*/ - seq.buf[0].data = src; - seq.buf[0].len = len; - - if (I2CSPM_Transfer(id12la_i2cpsm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_write(&rfid_id12la_i2c, + src, + len)) { return SL_STATUS_TRANSMIT; } return SL_STATUS_OK; } -/* Block read from RFID */ +// Block read from RFID static sl_status_t i2c_read_blocking(uint8_t *dest, uint32_t len) { - I2C_TransferSeq_TypeDef seq; - - seq.addr = id12la_address_i2c << 1; - seq.flags = I2C_FLAG_READ; - - /*Read buffer*/ - seq.buf[0].data = dest; - seq.buf[0].len = len; - - if (I2CSPM_Transfer(id12la_i2cpsm_instance, &seq) != i2cTransferDone) { + if (I2C_MASTER_SUCCESS != i2c_master_read(&rfid_id12la_i2c, + dest, + len)) { return SL_STATUS_TRANSMIT; } diff --git a/driver/public/silabs/rgb_led_is31fl3741/config/adafruit_is31fl3741_config.h b/driver/public/silabs/rgb_led_is31fl3741/config/adafruit_is31fl3741_config.h index cd5e160a..11704236 100644 --- a/driver/public/silabs/rgb_led_is31fl3741/config/adafruit_is31fl3741_config.h +++ b/driver/public/silabs/rgb_led_is31fl3741/config/adafruit_is31fl3741_config.h @@ -45,6 +45,24 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> +//ADAFRUIT IS31FL3741 I2C Configuration + +// ADAFRUIT IS31FL3741 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define ADAFRUIT_IS31FL3741_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define ADAFRUIT_IS31FL3741_I2C_SPEED_MODE 0 + +// +// + // Display Configuration // Display Layout // <0=> 1x1 diff --git a/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741.h b/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741.h index bc9e4fa6..e49a6817 100644 --- a/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741.h +++ b/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741.h @@ -57,7 +57,7 @@ * SL_STATUS_OK if there are no errors. * SL_STATUS_ALREADY_INITIALIZED if the module is already initialized. ******************************************************************************/ -sl_status_t adafruit_is31fl3741_init(sl_i2cspm_t *i2cspm); +sl_status_t adafruit_is31fl3741_init(mikroe_i2c_handle_t i2cspm); /***************************************************************************//** * @brief diff --git a/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741_i2c.h b/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741_i2c.h index 76539f6a..53402b6b 100644 --- a/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741_i2c.h +++ b/driver/public/silabs/rgb_led_is31fl3741/inc/adafruit_is31fl3741_i2c.h @@ -42,7 +42,7 @@ #include #include "sl_status.h" -#include "sl_i2cspm.h" +#include "drv_i2c_master.h" #include "adafruit_is31fl3741_params.h" // ----------------------------------------------------------------------------- @@ -71,7 +71,7 @@ * I2CSPM Instance for communication. * ******************************************************************************/ -void adafruit_is31fl3741_i2c_set_instance(sl_i2cspm_t *i2cspm); +void adafruit_is31fl3741_i2c_set_instance(i2c_master_t *i2cspm); /***************************************************************************//** * @brief diff --git a/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741.c b/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741.c index 1b4ceba9..08f994e7 100644 --- a/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741.c +++ b/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741.c @@ -55,6 +55,8 @@ // Local Variables // ----------------------------------------------------------------------------- +static i2c_master_t rgb_led; + static uint8_t device_list[] = { #if DISPLAY_1_I2C_ADDRESS != 0 DISPLAY_1_I2C_ADDRESS, @@ -236,8 +238,9 @@ static sl_status_t adafruit_is31fl3741_write_data(uint8_t *offset) /**************************************************************************//** * Initialize the RGB LED IS31FL3741. *****************************************************************************/ -sl_status_t adafruit_is31fl3741_init(sl_i2cspm_t *i2cspm) +sl_status_t adafruit_is31fl3741_init(mikroe_i2c_handle_t i2cspm) { + i2c_master_config_t rgb_led_config; sl_status_t ret = SL_STATUS_OK; if (i2cspm == NULL) { @@ -247,19 +250,35 @@ sl_status_t adafruit_is31fl3741_init(sl_i2cspm_t *i2cspm) return SL_STATUS_INITIALIZATION; } - adafruit_is31fl3741_i2c_set_instance(i2cspm); + // Configure default i2csmp instance + rgb_led.handle = i2cspm; - IS3741_order order = IS3741_BGR; - red_offset = (order >> 4) & 3; - green_offset = (order >> 2) & 3; - blue_offset = order & 3; + i2c_master_configure_default(&rgb_led_config); + rgb_led_config.addr = IS31FL3741_DEFAULT_I2C_ADDR; + +#if (ADAFRUIT_IS31FL3741_I2C_UC == 1) + rgb_led_config.speed = ADAFRUIT_IS31FL3741_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&rgb_led, &rgb_led_config) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + i2c_master_set_speed(&rgb_led, rgb_led_config.speed); + i2c_master_set_timeout(&rgb_led, 0); + + adafruit_is31fl3741_i2c_set_instance(&rgb_led); ret |= adafruit_is31fl3741_reset(); ret |= adafruit_is31fl3741_set_global_current(0x05); ret |= adafruit_is31fl3741_set_global_led_scaling(0x10); initialized = true; + IS3741_order order = IS3741_BGR; + red_offset = (order >> 4) & 3; + green_offset = (order >> 2) & 3; + blue_offset = order & 3; + if (ret != SL_STATUS_OK) { return SL_STATUS_FAIL; } diff --git a/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741_i2c.c b/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741_i2c.c index ab57ff4c..c0dac594 100644 --- a/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741_i2c.c +++ b/driver/public/silabs/rgb_led_is31fl3741/src/adafruit_is31fl3741_i2c.c @@ -42,8 +42,7 @@ // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- -static sl_i2cspm_t *is31fl3741_i2cspm_instance = NULL; -static uint8_t is31fl3741_i2cspm_addr = IS31FL3741_DEFAULT_I2C_ADDR; +static i2c_master_t *is31fl3741_i2c = NULL; // ----------------------------------------------------------------------------- // Public Function @@ -52,9 +51,9 @@ static uint8_t is31fl3741_i2cspm_addr = IS31FL3741_DEFAULT_I2C_ADDR; /**************************************************************************//** * Assign the I2C instance for adafruit RGB LED. *****************************************************************************/ -void adafruit_is31fl3741_i2c_set_instance(sl_i2cspm_t *i2cspm) +void adafruit_is31fl3741_i2c_set_instance(i2c_master_t *i2cspm) { - is31fl3741_i2cspm_instance = i2cspm; + is31fl3741_i2c = i2cspm; } /**************************************************************************//** @@ -65,20 +64,18 @@ sl_status_t adafruit_is31fl3741_i2c_write_reg(uint8_t reg_addr, uint8_t len) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; + uint8_t i2c_write_data[len + 1]; - seq.addr = (uint16_t)(is31fl3741_i2cspm_addr << 1); - seq.flags = I2C_FLAG_WRITE_WRITE; + i2c_write_data[0] = reg_addr; + memcpy(i2c_write_data + 1, data, len); - seq.buf[0].data = ®_addr; - seq.buf[0].len = 1; + if (I2C_MASTER_SUCCESS != i2c_master_write(is31fl3741_i2c, + i2c_write_data, + len + 1)) { + return SL_STATUS_TRANSMIT; + } - seq.buf[1].data = data; - seq.buf[1].len = len; - - ret = I2CSPM_Transfer(is31fl3741_i2cspm_instance, &seq); - return ret; + return SL_STATUS_OK; } /**************************************************************************//** @@ -89,20 +86,15 @@ sl_status_t adafruit_is31fl3741_i2c_read_reg(uint8_t reg_addr, uint8_t len) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - - seq.addr = (uint16_t)(is31fl3741_i2cspm_addr << 1); - seq.flags = I2C_FLAG_WRITE_READ; - - seq.buf[0].data = ®_addr; - seq.buf[0].len = 1; - - seq.buf[1].data = data; - seq.buf[1].len = len; - - ret = I2CSPM_Transfer(is31fl3741_i2cspm_instance, &seq); - return ret; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(is31fl3741_i2c, + ®_addr, + 1, + data, + len)) { + return SL_STATUS_TRANSMIT; + } + + return SL_STATUS_OK; } /**************************************************************************//** @@ -110,17 +102,17 @@ sl_status_t adafruit_is31fl3741_i2c_read_reg(uint8_t reg_addr, *****************************************************************************/ sl_status_t adafruit_is31fl3741_i2c_write(uint8_t *data, uint8_t len) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; + uint8_t i2c_write_data[len]; - seq.addr = (uint16_t)(is31fl3741_i2cspm_addr << 1); - seq.flags = I2C_FLAG_WRITE; + memcpy(i2c_write_data, data, len); - seq.buf[0].data = data; - seq.buf[0].len = len; + if (I2C_MASTER_SUCCESS != i2c_master_write(is31fl3741_i2c, + i2c_write_data, + len)) { + return SL_STATUS_TRANSMIT; + } - ret = I2CSPM_Transfer(is31fl3741_i2cspm_instance, &seq); - return ret; + return SL_STATUS_OK; } /**************************************************************************//** @@ -128,5 +120,5 @@ sl_status_t adafruit_is31fl3741_i2c_write(uint8_t *data, uint8_t len) *****************************************************************************/ void adafruit_is31fl3741_i2c_select_device(uint8_t addr) { - is31fl3741_i2cspm_addr = addr; + i2c_master_set_slave_address(is31fl3741_i2c, addr); } diff --git a/driver/public/silabs/services_gpio_helper_si91x/inc/gpio_helper_si91x.h b/driver/public/silabs/services_gpio_helper_si91x/inc/gpio_helper_si91x.h new file mode 100644 index 00000000..62f70e3c --- /dev/null +++ b/driver/public/silabs/services_gpio_helper_si91x/inc/gpio_helper_si91x.h @@ -0,0 +1,140 @@ +/***************************************************************************//** + * @file mipi_dbi_spi_4wire.h + * @brief Adafruit ST7789 Color TFT SPI interface header file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef GPIO_HELPER_SI91X +#define GPIO_HELPER_SI91X + +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include "sl_si91x_peripheral_gpio.h" +#include "rsi_egpio.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define si91x_get_port(num) ((num) / 16) +#define si91x_get_pin(num) ((num) % 16) + +static inline uint8_t si91x_gpio_get_pad(uint16_t gpio_num) +{ + if ((gpio_num >= 6) && (gpio_num <= 12)) { + return gpio_num - 5; + } else if (gpio_num == 15) { + return 8; + } else if ((gpio_num == 31) + || (gpio_num == 32) + || (gpio_num == 33) + || (gpio_num == 34)) { + return 9; + } else if ((gpio_num >= 46) && (gpio_num <= 57)) { + return gpio_num - 36; + } else { + return 0; + } +} + +static inline sl_status_t si91x_gpio_setup(uint16_t gpio_num, + sl_gpio_mode_t mode, + sl_si91x_gpio_direction_t direction, + uint32_t output_value) +{ + sl_gpio_port_t port = si91x_get_port(gpio_num); + uint8_t pin = si91x_get_pin(gpio_num); + + if (!SL_GPIO_VALIDATE_PORT(port)) { + return SL_STATUS_INVALID_PARAMETER; + } + + if (port == SL_ULP_GPIO_PORT) { + if (!SL_GPIO_VALIDATE_ULP_PORT_PIN(port, pin)) { + return SL_STATUS_INVALID_PARAMETER; + } + } else { + if (!SL_GPIO_NDEBUG_PORT_PIN(port, pin)) { + return SL_STATUS_INVALID_PARAMETER; + } + } + + if (port == SL_ULP_GPIO_PORT) { + sl_si91x_gpio_enable_clock(ULPCLK_GPIO); + sl_si91x_gpio_enable_ulp_pad_receiver(pin); + } else { + sl_si91x_gpio_enable_clock(M4CLK_GPIO); + sl_si91x_gpio_enable_pad_receiver(gpio_num); + uint8_t pad = si91x_gpio_get_pad(gpio_num); + if (pad) { + sl_si91x_gpio_enable_pad_selection(pad); + } + } + + sl_gpio_set_pin_mode(port, pin, mode, output_value); + sl_si91x_gpio_set_pin_direction(port, pin, direction); + return SL_STATUS_OK; +} + +static inline sl_status_t si91x_ulp_gpio_pin_setup( + uint16_t ulp_pin, + sl_gpio_mode_t mode, + uint8_t ulp_soc_mode, + sl_si91x_gpio_direction_t direction, + uint32_t output_value) +{ + if (!SL_GPIO_VALIDATE_ULP_PIN(ulp_pin)) { + return SL_STATUS_INVALID_PARAMETER; + } + sl_si91x_gpio_enable_clock(ULPCLK_GPIO); + sl_si91x_gpio_enable_ulp_pad_receiver(ulp_pin); + + sl_gpio_set_pin_mode(SL_ULP_GPIO_PORT, + ulp_pin, + mode, + output_value); + sl_si91x_gpio_ulp_soc_mode(ulp_pin, ulp_soc_mode); + sl_si91x_gpio_set_pin_direction(SL_ULP_GPIO_PORT, + ulp_pin, + direction); + return SL_STATUS_OK; +} + +#ifdef __cplusplus +} +#endif + +#endif /* GPIO_HELPER_SI91X */ diff --git a/driver/public/silabs/services_gpio_helper_si91x/src/gpio_helper_si91x.c b/driver/public/silabs/services_gpio_helper_si91x/src/gpio_helper_si91x.c new file mode 100644 index 00000000..e69de29b diff --git a/driver/public/silabs/services_lin_bus_slave/src/sl_lin_s2.c b/driver/public/silabs/services_lin_bus_slave/src/sl_lin_s2.c index b055b33d..73adaaec 100644 --- a/driver/public/silabs/services_lin_bus_slave/src/sl_lin_s2.c +++ b/driver/public/silabs/services_lin_bus_slave/src/sl_lin_s2.c @@ -60,6 +60,7 @@ #include "sl_lin_slave_config.h" #include "sl_lin.h" +#include #include #include #include diff --git a/driver/public/silabs/services_mipi_dbi/inc/gecko/mipi_dbi_spi.h b/driver/public/silabs/services_mipi_dbi/inc/gecko/mipi_dbi_spi.h new file mode 100644 index 00000000..ad42408d --- /dev/null +++ b/driver/public/silabs/services_mipi_dbi/inc/gecko/mipi_dbi_spi.h @@ -0,0 +1,188 @@ +/***************************************************************************//** + * @file tft_4wire_interface.h + * @brief Adafruit ST7789 Color TFT SPI interface header file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIPI_DBI_4WIRE_DEVICE_H_ +#define MIPI_DBI_4WIRE_DEVICE_H_ + +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include +#include +#include "em_gpio.h" +#if defined(MIPI_DBI_SPIDRV) +#include "spidrv.h" +#endif +#include "sl_status.h" +#include "sl_component_catalog.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(MIPI_DBI_SPIDRV) +#define MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX DMADRV_MAX_XFER_COUNT +#else +#define MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX (2048) +#endif + +struct mipi_dbi_spi_gpio { + GPIO_Port_TypeDef port; + unsigned int pin; +}; + +#if defined(MIPI_DBI_SPIDRV) +struct mipi_dbi_spidrv_config { + SPIDRV_Init_t *spidrv_init; + const struct mipi_dbi_spi_gpio dc; +}; + +#endif + +struct mipi_dbi_spi_usart_config { + USART_TypeDef *usart; + uint32_t peripheral_no; + uint32_t bitrate; + bool cs_control; + uint8_t clock_mode; + const struct mipi_dbi_spi_gpio clk; + const struct mipi_dbi_spi_gpio tx; + const struct mipi_dbi_spi_gpio rx; + const struct mipi_dbi_spi_gpio cs; + const struct mipi_dbi_spi_gpio dc; +}; + +struct mipi_dbi_spi_gecko_data { +}; + +#if defined(MIPI_DBI_SPIDRV) +#define MIPI_DBI_SPIDRV_CONFIG_S2( \ + name, \ + usart_port, bitrate, frame_length, spi_type, \ + bit_order, clock_mode, cs_control, slave_start_mode, \ + clk_port, clk_pin, \ + tx_port, tx_pin, \ + rx_port, rx_pin, \ + cs_port, cs_pin) \ + static SPIDRV_Init_t name = { \ + .port = usart_port, \ + .portTx = tx_port, \ + .portRx = rx_port, \ + .portClk = clk_port, \ + .portCs = cs_port, \ + .pinTx = tx_pin, \ + .pinRx = rx_pin, \ + .pinClk = clk_pin, \ + .pinCs = cs_pin, \ + .bitRate = bitrate, \ + .frameLength = frame_length, \ + .dummyTxValue = 0, \ + .type = spi_type, \ + .bitOrder = bit_order, \ + .clockMode = clock_mode, \ + .csControl = cs_control, \ + .slaveStartMode = slave_start_mode, \ + }; + +#define MIPI_DBI_SPI_INTERFACE_DEFINE(name, \ + usart_port, \ + usart_no, \ + spi_bitrate, \ + spi_clock_mode, \ + spi_cs_control, \ + clk_port, clk_pin, \ + tx_port, tx_pin, \ + rx_port, rx_pin, \ + cs_port, cs_pin, \ + dc_port, dc_pin) \ + MIPI_DBI_SPIDRV_CONFIG_S2( \ + name ## _spidrv, \ + usart_port, spi_bitrate, 8, spidrvMaster, spidrvBitOrderMsbFirst, \ + spi_clock_mode, spi_cs_control, spidrvSlaveStartImmediate, \ + clk_port, clk_pin, \ + tx_port, tx_pin, \ + rx_port, rx_pin, \ + cs_port, cs_pin); \ + static const struct mipi_dbi_spidrv_config name = { \ + .spidrv_init = &name ## _spidrv, \ + .dc = { .port = dc_port, .pin = dc_pin }, \ + }; + +#else +SL_ENUM(SPIDRV_ClockMode_t) { + spidrvClockMode0 = 0, ///< SPI mode 0: CLKPOL=0, CLKPHA=0. + spidrvClockMode1 = 1, ///< SPI mode 1: CLKPOL=0, CLKPHA=1. + spidrvClockMode2 = 2, ///< SPI mode 2: CLKPOL=1, CLKPHA=0. + spidrvClockMode3 = 3 ///< SPI mode 3: CLKPOL=1, CLKPHA=1. +}; +/// SPI master chip select (CS) control scheme. +SL_ENUM(SPIDRV_CsControl_t) { + spidrvCsControlAuto = 0, ///< CS controlled by the SPI driver. + spidrvCsControlApplication = 1 ///< CS controlled by the application. +}; +#define MIPI_DBI_SPI_INTERFACE_DEFINE(name, \ + usart_port, \ + usart_no, \ + spi_bitrate, \ + spi_clock_mode, \ + spi_cs_control, \ + clk_port, clk_pin, \ + tx_port, tx_pin, \ + rx_port, rx_pin, \ + cs_port, cs_pin, \ + dc_port, dc_pin) \ + static const struct mipi_dbi_spi_usart_config name = { \ + .usart = usart_port, \ + .peripheral_no = usart_no, \ + .bitrate = spi_bitrate, \ + .cs_control = spi_cs_control, \ + .clock_mode = spi_clock_mode, \ + .clk = { .port = clk_port, .pin = clk_pin }, \ + .tx = { .port = tx_port, .pin = tx_pin }, \ + .rx = { .port = rx_port, .pin = rx_pin }, \ + .cs = { .port = cs_port, .pin = cs_pin }, \ + .dc = { .port = dc_port, .pin = dc_pin }, \ + } + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* MIPI_DBI_4WIRE_DEVICE_H_ */ diff --git a/driver/public/silabs/services_mipi_dbi/inc/mipi_dbi.h b/driver/public/silabs/services_mipi_dbi/inc/mipi_dbi.h new file mode 100644 index 00000000..715c36ac --- /dev/null +++ b/driver/public/silabs/services_mipi_dbi/inc/mipi_dbi.h @@ -0,0 +1,117 @@ +/***************************************************************************//** + * @file mipi_dbi_spi_4wire.h + * @brief Adafruit ST7789 Color TFT SPI interface header file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIPI_DBI_H_ +#define MIPI_DBI_H_ + +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +struct mipi_dbi_api; +struct mipi_dbi_config; +struct mipi_dbi_data; + +struct mipi_dbi_device { + const struct mipi_dbi_api *api; + const struct mipi_dbi_config *config; + struct mipi_dbi_data *data; +}; + +struct mipi_dbi_display_buffer_descriptor { + /** Data buffer size in bytes */ + uint32_t buf_size; + + /** Data buffer row width in pixels */ + uint16_t width; + + /** Data buffer column height in pixels */ + uint16_t height; + + /** Number of pixels between consecutive rows in the data buffer */ + uint16_t pitch; +}; + +/** + * @brief Display pixel formats + * + * Display pixel format enumeration. + * + * In case a pixel format consists out of multiple bytes the byte order is + * big endian. + */ +enum mipi_dbi_display_pixel_format { + PIXEL_FORMAT_RGB_888, /**< 24-bit RGB */ + PIXEL_FORMAT_MONO01, /**< Monochrome (0=Black 1=White) */ + PIXEL_FORMAT_MONO10, /**< Monochrome (1=Black 0=White) */ + PIXEL_FORMAT_ARGB_8888, /**< 32-bit ARGB */ + PIXEL_FORMAT_RGB_565, /**< 16-bit RGB */ + PIXEL_FORMAT_BGR_565, /**< 16-bit BGR */ +}; + +typedef void (*mipi_dbi_transfer_complete_callback_t)(void); + +struct mipi_dbi_api { + sl_status_t (*command_read)(const struct mipi_dbi_device *device, + uint8_t *cmds, size_t num_cmds, uint8_t *response, + size_t len); + sl_status_t (*command_write)(const struct mipi_dbi_device *device, + uint8_t cmd, + const uint8_t *data, size_t len); + sl_status_t (*write_display)( + const struct mipi_dbi_device *device, + const uint8_t *framebuf, + struct mipi_dbi_display_buffer_descriptor *desc, + enum mipi_dbi_display_pixel_format pixfmt, + mipi_dbi_transfer_complete_callback_t callback); + sl_status_t (*reset)(const struct mipi_dbi_device *device, + uint32_t delay); +}; + +sl_status_t mipi_dbi_device_init(struct mipi_dbi_device *device, + const struct mipi_dbi_config *config); + +#ifdef __cplusplus +} +#endif + +#endif /* MIPI_DBI_H_ */ diff --git a/driver/public/silabs/services_mipi_dbi/inc/si91x/mipi_dbi_spi.h b/driver/public/silabs/services_mipi_dbi/inc/si91x/mipi_dbi_spi.h new file mode 100644 index 00000000..b02de5ba --- /dev/null +++ b/driver/public/silabs/services_mipi_dbi/inc/si91x/mipi_dbi_spi.h @@ -0,0 +1,121 @@ +/***************************************************************************//** + * @file mipi_dbi_spi_4wire_device.h + * @brief Adafruit ST7789 Color TFT SPI interface header file + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIPI_DBI_SPI_DEVICE_H_ +#define MIPI_DBI_SPI_DEVICE_H_ + +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include +#include +#include "sl_si91x_peripheral_gpio.h" +#include "sl_si91x_gspi.h" +#include "sl_status.h" +#include "sl_component_catalog.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX (4096) + +struct mipi_dbi_gspi_gpio { + uint16_t num; + sl_gpio_mode_t mode; +}; + +struct mipi_dbi_gspi_config { + const sl_gspi_clock_config_t *clock_config; + const sl_gspi_control_config_t *control_config; + struct mipi_dbi_gspi_gpio clk; + struct mipi_dbi_gspi_gpio tx; + struct mipi_dbi_gspi_gpio rx; + struct mipi_dbi_gspi_gpio cs; + struct mipi_dbi_gspi_gpio dc; +}; + +#define SI91X_INTF_PLL_CLK 180000000 // Intf pll clock frequency +#define SI91X_INTF_PLL_REF_CLK 40000000 // Intf pll reference clock freq +#define SI91X_SOC_PLL_CLK 20000000 // Soc pll clock frequency +#define SI91X_SOC_PLL_REF_CLK 40000000 // Soc pll reference clock freq +#define SI91X_INTF_PLL_500_CTRL_VALUE 0xD900 // Intf pll control value +#define SI91X_SOC_PLL_MM_COUNT_LIMIT 0xA4 // Soc pll count limit +#define SI91X_DVISION_FACTOR 0 // Division factor + +#define MIPI_DBI_SPI_INTERFACE_DEFINE(name, \ + bit_rate, \ + spi_clock_mode, \ + spi_slave_select_mode, \ + clk_port, clk_pin, clk_mode, \ + tx_port, tx_pin, tx_mode, \ + rx_port, rx_pin, rx_mode, \ + cs_port, cs_pin, cs_mode, \ + dc_port, dc_pin, dc_mode) \ + static const sl_gspi_clock_config_t name ## _clock_config = { \ + .soc_pll_mm_count_value = SI91X_SOC_PLL_MM_COUNT_LIMIT, \ + .intf_pll_500_control_value = SI91X_INTF_PLL_500_CTRL_VALUE, \ + .intf_pll_clock = SI91X_INTF_PLL_CLK, \ + .intf_pll_reference_clock = SI91X_INTF_PLL_REF_CLK, \ + .soc_pll_clock = SI91X_SOC_PLL_CLK, \ + .soc_pll_reference_clock = SI91X_SOC_PLL_REF_CLK, \ + .division_factor = SI91X_DVISION_FACTOR \ + }; \ + static const sl_gspi_control_config_t name ## _control_config = { \ + .bit_width = 8, \ + .bitrate = bit_rate, \ + .clock_mode = spi_clock_mode, \ + .slave_select_mode = spi_slave_select_mode, \ + .swap_read = 1, \ + .swap_write = 0 \ + }; \ + const struct mipi_dbi_gspi_config name = { \ + .clock_config = &name ## _clock_config, \ + .control_config = &name ## _control_config, \ + .clk = { .num = clk_pin, .mode = clk_mode }, \ + .tx = { .num = tx_pin, .mode = tx_mode }, \ + .rx = { .num = rx_pin, .mode = rx_mode }, \ + .cs = { .num = cs_pin, .mode = cs_mode }, \ + .dc = { .num = dc_pin, .mode = dc_mode }, \ + } + +#ifdef __cplusplus +} +#endif + +#endif /* MIPI_DBI_SPI_DEVICE_H_ */ diff --git a/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_dma_gecko.c b/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_dma_gecko.c new file mode 100644 index 00000000..b58950f2 --- /dev/null +++ b/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_dma_gecko.c @@ -0,0 +1,261 @@ +/***************************************************************************//** + * @file mipi_dbi_spi_dma_gecko.c + * @brief TFT Display MIPI_DBI Interface Driver source file. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include "em_cmu.h" +#include "em_gpio.h" +#include "sl_status.h" +#include "sl_sleeptimer.h" +#include "sl_component_catalog.h" +#include "spidrv.h" +#include "mipi_dbi.h" +#include "mipi_dbi_spi.h" + +// ----------------------------------------------------------------------------- +// Local Variables +// ----------------------------------------------------------------------------- +const struct adafruit_st7789_spi_gecko_config *spi_config = NULL; +static volatile mipi_dbi_transfer_complete_callback_t transfer_complete_callback + = NULL; + +static sl_status_t command_read(const struct mipi_dbi_device *device, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len); +static sl_status_t command_write(const struct mipi_dbi_device *device, + uint8_t cmd, + const uint8_t *data, size_t len); +static sl_status_t write_display( + const struct mipi_dbi_device *device, + const uint8_t *framebuf, + struct mipi_dbi_display_buffer_descriptor *desc, + enum mipi_dbi_display_pixel_format pixfmt, + mipi_dbi_transfer_complete_callback_t callback); +static sl_status_t reset(const struct mipi_dbi_device *device, + uint32_t delay); +static void dma_transfer_complete_callback(struct SPIDRV_HandleData *handle, + Ecode_t transferStatus, + int itemsTransferred); + +static const struct mipi_dbi_api mipi_dbi_api = { + .command_read = command_read, + .command_write = command_write, + .write_display = write_display, + .reset = reset +}; +static struct mipi_dbi_spi_gecko_data mipi_dbi_spi_gecko_data; + +SPIDRV_HandleData_t spidrv_handle_data; +SPIDRV_Handle_t spidrv_handle = &spidrv_handle_data; + +static void spi_select(SPIDRV_Handle_t handle) +{ + if (handle->initData.csControl == spidrvCsControlApplication) { + GPIO_PinOutClear(handle->portCs, handle->pinCs); + } +} + +static void spi_deselect(SPIDRV_Handle_t handle) +{ + if (handle->initData.csControl == spidrvCsControlApplication) { + GPIO_PinOutSet(handle->portCs, handle->pinCs); + } +} + +static void set_dc_mode(const struct mipi_dbi_device *device, + bool mode) +{ + struct mipi_dbi_spidrv_config *config = + (struct mipi_dbi_spidrv_config *)device->config; + if (mode) { + GPIO_PinOutSet(config->dc.port, config->dc.pin); + } else { + GPIO_PinOutClear(config->dc.port, config->dc.pin); + } +} + +static sl_status_t spi_write_b(SPIDRV_Handle_t handle, + const void *buf, + int count) +{ + spi_select(handle); + Ecode_t retVal = SPIDRV_MTransmitB(handle, + buf, + count); + spi_deselect(handle); + return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; +} + +static sl_status_t spi_write( + SPIDRV_Handle_t handle, + const void *buf, + int count, + mipi_dbi_transfer_complete_callback_t callback) +{ + transfer_complete_callback = callback; + spi_select(handle); + Ecode_t retVal = SPIDRV_MTransmit(handle, + (uint8_t *)buf, + count, + dma_transfer_complete_callback); + return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; +} + +static sl_status_t spi_read_b( + SPIDRV_Handle_t handle, + const void *buf, + int count) +{ + spi_select(handle); + Ecode_t retVal = SPIDRV_SReceiveB(handle, + (uint8_t *)buf, + count, + 1000); + spi_deselect(handle); + return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; +} + +static sl_status_t reset(const struct mipi_dbi_device *device, + uint32_t delay) +{ + (void) device; + (void) delay; + return SL_STATUS_NOT_SUPPORTED; +} + +static sl_status_t command_read(const struct mipi_dbi_device *device, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len) +{ + sl_status_t status; + + if (num_cmds > 0) { + set_dc_mode(device, false); + status = spi_write_b(spidrv_handle, cmds, num_cmds); + if (SL_STATUS_OK != status) { + return status; + } + } + + if (len > 0) { + set_dc_mode(device, true); + status = spi_read_b(spidrv_handle, response, len); + if (SL_STATUS_OK != status) { + return status; + } + } + return SL_STATUS_OK; +} + +static sl_status_t command_write(const struct mipi_dbi_device *device, + uint8_t cmd, + const uint8_t *data, size_t len) +{ + sl_status_t status; + + set_dc_mode(device, false); + status = spi_write_b(spidrv_handle, &cmd, 1); + if (SL_STATUS_OK != status) { + return status; + } + + if (len) { + set_dc_mode(device, true); + status = spi_write_b(spidrv_handle, data, len); + } + return status; +} + +static sl_status_t write_display( + const struct mipi_dbi_device *device, + const uint8_t *framebuf, + struct mipi_dbi_display_buffer_descriptor *desc, + enum mipi_dbi_display_pixel_format pixfmt, + mipi_dbi_transfer_complete_callback_t callback) +{ + sl_status_t status; + (void)pixfmt; + + set_dc_mode(device, true); + if (callback) { + status = spi_write(spidrv_handle, framebuf, desc->buf_size, callback); + } else { + status = spi_write_b(spidrv_handle, framebuf, desc->buf_size); + } + return status; +} + +static void dma_transfer_complete_callback(struct SPIDRV_HandleData *handle, + Ecode_t transferStatus, + int itemsTransferred) +{ + (void) handle; + (void) itemsTransferred; + + spi_deselect(handle); + if (transferStatus == ECODE_OK) { + if (transfer_complete_callback) { + transfer_complete_callback(); + } + } +} + +sl_status_t mipi_dbi_device_init(struct mipi_dbi_device *device, + const struct mipi_dbi_config *config) +{ + struct mipi_dbi_spidrv_config *device_config = + (struct mipi_dbi_spidrv_config *)config; + + SPIDRV_Init(spidrv_handle, device_config->spidrv_init); + if (device_config->spidrv_init->csControl == spidrvCsControlApplication) { + GPIO_PinModeSet(device_config->spidrv_init->portCs, + device_config->spidrv_init->pinCs, + gpioModePushPull, + 0); + } + GPIO_PinModeSet(device_config->dc.port, + device_config->dc.pin, + gpioModePushPull, + 0); + + device->api = &mipi_dbi_api; + device->config = config; + device->data = (struct mipi_dbi_data *)&mipi_dbi_spi_gecko_data; + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_gecko.c b/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_gecko.c new file mode 100644 index 00000000..d99713b3 --- /dev/null +++ b/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_gecko.c @@ -0,0 +1,265 @@ +/***************************************************************************//** + * @file mipi_dbi_spi_gecko.c + * @brief TFT Display MIPI_DBI Interface Driver source file. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include "em_cmu.h" +#include "em_gpio.h" +#include "em_usart.h" +#include "sl_status.h" +#include "sl_sleeptimer.h" +#include "sl_component_catalog.h" +#include "mipi_dbi.h" +#include "mipi_dbi_spi.h" + +// ----------------------------------------------------------------------------- +// Local Variables +// ----------------------------------------------------------------------------- +const struct adafruit_st7789_spi_gecko_config *spi_config = NULL; +static volatile mipi_dbi_transfer_complete_callback_t transfer_complete_callback + = NULL; + +static sl_status_t command_read(const struct mipi_dbi_device *device, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len); +static sl_status_t command_write(const struct mipi_dbi_device *device, + uint8_t cmd, + const uint8_t *data, size_t len); +static sl_status_t write_display( + const struct mipi_dbi_device *device, + const uint8_t *framebuf, + struct mipi_dbi_display_buffer_descriptor *desc, + enum mipi_dbi_display_pixel_format pixfmt, + mipi_dbi_transfer_complete_callback_t callback); +static sl_status_t reset(const struct mipi_dbi_device *device, + uint32_t delay); + +static const struct mipi_dbi_api mipi_dbi_api = { + .command_read = command_read, + .command_write = command_write, + .write_display = write_display, + .reset = reset +}; +static struct mipi_dbi_spi_gecko_data mipi_dbi_spi_gecko_data; + +static void spi_select(const struct mipi_dbi_device *device) +{ + struct mipi_dbi_spi_usart_config *config = + (struct mipi_dbi_spi_usart_config *)device->config; + + if (config->cs_control == spidrvCsControlAuto) { + GPIO_PinOutClear(config->cs.port, config->cs.pin); + } +} + +static void spi_deselect(const struct mipi_dbi_device *device) +{ + struct mipi_dbi_spi_usart_config *config = + (struct mipi_dbi_spi_usart_config *)device->config; + if (config->cs_control == spidrvCsControlAuto) { + GPIO_PinOutSet(config->cs.port, config->cs.pin); + } +} + +static void set_dc_mode(const struct mipi_dbi_device *device, + bool mode) +{ + struct mipi_dbi_spi_usart_config *config = + (struct mipi_dbi_spi_usart_config *)device->config; + if (mode) { + GPIO_PinOutSet(config->dc.port, config->dc.pin); + } else { + GPIO_PinOutClear(config->dc.port, config->dc.pin); + } +} + +static sl_status_t spi_write_b(const struct mipi_dbi_device *device, + const uint8_t *buf, + int count) +{ + struct mipi_dbi_spi_usart_config *config = + (struct mipi_dbi_spi_usart_config *)device->config; + spi_select(device); + while (count--) { + USART_SpiTransfer(config->usart, *buf++); + } + spi_deselect(device); + return SL_STATUS_OK; +} + +static sl_status_t reset(const struct mipi_dbi_device *device, + uint32_t delay) +{ + (void) device; + (void) delay; + return SL_STATUS_NOT_SUPPORTED; +} + +static sl_status_t command_read(const struct mipi_dbi_device *device, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len) +{ + (void) device; + (void) cmds; + (void) num_cmds; + (void) response; + (void) len; + return SL_STATUS_NOT_SUPPORTED; +} + +static sl_status_t command_write(const struct mipi_dbi_device *device, + uint8_t cmd, + const uint8_t *data, size_t len) +{ + sl_status_t status; + + set_dc_mode(device, false); + status = spi_write_b(device, &cmd, 1); + if (SL_STATUS_OK != status) { + return status; + } + + if (len) { + set_dc_mode(device, true); + status = spi_write_b(device, data, len); + } + return status; +} + +static sl_status_t write_display( + const struct mipi_dbi_device *device, + const uint8_t *framebuf, + struct mipi_dbi_display_buffer_descriptor *desc, + enum mipi_dbi_display_pixel_format pixfmt, + mipi_dbi_transfer_complete_callback_t callback) +{ + (void) pixfmt; + (void) callback; + + set_dc_mode(device, true); + return spi_write_b(device, framebuf, desc->buf_size); +} + +sl_status_t mipi_dbi_device_init(struct mipi_dbi_device *device, + const struct mipi_dbi_config *config) +{ + struct mipi_dbi_spi_usart_config *device_config = + (struct mipi_dbi_spi_usart_config *)config; + USART_InitSync_TypeDef usartInit = USART_INITSYNC_DEFAULT; + + usartInit.msbf = true; + usartInit.clockMode = usartClockMode0; + usartInit.master = true; + usartInit.baudrate = device_config->bitrate; + usartInit.clockMode = device_config->clock_mode; + if (device_config->cs_control == spidrvCsControlAuto) { + usartInit.autoCsEnable = true; + } + +#if defined(_CMU_HFPERCLKEN0_MASK) + CMU_ClockEnable(cmuClock_HFPER, true); +#endif + CMU_ClockEnable(cmuClock_GPIO, true); +#if ADAFRUIT_HXD8357D_PERIPHERAL_NO == 0 + CMU_ClockEnable(cmuClock_USART0, true); +#elif ADAFRUIT_HXD8357D_PERIPHERAL_NO == 1 + CMU_ClockEnable(cmuClock_USART1, true); +#elif ADAFRUIT_HXD8357D_PERIPHERAL_NO == 2 + CMU_ClockEnable(cmuClock_USART2, true); +#endif + + usartInit.databits = usartDatabits8; + USART_InitSync(device_config->usart, &usartInit); + +#if defined(USART_ROUTEPEN_TXPEN) + ADAFRUIT_HXD8357D_PERIPHERAL->ROUTELOC0 = + (ADAFRUIT_HXD8357D_PERIPHERAL->ROUTELOC0 + & ~(_USART_ROUTELOC0_TXLOC_MASK + | _USART_ROUTELOC0_RXLOC_MASK + | _USART_ROUTELOC0_CLKLOC_MASK)) + | (ADAFRUIT_HXD8357D_TX_LOC << _USART_ROUTELOC0_TXLOC_SHIFT) + | (ADAFRUIT_HXD8357D_RX_LOC << _USART_ROUTELOC0_RXLOC_SHIFT) + | (ADAFRUIT_HXD8357D_CLK_LOC << _USART_ROUTELOC0_CLKLOC_SHIFT); + + ADAFRUIT_HXD8357D_PERIPHERAL->ROUTEPEN = USART_ROUTEPEN_TXPEN + | USART_ROUTEPEN_RXPEN + | USART_ROUTEPEN_CLKPEN + | USART_ROUTEPEN_CSPEN; +#else + GPIO->USARTROUTE[device_config->peripheral_no].ROUTEEN = + GPIO_USART_ROUTEEN_TXPEN + | GPIO_USART_ROUTEEN_RXPEN + | GPIO_USART_ROUTEEN_CLKPEN; + GPIO->USARTROUTE[device_config->peripheral_no].TXROUTE = + ((uint32_t)device_config->tx.port << _GPIO_USART_TXROUTE_PORT_SHIFT) + | ((uint32_t)device_config->tx.pin << _GPIO_USART_TXROUTE_PIN_SHIFT); + GPIO->USARTROUTE[device_config->peripheral_no].RXROUTE = + ((uint32_t)device_config->rx.port << _GPIO_USART_RXROUTE_PORT_SHIFT) + | ((uint32_t)device_config->rx.pin << _GPIO_USART_RXROUTE_PIN_SHIFT); + GPIO->USARTROUTE[device_config->peripheral_no].CLKROUTE = + ((uint32_t)device_config->clk.port << _GPIO_USART_CLKROUTE_PORT_SHIFT) + | ((uint32_t)device_config->clk.pin << _GPIO_USART_CLKROUTE_PIN_SHIFT); +#endif + + GPIO_PinModeSet(device_config->clk.port, + device_config->clk.pin, + gpioModePushPull, + 0); + GPIO_PinModeSet(device_config->tx.port, + device_config->tx.pin, + gpioModePushPull, + 0); + GPIO_PinModeSet(device_config->rx.port, + device_config->rx.pin, + gpioModePushPull, + 0); + GPIO_PinModeSet(device_config->cs.port, + device_config->cs.pin, + gpioModePushPull, + 0); + GPIO_PinModeSet(device_config->dc.port, + device_config->dc.pin, + gpioModePushPull, + 0); + + device->api = &mipi_dbi_api; + device->config = config; + device->data = (struct mipi_dbi_data *)&mipi_dbi_spi_gecko_data; + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_si91x.c b/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_si91x.c new file mode 100644 index 00000000..633653dd --- /dev/null +++ b/driver/public/silabs/services_mipi_dbi/src/mipi_dbi_spi_si91x.c @@ -0,0 +1,358 @@ +/***************************************************************************//** + * @file mipi_dbi_spi_si91x.c + * @brief TFT Display MIPI_DBI Interface Driver source file. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include "sl_status.h" +#include "sl_sleeptimer.h" +#include "sl_component_catalog.h" +#include "sl_si91x_clock_manager.h" +#include "sl_si91x_peripheral_gpio.h" +#include "gpio_helper_si91x.h" +#include "sl_si91x_gspi.h" +#include "mipi_dbi.h" +#include "mipi_dbi_spi.h" + +#define SOC_PLL_CLK \ + ((uint32_t) (180000000L)) // 180MHz default SoC PLL Clock + // as source to Processor +#define INTF_PLL_CLK \ + ((uint32_t) (180000000L)) // 180MHz default Interface PLL Clock + // as source to all peripherals + +#define wait_spi_transfer_ready(handle) \ + do { \ + sl_gspi_status_t gspi_status; \ + do { \ + gspi_status = sl_si91x_gspi_get_status(handle); \ + } while (gspi_status.busy); \ + } while (0) + +// ----------------------------------------------------------------------------- +// Local Variables +// ----------------------------------------------------------------------------- +static volatile mipi_dbi_transfer_complete_callback_t transfer_complete_callback + = NULL; + +static sl_status_t reset(const struct mipi_dbi_device *device, + uint32_t delay); +static sl_status_t command_read( + const struct mipi_dbi_device *device, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len); +static sl_status_t command_write( + const struct mipi_dbi_device *device, + uint8_t cmd, + const uint8_t *data, size_t len); +static sl_status_t write_display( + const struct mipi_dbi_device *device, + const uint8_t *framebuf, + struct mipi_dbi_display_buffer_descriptor *desc, + enum mipi_dbi_display_pixel_format pixfmt, + mipi_dbi_transfer_complete_callback_t callback); +static void event_callback(uint32_t event); + +static const struct mipi_dbi_api mipi_dbi_api = { + .command_read = command_read, + .command_write = command_write, + .write_display = write_display, + .reset = reset +}; + +static sl_gspi_handle_t spi_handle = NULL; + +static void spi_select(const struct mipi_dbi_device *device) +{ + struct mipi_dbi_gspi_config *config = + (struct mipi_dbi_gspi_config *)device->config; + + if (config->control_config->slave_select_mode == SL_GSPI_MASTER_SW) { + sl_gpio_clear_pin_output(si91x_get_port(config->cs.num), + si91x_get_pin(config->cs.num)); + } +} + +static void spi_deselect(const struct mipi_dbi_device *device) +{ + struct mipi_dbi_gspi_config *config = + (struct mipi_dbi_gspi_config *)device->config; + + if (config->control_config->slave_select_mode == SL_GSPI_MASTER_SW) { + sl_gpio_set_pin_output(si91x_get_port(config->cs.num), + si91x_get_pin(config->cs.num)); + } +} + +static void set_dc_mode(const struct mipi_dbi_device *device, bool mode) +{ + struct mipi_dbi_gspi_config *config = + (struct mipi_dbi_gspi_config *)device->config; + + if (mode) { + sl_gpio_set_pin_output(si91x_get_port(config->dc.num), + si91x_get_pin(config->dc.num)); + } else { + sl_gpio_clear_pin_output(si91x_get_port(config->dc.num), + si91x_get_pin(config->dc.num)); + } +} + +static sl_status_t spi_write_b(const struct mipi_dbi_device *device, + const void *buf, + int count) +{ + sl_status_t status; + + wait_spi_transfer_ready(spi_handle); + spi_select(device); + status = sl_si91x_gspi_send_data(spi_handle, + buf, + count); + wait_spi_transfer_ready(spi_handle); + spi_deselect(device); + return status; +} + +static sl_status_t spi_write( + const struct mipi_dbi_device *device, + const void *buf, + int count, + mipi_dbi_transfer_complete_callback_t callback) +{ + sl_status_t status; + + wait_spi_transfer_ready(spi_handle); + transfer_complete_callback = callback; + + spi_select(device); + status = sl_si91x_gspi_send_data(spi_handle, + buf, + count); + return status; +} + +static sl_status_t reset(const struct mipi_dbi_device *device, + uint32_t delay) +{ + (void) device; + (void) delay; + return SL_STATUS_NOT_SUPPORTED; +} + +static sl_status_t command_read(const struct mipi_dbi_device *device, + uint8_t *cmds, size_t num_cmds, + uint8_t *response, size_t len) +{ + (void) device; + (void) cmds; + (void) num_cmds; + (void) response; + (void) len; + return SL_STATUS_NOT_SUPPORTED; +} + +static sl_status_t command_write( + const struct mipi_dbi_device *device, + uint8_t cmd, + const uint8_t *data, size_t len) +{ + sl_status_t status; + + set_dc_mode(device, false); + status = spi_write_b(device, &cmd, 1); + if (SL_STATUS_OK != status) { + return status; + } + + if (len) { + set_dc_mode(device, true); + status = spi_write_b(device, data, len); + } + return status; +} + +static sl_status_t write_display( + const struct mipi_dbi_device *device, + const uint8_t *framebuf, + struct mipi_dbi_display_buffer_descriptor *desc, + enum mipi_dbi_display_pixel_format pixfmt, + mipi_dbi_transfer_complete_callback_t callback) +{ + sl_status_t status; + (void)pixfmt; + + set_dc_mode(device, true); + if (callback) { + status = spi_write(device, framebuf, desc->buf_size, callback); + } else { + status = spi_write_b(device, framebuf, desc->buf_size); + } + return status; +} + +static void event_callback(uint32_t event) +{ + switch (event) { + case SL_GSPI_TRANSFER_COMPLETE: + break; + case SL_GSPI_DATA_LOST: + break; + case SL_GSPI_MODE_FAULT: + break; + } + + if (transfer_complete_callback) { + mipi_dbi_transfer_complete_callback_t callback = + transfer_complete_callback; + transfer_complete_callback = NULL; + callback(); + } +} + +/******************************************************************************* + * default_clock_configuration + ******************************************************************************/ +static void default_clock_configuration(void) +{ + // Core Clock runs at 180MHz SOC PLL Clock + sl_si91x_clock_manager_m4_set_core_clk(M4_SOCPLLCLK, SOC_PLL_CLK); + + // All peripherals' source to be set to Interface PLL Clock + // and it runs at 180MHz + sl_si91x_clock_manager_set_pll_freq(INFT_PLL, + INTF_PLL_CLK, + PLL_REF_CLK_VAL_XTAL); +} + +sl_status_t mipi_dbi_device_init(struct mipi_dbi_device *device, + const struct mipi_dbi_config *config) +{ + sl_status_t status; + sl_gspi_clock_config_t clock_config; + sl_gspi_control_config_t control_config; +// extern sl_gspi_control_config_t gspi_configuration; + struct mipi_dbi_gspi_config *si91x_config = + (struct mipi_dbi_gspi_config *)config; + + default_clock_configuration(); + + memcpy(&clock_config, si91x_config->clock_config, sizeof(clock_config)); + memcpy(&control_config, si91x_config->control_config, sizeof(control_config)); +// gspi_configuration = control_config; + // Configuration of clock with the default clock parameters + status = sl_si91x_gspi_configure_clock(&clock_config); + if (status != SL_STATUS_OK) { + return status; + } + // Pass the address of void pointer, it will be updated with the address + // of GSPI instance which can be used in other APIs. + status = sl_si91x_gspi_init(SL_GSPI_MASTER, &spi_handle); + if (status != SL_STATUS_OK) { + return status; + } + + // Fetching the status of GSPI i.e., busy, data lost and mode fault + // Configuration of all other parameters that are required by GSPI + // gspi_configuration structure is from sl_si91x_gspi_init.h file. + // The user can modify this structure with the configuration of + // his choice by filling this structure. + status = sl_si91x_gspi_set_configuration(spi_handle, + &control_config); + if (status != SL_STATUS_OK) { + return status; + } + + // Register user callback function + status = sl_si91x_gspi_register_event_callback(spi_handle, + event_callback); + if (status != SL_STATUS_OK) { + return status; + } + + // Validation for executing the API only once + status = sl_si91x_gspi_set_slave_number(GSPI_SLAVE_0); + if (status != SL_STATUS_OK) { + return status; + } + + status = si91x_gpio_setup(si91x_config->cs.num, + si91x_config->cs.mode, + GPIO_OUTPUT, + 1); + if (status != SL_STATUS_OK) { + return status; + } + + status = si91x_gpio_setup(si91x_config->dc.num, + si91x_config->dc.mode, + GPIO_OUTPUT, + 1); + if (status != SL_STATUS_OK) { + return status; + } + + status = si91x_gpio_setup(si91x_config->clk.num, + si91x_config->clk.mode, + GPIO_OUTPUT, + 0); + if (status != SL_STATUS_OK) { + return status; + } + + status = si91x_gpio_setup(si91x_config->tx.num, + si91x_config->tx.mode, + GPIO_OUTPUT, + 0); + if (status != SL_STATUS_OK) { + return status; + } + + status = si91x_gpio_setup(si91x_config->rx.num, + si91x_config->rx.mode, + GPIO_OUTPUT, + 0); + if (status != SL_STATUS_OK) { + return status; + } + + device->api = &mipi_dbi_api; + device->config = config; + + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/services_nfc/nci/src/nci.c b/driver/public/silabs/services_nfc/nci/src/nci.c index 153f6e8d..41532068 100644 --- a/driver/public/silabs/services_nfc/nci/src/nci.c +++ b/driver/public/silabs/services_nfc/nci/src/nci.c @@ -1211,7 +1211,6 @@ nci_err_t nci_incoming_packet_process(void) default: /* Error: OID not recognized */ return nci_err_uknown_oid; - break; } break; } @@ -1256,7 +1255,6 @@ nci_err_t nci_incoming_packet_process(void) default: /* Error: OID not recognized */ return nci_err_uknown_oid; - break; } break; } @@ -1277,7 +1275,6 @@ nci_err_t nci_incoming_packet_process(void) default: /* Error: OID not recognized */ return nci_err_uknown_oid; - break; } break; } @@ -1286,12 +1283,10 @@ nci_err_t nci_incoming_packet_process(void) case nci_gid_proprietary: { /* Hand it to proprietary parser. */ return nci_incoming_proprietary_packet_rsp_process(packet_buff); - break; } default: /* Error: GID not recognized */ return nci_err_uknown_gid; - break; } break; } @@ -1325,7 +1320,6 @@ nci_err_t nci_incoming_packet_process(void) default: /* Error: OID not recognized */ return nci_err_uknown_oid; - break; } break; } @@ -1370,7 +1364,6 @@ nci_err_t nci_incoming_packet_process(void) default: /* Error: OID not recognized */ return nci_err_uknown_oid; - break; } break; } @@ -1387,7 +1380,6 @@ nci_err_t nci_incoming_packet_process(void) default: /* Error: OID not recognized */ return nci_err_uknown_oid; - break; } break; } @@ -1396,12 +1388,10 @@ nci_err_t nci_incoming_packet_process(void) case nci_gid_proprietary: { /* Hand it to proprietary parser. */ return nci_incoming_proprietary_packet_ntf_process(packet_buff); - break; } default: { /* Error: GID not recognized */ return nci_err_uknown_gid; - break; } } break; @@ -1409,7 +1399,6 @@ nci_err_t nci_incoming_packet_process(void) default: { /* Error: MT not recognized */ return nci_err_uknown_mt; - break; } } return nci_err_none; diff --git a/driver/public/silabs/services_touch_screen/config/brd2601b/touch_screen_config.h b/driver/public/silabs/services_touch_screen/config/brd2601b/touch_screen_config.h index 1f9c2bd0..a88e3a5f 100644 --- a/driver/public/silabs/services_touch_screen/config/brd2601b/touch_screen_config.h +++ b/driver/public/silabs/services_touch_screen/config/brd2601b/touch_screen_config.h @@ -45,66 +45,78 @@ extern "C" // Touch settings -// Touch screen width +// Touch Screen Horizontal Resolution // Default: 240 -#define TOUCHSCREEN_WIDTH 240 +#define TOUCHSCREEN_HOR_RES 240 -// Touch screen height +// Touch Screen Vertical Resolution // Default: 320 -#define TOUCHSCREEN_HEIGHT 320 +#define TOUCHSCREEN_VER_RES 320 -// +// X-plate resistance +// Default: 200 +// 200 +#define TOUCHSCREEN_XPLATE_RES 200 + +// Invert X-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_X_INV 1 -// CALIBRATION settings +// Invert Y-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_Y_INV 1 -// Enable calibration printf +// XY Swap // Default: 0 -#define CALIBRATION_PRINTF 0 +// 0 +#define TOUCHSCREEN_XY_SWAP 0 -// Calib X-min +// Calib X-min // Default: 460 -#define CALIB_X_MIN 460 +#define TOUCHSCREEN_X_MIN 460 -// Calib X-max +// Calib X-max // Default: 3620 -#define CALIB_X_MAX 3620 +#define TOUCHSCREEN_X_MAX 3620 -// Calib Y-min +// Calib Y-min // Default: 340 -#define CALIB_Y_MIN 340 +#define TOUCHSCREEN_Y_MIN 340 -// Calib Y-max +// Calib Y-max // Default: 3580 -#define CALIB_Y_MAX 3580 +#define TOUCHSCREEN_Y_MAX 3580 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// XP -// $[GPIO_XP] -#define XP_PORT gpioPortD -#define XP_PIN 2 -// [GPIO_XP]$ - -// YP -// $[GPIO_YP] -#define YP_PORT gpioPortC -#define YP_PIN 4 -// [GPIO_YP]$ - -// XM -// $[GPIO_XM] -#define XM_PORT gpioPortB -#define XM_PIN 2 -// [GPIO_XM]$ - -// YM -// $[GPIO_YM] -#define YM_PORT gpioPortB -#define YM_PIN 3 -// [GPIO_YM]$ +// TOUCHSCREEN_XP +// $[GPIO_TOUCHSCREEN_XP] +#define TOUCHSCREEN_XP_PORT gpioPortD +#define TOUCHSCREEN_XP_PIN 2 +// [GPIO_TOUCHSCREEN_XP]$ + +// TOUCHSCREEN_YP +// $[GPIO_TOUCHSCREEN_YP] +#define TOUCHSCREEN_YP_PORT gpioPortC +#define TOUCHSCREEN_YP_PIN 4 +// [GPIO_TOUCHSCREEN_YP]$ + +// TOUCHSCREEN_XM +// $[GPIO_TOUCHSCREEN_XM] +#define TOUCHSCREEN_XM_PORT gpioPortB +#define TOUCHSCREEN_XM_PIN 2 +// [GPIO_TOUCHSCREEN_XM]$ + +// TOUCHSCREEN_YM +// $[GPIO_TOUCHSCREEN_YM] +#define TOUCHSCREEN_YM_PORT gpioPortB +#define TOUCHSCREEN_YM_PIN 3 +// [GPIO_TOUCHSCREEN_YM]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/services_touch_screen/config/brd2703a/touch_screen_config.h b/driver/public/silabs/services_touch_screen/config/brd2703a/touch_screen_config.h index 799e92f7..55ebe7a6 100644 --- a/driver/public/silabs/services_touch_screen/config/brd2703a/touch_screen_config.h +++ b/driver/public/silabs/services_touch_screen/config/brd2703a/touch_screen_config.h @@ -45,66 +45,98 @@ extern "C" // Touch settings -// Touch screen width +// ADC module // Default: 240 -#define TOUCHSCREEN_WIDTH 240 +#define TOUCHSCREEN_ADC IADC0 -// Touch screen height +// Touch Screen Horizontal Resolution +// Default: 240 +#define TOUCHSCREEN_HOR_RES 240 + +// Touch Screen Vertical Resolution // Default: 320 -#define TOUCHSCREEN_HEIGHT 320 +#define TOUCHSCREEN_VER_RES 320 -// +// X-plate resistance +// Default: 200 +// 200 +#define TOUCHSCREEN_XPLATE_RES 200 -// CALIBRATION settings +// Invert X-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_X_INV 1 -// Enable calibration printf +// Invert Y-axis // Default: 0 -#define CALIBRATION_PRINTF 0 +// 0 +#define TOUCHSCREEN_Y_INV 1 -// Calib X-min +// XY Swap +// Default: 0 +// 0 +#define TOUCHSCREEN_XY_SWAP 0 + +// Calib X-min // Default: 460 -#define CALIB_X_MIN 460 +#define TOUCHSCREEN_X_MIN 460 -// Calib X-max +// Calib X-max // Default: 3620 -#define CALIB_X_MAX 3620 +#define TOUCHSCREEN_X_MAX 3620 -// Calib Y-min +// Calib Y-min // Default: 340 -#define CALIB_Y_MIN 340 +#define TOUCHSCREEN_Y_MIN 340 -// Calib Y-max +// Calib Y-max // Default: 3580 -#define CALIB_Y_MAX 3580 +#define TOUCHSCREEN_Y_MAX 3580 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// XP -// $[GPIO_XP] -#define XP_PORT gpioPortD -#define XP_PIN 5 -// [GPIO_XP]$ - -// YP -// $[GPIO_YP] -#define YP_PORT gpioPortD -#define YP_PIN 4 -// [GPIO_YP]$ - -// XM -// $[GPIO_XM] -#define XM_PORT gpioPortA -#define XM_PIN 0 -// [GPIO_XM]$ - -// YM -// $[GPIO_YM] -#define YM_PORT gpioPortB -#define YM_PIN 1 -// [GPIO_YM]$ +// TOUCHSCREEN_XP +// $[GPIO_TOUCHSCREEN_XP] +#ifndef TOUCHSCREEN_XP_PORT +#define TOUCHSCREEN_XP_PORT gpioPortD +#endif +#ifndef TOUCHSCREEN_XP_PIN +#define TOUCHSCREEN_XP_PIN 5 +#endif +// [GPIO_TOUCHSCREEN_XP]$ + +// TOUCHSCREEN_YP +// $[GPIO_TOUCHSCREEN_YP] +#ifndef TOUCHSCREEN_YP_PORT +#define TOUCHSCREEN_YP_PORT gpioPortD +#endif +#ifndef TOUCHSCREEN_YP_PIN +#define TOUCHSCREEN_YP_PIN 4 +#endif +// [GPIO_TOUCHSCREEN_YP]$ + +// TOUCHSCREEN_XM +// $[GPIO_TOUCHSCREEN_XM] +#ifndef TOUCHSCREEN_XM_PORT +#define TOUCHSCREEN_XM_PORT gpioPortA +#endif +#ifndef TOUCHSCREEN_XM_PIN +#define TOUCHSCREEN_XM_PIN 0 +#endif +// [GPIO_TOUCHSCREEN_XM]$ + +// TOUCHSCREEN_YM +// $[GPIO_TOUCHSCREEN_YM] +#ifndef TOUCHSCREEN_YM_PORT +#define TOUCHSCREEN_YM_PORT gpioPortB +#endif +#ifndef TOUCHSCREEN_YM_PIN +#define TOUCHSCREEN_YM_PIN 1 +#endif +// [GPIO_TOUCHSCREEN_YM]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/services_touch_screen/config/brd2704a/touch_screen_config.h b/driver/public/silabs/services_touch_screen/config/brd2704a/touch_screen_config.h index 5c4af082..30a3c082 100644 --- a/driver/public/silabs/services_touch_screen/config/brd2704a/touch_screen_config.h +++ b/driver/public/silabs/services_touch_screen/config/brd2704a/touch_screen_config.h @@ -45,66 +45,78 @@ extern "C" // Touch settings -// Touch screen width +// Touch Screen Horizontal Resolution // Default: 240 -#define TOUCHSCREEN_WIDTH 240 +#define TOUCHSCREEN_HOR_RES 240 -// Touch screen height +// Touch Screen Vertical Resolution // Default: 320 -#define TOUCHSCREEN_HEIGHT 320 +#define TOUCHSCREEN_VER_RES 320 -// +// X-plate resistance +// Default: 200 +// 200 +#define TOUCHSCREEN_XPLATE_RES 200 + +// Invert X-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_X_INV 1 -// CALIBRATION settings +// Invert Y-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_Y_INV 1 -// Enable calibration printf +// XY Swap // Default: 0 -#define CALIBRATION_PRINTF 0 +// 0 +#define TOUCHSCREEN_XY_SWAP 0 -// Calib X-min +// Calib X-min // Default: 460 -#define CALIB_X_MIN 460 +#define TOUCHSCREEN_X_MIN 460 -// Calib X-max +// Calib X-max // Default: 3620 -#define CALIB_X_MAX 3620 +#define TOUCHSCREEN_X_MAX 3620 -// Calib Y-min +// Calib Y-min // Default: 340 -#define CALIB_Y_MIN 340 +#define TOUCHSCREEN_Y_MIN 340 -// Calib Y-max +// Calib Y-max // Default: 3580 -#define CALIB_Y_MAX 3580 +#define TOUCHSCREEN_Y_MAX 3580 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// XP -// $[GPIO_XP] -#define XP_PORT gpioPortD -#define XP_PIN 2 -// [GPIO_XP]$ - -// YP -// $[GPIO_YP] -#define YP_PORT gpioPortA -#define YP_PIN 0 -// [GPIO_YP]$ - -// XM -// $[GPIO_XM] -#define XM_PORT gpioPortD -#define XM_PIN 0 -// [GPIO_XM]$ - -// YM -// $[GPIO_YM] -#define YM_PORT gpioPortD -#define YM_PIN 1 -// [GPIO_YM]$ +// TOUCHSCREEN_XP +// $[GPIO_TOUCHSCREEN_XP] +#define TOUCHSCREEN_XP_PORT gpioPortD +#define TOUCHSCREEN_XP_PIN 2 +// [GPIO_TOUCHSCREEN_XP]$ + +// TOUCHSCREEN_YP +// $[GPIO_TOUCHSCREEN_YP] +#define TOUCHSCREEN_YP_PORT gpioPortA +#define TOUCHSCREEN_YP_PIN 0 +// [GPIO_TOUCHSCREEN_YP]$ + +// TOUCHSCREEN_XM +// $[GPIO_TOUCHSCREEN_XM] +#define TOUCHSCREEN_XM_PORT gpioPortD +#define TOUCHSCREEN_XM_PIN 0 +// [GPIO_TOUCHSCREEN_XM]$ + +// TOUCHSCREEN_YM +// $[GPIO_TOUCHSCREEN_YM] +#define TOUCHSCREEN_YM_PORT gpioPortD +#define TOUCHSCREEN_YM_PIN 1 +// [GPIO_TOUCHSCREEN_YM]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/services_touch_screen/config/brd4108a/touch_screen_config.h b/driver/public/silabs/services_touch_screen/config/brd4108a/touch_screen_config.h index 7ea4a4c4..c483382a 100644 --- a/driver/public/silabs/services_touch_screen/config/brd4108a/touch_screen_config.h +++ b/driver/public/silabs/services_touch_screen/config/brd4108a/touch_screen_config.h @@ -45,66 +45,78 @@ extern "C" // Touch settings -// Touch screen width +// Touch Screen Horizontal Resolution // Default: 240 -#define TOUCHSCREEN_WIDTH 240 +#define TOUCHSCREEN_HOR_RES 240 -// Touch screen height +// Touch Screen Vertical Resolution // Default: 320 -#define TOUCHSCREEN_HEIGHT 320 +#define TOUCHSCREEN_VER_RES 320 -// +// X-plate resistance +// Default: 200 +// 200 +#define TOUCHSCREEN_XPLATE_RES 200 + +// Invert X-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_X_INV 1 -// CALIBRATION settings +// Invert Y-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_Y_INV 1 -// Enable calibration printf +// XY Swap // Default: 0 -#define CALIBRATION_PRINTF 0 +// 0 +#define TOUCHSCREEN_XY_SWAP 0 -// Calib X-min +// Calib X-min // Default: 460 -#define CALIB_X_MIN 460 +#define TOUCHSCREEN_X_MIN 460 -// Calib X-max +// Calib X-max // Default: 3620 -#define CALIB_X_MAX 3620 +#define TOUCHSCREEN_X_MAX 3620 -// Calib Y-min +// Calib Y-min // Default: 340 -#define CALIB_Y_MIN 340 +#define TOUCHSCREEN_Y_MIN 340 -// Calib Y-max +// Calib Y-max // Default: 3580 -#define CALIB_Y_MAX 3580 +#define TOUCHSCREEN_Y_MAX 3580 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// XP -// $[GPIO_XP] -#define XP_PORT gpioPortB -#define XP_PIN 2 -// [GPIO_XP]$ - -// YP -// $[GPIO_YP] -#define YP_PORT gpioPortD -#define YP_PIN 2 -// [GPIO_YP]$ - -// XM -// $[GPIO_XM] -#define XM_PORT gpioPortB -#define XM_PIN 4 -// [GPIO_XM]$ - -// YM -// $[GPIO_YM] -#define YM_PORT gpioPortB -#define YM_PIN 3 -// [GPIO_YM]$ +// TOUCHSCREEN_XP +// $[GPIO_TOUCHSCREEN_XP] +#define TOUCHSCREEN_XP_PORT gpioPortB +#define TOUCHSCREEN_XP_PIN 2 +// [GPIO_TOUCHSCREEN_XP]$ + +// TOUCHSCREEN_YP +// $[GPIO_TOUCHSCREEN_YP] +#define TOUCHSCREEN_YP_PORT gpioPortD +#define TOUCHSCREEN_YP_PIN 2 +// [GPIO_TOUCHSCREEN_YP]$ + +// TOUCHSCREEN_XM +// $[GPIO_TOUCHSCREEN_XM] +#define TOUCHSCREEN_XM_PORT gpioPortB +#define TOUCHSCREEN_XM_PIN 4 +// [GPIO_TOUCHSCREEN_XM]$ + +// TOUCHSCREEN_YM +// $[GPIO_TOUCHSCREEN_YM] +#define TOUCHSCREEN_YM_PORT gpioPortB +#define TOUCHSCREEN_YM_PIN 3 +// [GPIO_TOUCHSCREEN_YM]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/services_touch_screen/config/brd4314a/touch_screen_config.h b/driver/public/silabs/services_touch_screen/config/brd4314a/touch_screen_config.h index 7ea4a4c4..6264bb70 100644 --- a/driver/public/silabs/services_touch_screen/config/brd4314a/touch_screen_config.h +++ b/driver/public/silabs/services_touch_screen/config/brd4314a/touch_screen_config.h @@ -45,66 +45,78 @@ extern "C" // Touch settings -// Touch screen width +// Touch Screen Horizontal Resolution // Default: 240 -#define TOUCHSCREEN_WIDTH 240 +#define TOUCHSCREEN_HOR_RES 240 -// Touch screen height +// Touch Screen Vertical Resolution // Default: 320 -#define TOUCHSCREEN_HEIGHT 320 +#define TOUCHSCREEN_VER_RES 320 -// +// X-plate resistance +// Default: 200 +// 200 +#define TOUCHSCREEN_XPLATE_RES 200 + +// Invert X-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_X_INV 1 -// CALIBRATION settings +// Invert Y-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_Y_INV 1 -// Enable calibration printf +// XY Swap // Default: 0 -#define CALIBRATION_PRINTF 0 +// 0 +#define TOUCHSCREEN_XY_SWAP 0 -// Calib X-min +// Calib X-min // Default: 460 -#define CALIB_X_MIN 460 +#define TOUCHSCREEN_X_MIN 460 -// Calib X-max +// Calib X-max // Default: 3620 -#define CALIB_X_MAX 3620 +#define TOUCHSCREEN_X_MAX 3620 -// Calib Y-min +// Calib Y-min // Default: 340 -#define CALIB_Y_MIN 340 +#define TOUCHSCREEN_Y_MIN 340 -// Calib Y-max +// Calib Y-max // Default: 3580 -#define CALIB_Y_MAX 3580 +#define TOUCHSCREEN_Y_MAX 3580 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// XP -// $[GPIO_XP] -#define XP_PORT gpioPortB -#define XP_PIN 2 -// [GPIO_XP]$ - -// YP -// $[GPIO_YP] -#define YP_PORT gpioPortD -#define YP_PIN 2 -// [GPIO_YP]$ - -// XM -// $[GPIO_XM] -#define XM_PORT gpioPortB -#define XM_PIN 4 +// TOUCHSCREEN_XP +// $[GPIO_TOUCHSCREEN_XP] +#define TOUCHSCREEN_XP_PORT gpioPortB +#define TOUCHSCREEN_XP_PIN 2 +// [GPIO_TOUCHSCREEN_XP]$ + +// TOUCHSCREEN_YP +// $[GPIO_TOUCHSCREEN_YP] +#define TOUCHSCREEN_YP_PORT gpioPortD +#define TOUCHSCREEN_YP_PIN 2 +// [GPIO_TOUCHSCREEN_YP]$ + +// TOUCHSCREEN_XM +// $[GPIO_TOUCHSCREEN_XM] +#define TOUCHSCREEN_XM_PORT gpioPortB +#define TOUCHSCREEN_XM_PIN 4 // [GPIO_XM]$ -// YM -// $[GPIO_YM] -#define YM_PORT gpioPortB -#define YM_PIN 3 -// [GPIO_YM]$ +// TOUCHSCREEN_YM +// $[GPIO_TOUCHSCREEN_YM] +#define TOUCHSCREEN_YM_PORT gpioPortB +#define TOUCHSCREEN_YM_PIN 3 +// [GPIO_TOUCHSCREEN_YM]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/services_touch_screen/config/brd4338a/touch_screen_config.h b/driver/public/silabs/services_touch_screen/config/brd4338a/touch_screen_config.h new file mode 100644 index 00000000..b87258f2 --- /dev/null +++ b/driver/public/silabs/services_touch_screen/config/brd4338a/touch_screen_config.h @@ -0,0 +1,193 @@ +/***************************************************************************//** + * @file touch_screen_config.h + * @brief Configuration file for touch screen driver. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ +#ifndef TOUCH_SCREEN_CONFIG_H_ +#define TOUCH_SCREEN_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// Touch settings + +// Touch Screen Horizontal Resolution +// Default: 240 +#define TOUCHSCREEN_HOR_RES 240 + +// Touch Screen Vertical Resolution +// Default: 320 +#define TOUCHSCREEN_VER_RES 320 + +// X-plate resistance +// Default: 200 +// 200 +#define TOUCHSCREEN_XPLATE_RES 200 + +// Invert X-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_X_INV 1 + +// Invert Y-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_Y_INV 1 + +// XY Swap +// Default: 0 +// 0 +#define TOUCHSCREEN_XY_SWAP 0 + +// Calib X-min +// Default: 460 +#define TOUCHSCREEN_X_MIN 428 + +// Calib X-max +// Default: 3620 +#define TOUCHSCREEN_X_MAX 3628 + +// Calib Y-min +// Default: 340 +#define TOUCHSCREEN_Y_MIN 260 + +// Calib Y-max +// Default: 3580 +#define TOUCHSCREEN_Y_MAX 3776 + +// + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> +// SL_ADC_XM +// $[ADC_SL_ADC_XM] +#ifndef SL_ADC_XM_PERIPHERAL +#define SL_ADC_XM_PERIPHERAL ADC +#endif + +// ADC P0 on ULP_GPIO_8/GPIO_72 +#ifndef SL_ADC_XM_P0_PORT +#define SL_ADC_XM_P0_PORT ULP +#endif +#ifndef SL_ADC_XM_P0_PIN +#define SL_ADC_XM_P0_PIN 8 +#endif +#ifndef SL_ADC_XM_P0_LOC +#define SL_ADC_XM_P0_LOC 4 +#endif + +// ADC N0 on GPIO_28 +#ifndef SL_ADC_XM_N0_PORT +#define SL_ADC_XM_N0_PORT ULP +#endif +#ifndef SL_ADC_XM_N0_PIN +#define SL_ADC_XM_N0_PIN 28 +#endif +#ifndef SL_ADC_XM_N0_LOC +#define SL_ADC_XM_N0_LOC 7 +#endif +// [ADC_SL_ADC_XM]$ + +// SL_ADC_YP +// $[ADC_SL_ADC_YP] +#ifndef SL_ADC_YP_PERIPHERAL +#define SL_ADC_YP_PERIPHERAL ADC +#endif + +// ADC P1 on ULP_GPIO_1/GPIO_65 +#ifndef SL_ADC_YP_P1_PORT +#define SL_ADC_YP_P1_PORT ULP +#endif +#ifndef SL_ADC_YP_P1_PIN +#define SL_ADC_YP_P1_PIN 1 +#endif +#ifndef SL_ADC_YP_P1_LOC +#define SL_ADC_YP_P1_LOC 10 +#endif + +// ADC N1 on GPIO_30 +#ifndef SL_ADC_YP_N1_PORT +#define SL_ADC_YP_N1_PORT ULP +#endif +#ifndef SL_ADC_YP_N1_PIN +#define SL_ADC_YP_N1_PIN 30 +#endif +#ifndef SL_ADC_YP_N1_LOC +#define SL_ADC_YP_N1_LOC 8 +#endif +// [ADC_SL_ADC_YP]$ + +// TOUCHSCREEN_XP +// $[GPIO_TOUCHSCREEN_XP] +#ifndef TOUCHSCREEN_XP_PORT +#define TOUCHSCREEN_XP_PORT ULP +#endif +#ifndef TOUCHSCREEN_XP_PIN +#define TOUCHSCREEN_XP_PIN 7 +#endif +// [GPIO_TOUCHSCREEN_XP]$ + +// TOUCHSCREEN_YM +// $[GPIO_TOUCHSCREEN_YM] +#ifndef TOUCHSCREEN_YM_PORT +#define TOUCHSCREEN_YM_PORT ULP +#endif +#ifndef TOUCHSCREEN_YM_PIN +#define TOUCHSCREEN_YM_PIN 6 +#endif +// [GPIO_TOUCHSCREEN_YM]$ + +// <<< sl:end pin_tool >>> + +#define N0_START_LOCATION_PINTOOL 343 +#define TOUCHSCREEN_XM_PORT SL_ADC_XM_P0_PORT +#define TOUCHSCREEN_XM_PIN SL_ADC_XM_P0_PIN +#define TOUCHSCREEN_XM_POS_INPUT_CHNL_SEL SL_ADC_XM_P0_LOC +#define TOUCHSCREEN_XM_NEG_INPUT_CHNL_SEL SL_ADC_XM_N0_LOC + +#define TOUCHSCREEN_YP_PORT SL_ADC_YP_P1_PORT +#define TOUCHSCREEN_YP_PIN SL_ADC_YP_P1_PIN +#define TOUCHSCREEN_YP_POS_INPUT_CHNL_SEL SL_ADC_YP_P1_LOC +#define TOUCHSCREEN_YP_NEG_INPUT_CHNL_SEL SL_ADC_YP_N1_LOC + +#ifdef __cplusplus +extern "C" +} +#endif + +#endif /* TOUCH_SCREEN_CONFIG_H_ */ diff --git a/driver/public/silabs/services_touch_screen/config/other/touch_screen_config.h b/driver/public/silabs/services_touch_screen/config/other/touch_screen_config.h index 4868dcc7..db5a297c 100644 --- a/driver/public/silabs/services_touch_screen/config/other/touch_screen_config.h +++ b/driver/public/silabs/services_touch_screen/config/other/touch_screen_config.h @@ -45,62 +45,76 @@ extern "C" // Touch settings -// Touch screen width +// Touch Screen Horizontal Resolution // Default: 240 -#define TOUCHSCREEN_WIDTH 240 +#define TOUCHSCREEN_HOR_RES 240 -// Touch screen height +// Touch Screen Vertical Resolution // Default: 320 -#define TOUCHSCREEN_HEIGHT 320 +#define TOUCHSCREEN_VER_RES 320 -// +// X-plate resistance +// Default: 200 +// 200 +#define TOUCHSCREEN_XPLATE_RES 200 + +// Invert X-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_X_INV 1 -// CALIBRATION settings +// Invert Y-axis +// Default: 0 +// 0 +#define TOUCHSCREEN_Y_INV 1 -// Enable calibration printf +// XY Swap // Default: 0 -#define CALIBRATION_PRINTF 0 +// 0 +#define TOUCHSCREEN_XY_SWAP 0 + +// -// Calib X-min +// Calib X-min // Default: 460 -#define CALIB_X_MIN 460 +#define TOUCHSCREEN_X_MIN 460 -// Calib X-max +// Calib X-max // Default: 3620 -#define CALIB_X_MAX 3620 +#define TOUCHSCREEN_X_MAX 3620 -// Calib Y-min +// Calib Y-min // Default: 340 -#define CALIB_Y_MIN 340 +#define TOUCHSCREEN_Y_MIN 340 -// Calib Y-max +// Calib Y-max // Default: 3580 -#define CALIB_Y_MAX 3580 +#define TOUCHSCREEN_Y_MAX 3580 // // <<< end of configuration section >>> // <<< sl:start pin_tool >>> -// XP -// $[GPIO_XP] +// TOUCHSCREEN_XP +// $[GPIO_TOUCHSCREEN_XP] #warning "Touch screen X+ Pin not configured" -// [GPIO_XP]$ +// [GPIO_TOUCHSCREEN_XP]$ -// YP -// $[GPIO_YP] +// TOUCHSCREEN_YP +// $[GPIO_TOUCHSCREEN_YP] #warning "Touch screen Y+ Pin not configured" -// [GPIO_YP]$ +// [GPIO_TOUCHSCREEN_YP]$ -// XM -// $[GPIO_XM] +// TOUCHSCREEN_XM +// $[GPIO_TOUCHSCREEN_XM] #warning "Touch screen X- Pin not configured" -// [GPIO_XM]$ +// [GPIO_TOUCHSCREEN_XM]$ -// YM -// $[GPIO_YM] +// TOUCHSCREEN_YM +// $[GPIO_TOUCHSCREEN_YM] #warning "Touch screen Y- Pin not configured" -// [GPIO_YM]$ +// [GPIO_TOUCHSCREEN_YM]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/services_touch_screen/inc/lvgl_input.h b/driver/public/silabs/services_touch_screen/inc/lvgl_input.h index a481c5f0..03e14280 100644 --- a/driver/public/silabs/services_touch_screen/inc/lvgl_input.h +++ b/driver/public/silabs/services_touch_screen/inc/lvgl_input.h @@ -35,7 +35,7 @@ #ifndef LVGL_INPUT_H_ #define LVGL_INPUT_H_ - +#include #include "touch_screen.h" #ifdef __cplusplus diff --git a/driver/public/silabs/services_touch_screen/inc/touch_screen.h b/driver/public/silabs/services_touch_screen/inc/touch_screen.h index bc74a1a9..3f16dde3 100644 --- a/driver/public/silabs/services_touch_screen/inc/touch_screen.h +++ b/driver/public/silabs/services_touch_screen/inc/touch_screen.h @@ -42,12 +42,8 @@ // ----------------------------------------------------------------------------- // Includes // ----------------------------------------------------------------------------- +#include #include "sl_status.h" -#include "em_cmu.h" -#include "sl_udelay.h" -#include "em_gpio.h" -#include "em_iadc.h" -#include "touch_screen_config.h" #ifdef __cplusplus extern "C" { @@ -56,18 +52,70 @@ extern "C" { // ----------------------------------------------------------------------------- // Typedefs // ----------------------------------------------------------------------------- -typedef struct -{ - GPIO_Port_TypeDef port; - unsigned int pin; -}touch_adc_pin_t; + +struct touch_screen_config { + // Horizontal Resolution + uint32_t h_res; + + // Vertical Resolution + uint32_t v_res; + + // X-plate resistance + uint16_t xplate_res; + + // Calibration value: X-min + uint16_t x_min; + + // Calibration value: X-max + uint16_t x_max; + + // Calibration value: Y-min + uint16_t y_min; + + // Calibration value: Y-max + uint16_t y_max; + + // Invert X-axis + bool x_inv; + + // Invert Y-axis + bool y_inv; + + // Invert Y-axis + bool xy_swap; +}; + +enum TOUCH_SCREEN_CHANNEL { + TOUCH_SCREEN_CHANNEL_XM, + TOUCH_SCREEN_CHANNEL_XP, + TOUCH_SCREEN_CHANNEL_YM, + TOUCH_SCREEN_CHANNEL_YP, +}; + +struct touch_screen_analog_interface { + void (*delay_10us)(uint32_t idelay); + void (*set_input)(enum TOUCH_SCREEN_CHANNEL channel); + void (*set_output)(enum TOUCH_SCREEN_CHANNEL channel, uint8_t value); + sl_status_t (*adc_start_read)(enum TOUCH_SCREEN_CHANNEL channel); + uint16_t (*adc_read_u12)(void); + void (*adc_stop)(void); +}; + +struct touch_screen { + const struct touch_screen_config *config; + const struct touch_screen_analog_interface *aif; + uint16_t t_x; + uint16_t t_y; + uint16_t t_z1; + uint16_t t_z2; +}; // Touch point properties struct typedef struct { - int x; /* X coordinate of touch point */ - int y; /* Y coordinate of touch point */ - int z; /* Pressure value when touch point detected */ + int32_t x; /* X coordinate of touch point */ + int32_t y; /* Y coordinate of touch point */ + float r_touch; /* Pressure value when touch point detected */ } touch_point_t; // ----------------------------------------------------------------------------- @@ -82,7 +130,28 @@ typedef struct * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -sl_status_t touch_screen_init(void); +sl_status_t touch_screen_init(struct touch_screen *ts); + +/***************************************************************************//** + * @brief + * Initialize Touch Screen HAL. + * + * @return + * SL_STATUS_OK if there are no errors. + * SL_STATUS_FAIL if the process is failed. + ******************************************************************************/ +sl_status_t touch_screen_interface_init(struct touch_screen *ts); + +/***************************************************************************//** + * @brief + * Set config. + * + * @return + * SL_STATUS_OK if there are no errors. + * SL_STATUS_FAIL if the process is failed. + ******************************************************************************/ +void touch_screen_set_config(struct touch_screen *ts, + const struct touch_screen_config *config); /***************************************************************************//** * @brief @@ -97,7 +166,8 @@ sl_status_t touch_screen_init(void); * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -sl_status_t touch_screen_get_point(int rxplate, touch_point_t *ts_point); +sl_status_t touch_screen_get_point(struct touch_screen *ts, + touch_point_t *ts_point); #ifdef __cplusplus extern "C" diff --git a/driver/public/silabs/services_touch_screen/src/lvgl_input.c b/driver/public/silabs/services_touch_screen/src/lvgl_input.c index a526ba3a..5c327a2b 100644 --- a/driver/public/silabs/services_touch_screen/src/lvgl_input.c +++ b/driver/public/silabs/services_touch_screen/src/lvgl_input.c @@ -46,7 +46,7 @@ static bool lvgl_input_driver_get_touch(void); // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- -#define PRESSURE_THRESH (25) +#define PRESSURE_THRESH (500) static lvgl_input_t lvgl_input_instance; static bool initialized = false; static touch_point_t g_touch_point; @@ -58,6 +58,8 @@ static const lvgl_input_driver_api_t lvgl_input_driver_api = .get_xy = lvgl_input_driver_get_xy }; +static struct touch_screen touch_screen; + sl_status_t lvgl_input_init(void) { lvgl_input_instance.driver = &lvgl_input_driver_api; @@ -76,13 +78,13 @@ lvgl_input_t *lvgl_input_get(void) static sl_status_t lvgl_input_driver_init(void) { - sl_status_t stt = touch_screen_init(); - return stt; + return touch_screen_init(&touch_screen); } static sl_status_t lvgl_input_driver_read_data(void) { - sl_status_t stt = touch_screen_get_point(200, &g_touch_point); + sl_status_t stt = touch_screen_get_point(&touch_screen, + &g_touch_point); return stt; } @@ -104,7 +106,7 @@ static bool lvgl_input_driver_get_touch(void) { bool retVal = false; - if (g_touch_point.z < PRESSURE_THRESH) { + if (g_touch_point.r_touch < PRESSURE_THRESH) { retVal = true; } return retVal; diff --git a/driver/public/silabs/services_touch_screen/src/touch_screen.c b/driver/public/silabs/services_touch_screen/src/touch_screen.c index 13aecb8c..be88d7b9 100644 --- a/driver/public/silabs/services_touch_screen/src/touch_screen.c +++ b/driver/public/silabs/services_touch_screen/src/touch_screen.c @@ -40,58 +40,21 @@ // Includes // ----------------------------------------------------------------------------- #include "touch_screen.h" -#if CALIBRATION_PRINTF -#include "app_log.h" -#endif // ----------------------------------------------------------------------------- // Macros // ----------------------------------------------------------------------------- -// Set CLK_ADC to 10 MHz -#define CLK_SRC_ADC_FREQ 20000000 // CLK_SRC_ADC -#define CLK_ADC_FREQ 10000000 // CLK_ADC - 10 MHz max in normal mode #define NUMSAMPLES 6 -#define max(a, b) (a) > (b) ? (a) : (b) -#define min(a, b) (a) < (b) ? (a) : (b) - -#define calc_adc_pos(port, pin) \ - ((((port) * 16) + pin) + (unsigned int)iadcNegInputPortAPin0) -#define adc_mux_even(ref, adc, bus, index) \ - GPIO->bus ## BUSALLOC |= \ - GPIO_ ## bus ## BUSALLOC_ ## bus ## EVEN ## index ## _ ## adc; - // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- -static IADC_Init_t init = IADC_INIT_DEFAULT; -static IADC_AllConfigs_t initAllConfigs = IADC_ALLCONFIGS_DEFAULT; -static IADC_InitSingle_t initSingle = IADC_INITSINGLE_DEFAULT; -static IADC_SingleInput_t initSingleInput = IADC_SINGLEINPUT_DEFAULT; // ----------------------------------------------------------------------------- // Local Functions // ----------------------------------------------------------------------------- -/**************************************************************************//** - * Map range function. - *****************************************************************************/ -static int32_t map_range(int32_t x, - int32_t in_min, - int32_t in_max, - int32_t out_min, - int32_t out_max) -{ - float mapped = - (float)((int64_t)(x - in_min) * (int64_t)(out_max - out_min) - / (in_max - in_min) + out_min); - if (out_min <= out_max) { - return (int32_t)max(min(mapped, (float)out_max), (float)out_min); - } - return (int32_t)min(max(mapped, (float)out_max), (float)out_min); -} - /**************************************************************************//** * Insert sort function. *****************************************************************************/ @@ -109,291 +72,146 @@ static void insert_sort(int32_t *array, uint8_t size) } } -/***************************************************************************//** - * @brief - * Allocate bus for analog port. - * - * @param[in] handle - * ADC handle. - * @param[out] port_index - * Port value. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t allocate_analog_bus_even0(IADC_TypeDef *handle, - GPIO_Port_TypeDef port_index) -{ - GPIO->ABUSALLOC = 0; - GPIO->BBUSALLOC = 0; - GPIO->CDBUSALLOC = 0; - switch (port_index) { - case gpioPortA: -#if (IADC_COUNT == 1) - if (handle == IADC0) { - adc_mux_even(handle, ADC0, A, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (handle == IADC1) { - adc_mux_even(handle, ADC1, A, 0); - return ADC_SUCCESS; -#endif - } else { - return SL_STATUS_FAIL; - } - - case gpioPortB: -#if (IADC_COUNT == 1) - if (handle == IADC0) { - adc_mux_even(handle, ADC0, B, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (handle == IADC1) { - adc_mux_even(handle, ADC1, B, 0); - return ADC_SUCCESS; -#endif - } else { - return SL_STATUS_FAIL; - } - - case gpioPortC: - case gpioPortD: -#if (IADC_COUNT == 1) - if (handle == IADC0) { - adc_mux_even(handle, ADC0, CD, 0); - return SL_STATUS_OK; -#elif (IADC_COUNT == 2) - } else if (handle == IADC1) { - adc_mux_even(handle, ADC1, CD, 0); - return ADC_SUCCESS; -#endif - } else { - return SL_STATUS_FAIL; - } - - default: - return SL_STATUS_FAIL; - } -} - -/***************************************************************************//** - * @brief - * Pin configuration for analog reading. - * - * @param[in] handle - * ADC handle. - * @param[in] port - * Port value. - * @param[in] pin - * Pin value - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static void analog_start_read(IADC_TypeDef *handle, - GPIO_Port_TypeDef port, - uint8_t pin) -{ - allocate_analog_bus_even0(handle, port); - initSingleInput.posInput = IADC_portPinToPosInput(port, pin); - IADC_initSingle(IADC0, &initSingle, &initSingleInput); -} - -/***************************************************************************//** - * @brief - * Read ADC value from specified pin. - * - * @param[in] handle - * ADC handle. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static uint32_t analog_read(IADC_TypeDef *handle) -{ - IADC_command(handle, iadcCmdStartSingle); - // Wait for conversion to be complete - // while combined status bits 8 & 6 don't equal 1 and 0 respectively - while ((handle->STATUS & (_IADC_STATUS_CONVERTING_MASK - | _IADC_STATUS_SINGLEFIFODV_MASK)) - != IADC_STATUS_SINGLEFIFODV) {} - return IADC_pullSingleFifoResult(handle).data; -} - // ----------------------------------------------------------------------------- // Public Function // ----------------------------------------------------------------------------- /**************************************************************************//** - * Initialize Touch Screen feature for ILI9341 module. + * Initialize Touch Screen feature. *****************************************************************************/ -sl_status_t touch_screen_init(void) +sl_status_t touch_screen_init(struct touch_screen *ts) { - CMU_ClockEnable(cmuClock_IADC0, true); - CMU_ClockEnable(cmuClock_GPIO, true); - - // Use the FSRC0 as the IADC clock so it can run in EM2 - CMU_ClockSelectSet(cmuClock_IADCCLK, cmuSelect_FSRCO); - - // Set the prescaler needed for the intended IADC clock frequency - init.srcClkPrescale = IADC_calcSrcClkPrescale(IADC0, CLK_SRC_ADC_FREQ, 0); - - init.warmup = iadcWarmupNormal; - - initAllConfigs.configs[0].reference = iadcCfgReferenceVddx; - initAllConfigs.configs[0].vRef = 3300; - initAllConfigs.configs[0].osrHighSpeed = iadcCfgOsrHighSpeed2x; - initAllConfigs.configs[0].analogGain = iadcCfgAnalogGain1x; - initAllConfigs.configs[0].twosComplement = iadcCfgTwosCompUnipolar; - - initSingleInput.posInput = IADC_portPinToPosInput(XM_PORT, - XM_PIN); - - initSingleInput.negInput = iadcNegInputGnd; - - if (SL_STATUS_FAIL == allocate_analog_bus_even0(IADC0, - XM_PORT)) { - return SL_STATUS_FAIL; - } - - // Initialize IADC - IADC_init(IADC0, &init, &initAllConfigs); - - // Initialize IADC sing - IADC_initSingle(IADC0, &initSingle, &initSingleInput); + return touch_screen_interface_init(ts); +} - return SL_STATUS_OK; +/**************************************************************************//** + * Set config. + *****************************************************************************/ +void touch_screen_set_config(struct touch_screen *ts, + const struct touch_screen_config *config) +{ + ts->config = config; } /**************************************************************************//** * Get touch points whenever a touch is detected on the screen. *****************************************************************************/ -sl_status_t touch_screen_get_point(int rxplate, touch_point_t *ts_point) +sl_status_t touch_screen_read_touch(struct touch_screen *ts) { int32_t samples[NUMSAMPLES]; int32_t ts_data; int i; // XM = 0, XP = 1, YM & YP as input - GPIO_PinModeSet(XM_PORT, - XM_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(XP_PORT, - XP_PIN, - gpioModePushPull, - 1); - GPIO_PinModeSet(YM_PORT, - YM_PIN, - gpioModeInput, - 0); - GPIO_PinModeSet(YP_PORT, - YP_PIN, - gpioModeInput, - 0); + ts->aif->set_output(TOUCH_SCREEN_CHANNEL_XM, 0); + ts->aif->set_output(TOUCH_SCREEN_CHANNEL_XP, 1); + ts->aif->set_input(TOUCH_SCREEN_CHANNEL_YM); + ts->aif->set_input(TOUCH_SCREEN_CHANNEL_YP); // Fast ARM chips need to allow voltages to settle - sl_udelay_wait(20); + ts->aif->delay_10us(2); - analog_start_read(IADC0, - YP_PORT, - YP_PIN); + ts->aif->adc_start_read(TOUCH_SCREEN_CHANNEL_YP); for (i = 0; i < NUMSAMPLES; i++) { - samples[i] = analog_read(IADC0); + samples[i] = ts->aif->adc_read_u12(); } + ts->aif->adc_stop(); + insert_sort(samples, NUMSAMPLES); + ts_data = samples[NUMSAMPLES / 2]; + if (ts_data > 4095) { + return SL_STATUS_INVALID_RANGE; + } - ts_data = (4096 - samples[NUMSAMPLES / 2]); -#if CALIBRATION_PRINTF - app_log("\rx: %ld\n", ts_data); -#endif - ts_point->x = map_range(ts_data, - CALIB_X_MIN, - CALIB_X_MAX, - 0, - TOUCHSCREEN_WIDTH - 1); + ts->t_x = (4096 - ts_data); // YM = 0, YP = 1, XM & XP as input - GPIO_PinModeSet(YM_PORT, - YM_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(YP_PORT, - YP_PIN, - gpioModePushPull, - 1); - GPIO_PinModeSet(XM_PORT, - XM_PIN, - gpioModeInput, - 0); - GPIO_PinModeSet(XP_PORT, - XP_PIN, - gpioModeInput, - 0); + ts->aif->set_output(TOUCH_SCREEN_CHANNEL_YM, 0); + ts->aif->set_output(TOUCH_SCREEN_CHANNEL_YP, 1); + ts->aif->set_input(TOUCH_SCREEN_CHANNEL_XM); + ts->aif->set_input(TOUCH_SCREEN_CHANNEL_XP); // Fast ARM chips need to allow voltages to settle - sl_udelay_wait(20); + ts->aif->delay_10us(2); - analog_start_read(IADC0, - XM_PORT, - XM_PIN); + ts->aif->adc_start_read(TOUCH_SCREEN_CHANNEL_XM); for (i = 0; i < NUMSAMPLES; i++) { - samples[i] = analog_read(IADC0); + samples[i] = ts->aif->adc_read_u12(); } + ts->aif->adc_stop(); + insert_sort(samples, NUMSAMPLES); + ts_data = samples[NUMSAMPLES / 2]; + if (ts_data > 4095) { + return SL_STATUS_INVALID_RANGE; + } - ts_data = (4096 - samples[NUMSAMPLES / 2]); -#if CALIBRATION_PRINTF - app_log("\ry: %ld\n", ts_data); -#endif - ts_point->y = map_range(ts_data, - CALIB_Y_MIN, - CALIB_Y_MAX, - 0, - TOUCHSCREEN_HEIGHT - 1); + ts->t_y = (4096 - ts_data); // XP = 0, YM = 1, XM = Hi-Z& YP as input - GPIO_PinModeSet(XP_PORT, - XP_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(YM_PORT, - YM_PIN, - gpioModePushPull, - 1); - GPIO_PinModeSet(XM_PORT, - XM_PIN, - gpioModeInput, - 0); - GPIO_PinModeSet(YP_PORT, - YP_PIN, - gpioModeInput, - 0); - - if (rxplate != 0) { - analog_start_read(IADC0, - XM_PORT, - XM_PIN); - int32_t z1 = analog_read(IADC0); - - analog_start_read(IADC0, - YP_PORT, - YP_PIN); - int32_t z2 = analog_read(IADC0); - - // now read the x - float rtouch; - rtouch = z2; - rtouch /= z1; - rtouch -= 1; - rtouch *= ts_point->x; - rtouch *= rxplate; - rtouch /= 4096; - - ts_point->z = rtouch; + ts->aif->set_output(TOUCH_SCREEN_CHANNEL_XP, 0); + ts->aif->set_output(TOUCH_SCREEN_CHANNEL_YM, 1); + ts->aif->set_input(TOUCH_SCREEN_CHANNEL_XM); + ts->aif->set_input(TOUCH_SCREEN_CHANNEL_YP); + + ts->aif->adc_start_read(TOUCH_SCREEN_CHANNEL_XM); + ts->t_z1 = ts->aif->adc_read_u12(); + ts->aif->adc_stop(); + + ts->aif->adc_start_read(TOUCH_SCREEN_CHANNEL_YP); + ts->t_z2 = ts->aif->adc_read_u12(); + ts->aif->adc_stop(); + + return SL_STATUS_OK; +} + +sl_status_t touch_screen_get_point(struct touch_screen *ts, + touch_point_t *ts_point) +{ + float r_touch; + uint16_t x, y; + sl_status_t status; + + status = touch_screen_read_touch(ts); + if (SL_STATUS_OK != status) { + return status; + } + + if (ts->config->xy_swap) { + x = ts->t_y; + y = ts->t_x; + } else { + x = ts->t_x; + y = ts->t_y; } + + if (x > ts->config->x_min) { + x -= ts->config->x_min; + } else { + x = 0; + } + + if (y > ts->config->y_min) { + y -= ts->config->y_min; + } else { + y = 0; + } + + ts_point->x = (uint32_t)((uint32_t)x * ts->config->h_res) + / (ts->config->x_max - ts->config->x_min); + + ts_point->y = (uint32_t)((uint32_t)y * ts->config->v_res) + / (ts->config->y_max - ts->config->y_min); + + // now read the x + r_touch = ts->t_z2; + r_touch /= ts->t_z1; + r_touch -= 1; + r_touch *= ts->t_x; + r_touch *= ts->config->xplate_res; + r_touch /= 4096; + + ts_point->r_touch = r_touch; + return SL_STATUS_OK; } diff --git a/driver/public/silabs/services_touch_screen/src/touch_screen_gecko_s2.c b/driver/public/silabs/services_touch_screen/src/touch_screen_gecko_s2.c new file mode 100644 index 00000000..d2f32522 --- /dev/null +++ b/driver/public/silabs/services_touch_screen/src/touch_screen_gecko_s2.c @@ -0,0 +1,357 @@ +/***************************************************************************//** + * @file adafruit_ili9341_touch.h + * @brief Adafruit ILI9341 TFT LCD with Touchscreen Header File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include "em_cmu.h" +#include "em_gpio.h" +#include "em_iadc.h" +#include "sl_udelay.h" +#include "touch_screen.h" +#include "touch_screen_config.h" + +// ----------------------------------------------------------------------------- +// Macros +// ----------------------------------------------------------------------------- + +// Set CLK_ADC to 10 MHz +#define CLK_SRC_ADC_FREQ 20000000 // CLK_SRC_ADC +#define CLK_ADC_FREQ 10000000 // CLK_ADC - 10 MHz max in normal mode + +#define ADC_AVDD 3300 + +#define calc_adc_pos(port, pin) \ + ((((port) * 16) + pin) + (unsigned int)iadcNegInputPortAPin0) +#define adc_mux_even(ref, adc, bus, index) \ + GPIO->bus ## BUSALLOC |= \ + GPIO_ ## bus ## BUSALLOC_ ## bus ## EVEN ## index ## _ ## adc; + +// ----------------------------------------------------------------------------- +// Local Functions +// ----------------------------------------------------------------------------- +static void delay_10us(uint32_t idelay); +static void set_input(enum TOUCH_SCREEN_CHANNEL channel); +static void set_output(enum TOUCH_SCREEN_CHANNEL channel, uint8_t value); +static sl_status_t adc_start_read(enum TOUCH_SCREEN_CHANNEL channel); +static uint16_t adc_read_u12(void); +static void adc_stop(void); + +// ----------------------------------------------------------------------------- +// Local Variables +// ----------------------------------------------------------------------------- + +static const struct touch_screen_config touch_screen_config = +{ + .h_res = TOUCHSCREEN_HOR_RES, + .v_res = TOUCHSCREEN_VER_RES, + .xplate_res = TOUCHSCREEN_XPLATE_RES, + .x_min = TOUCHSCREEN_X_MIN, + .x_max = TOUCHSCREEN_X_MAX, + .y_min = TOUCHSCREEN_Y_MIN, + .y_max = TOUCHSCREEN_Y_MAX, + .x_inv = TOUCHSCREEN_X_INV, + .y_inv = TOUCHSCREEN_Y_INV, + .xy_swap = TOUCHSCREEN_XY_SWAP +}; + +static const struct touch_screen_analog_interface ts_analog_interface = { + .delay_10us = delay_10us, + .set_input = set_input, + .set_output = set_output, + .adc_start_read = adc_start_read, + .adc_read_u12 = adc_read_u12, + .adc_stop = adc_stop +}; + +// ----------------------------------------------------------------------------- +// Local Functions +// ----------------------------------------------------------------------------- + +static IADC_PosInput_t get_adc_aportx(GPIO_Port_TypeDef port, + unsigned int pin) +{ + if (pin > 15) { + return iadcPosInputGnd; + } + + switch (port) { + case gpioPortA: + return (IADC_PosInput_t)calc_adc_pos(0, pin); + + case gpioPortB: + return (IADC_PosInput_t)calc_adc_pos(1, pin); + + case gpioPortC: + return (IADC_PosInput_t)calc_adc_pos(2, pin); + + case gpioPortD: + return (IADC_PosInput_t)calc_adc_pos(3, pin); + + default: + return iadcPosInputGnd; + } +} + +static sl_status_t allocate_analog_bus_even0(GPIO_Port_TypeDef port) +{ + switch (port) { + case gpioPortA: + adc_mux_even(obj->handle, ADC0, A, 0); + return SL_STATUS_OK; + + case gpioPortB: + adc_mux_even(obj->handle, ADC0, B, 0); + return SL_STATUS_OK; + + case gpioPortC: + case gpioPortD: + adc_mux_even(obj->handle, ADC0, CD, 0); + return SL_STATUS_OK; + + default: + return SL_STATUS_INVALID_PARAMETER; + } +} + +static sl_status_t adc_init(GPIO_Port_TypeDef port, + unsigned int pin) +{ + // Declare initialization structures + IADC_Init_t init = IADC_INIT_DEFAULT; + IADC_AllConfigs_t initAllConfigs = IADC_ALLCONFIGS_DEFAULT; + IADC_InitSingle_t initSingle = IADC_INITSINGLE_DEFAULT; + + // Single input structure + IADC_SingleInput_t singleInput = IADC_SINGLEINPUT_DEFAULT; + + // Enable IADC register clock. + CMU_ClockEnable(cmuClock_IADC0, true); + + // Enable GPIO register clock. + CMU_ClockEnable(cmuClock_GPIO, true); + + // Use the FSRC0 as the IADC clock so it can run in EM2 + CMU_ClockSelectSet(cmuClock_IADCCLK, cmuSelect_FSRCO); + + // Set the prescaler needed for the intended IADC clock frequency + init.srcClkPrescale = + IADC_calcSrcClkPrescale(IADC0, CLK_SRC_ADC_FREQ, 0); + + // Shutdown between conversions to reduce current + init.warmup = iadcWarmupNormal; + + /* + * Configuration 0 is used by both scan and single conversions by + * default. Use internal bandgap as the reference and specify the + * reference voltage in mV. + */ + initAllConfigs.configs[0].reference = iadcCfgReferenceVddx; + initAllConfigs.configs[0].vRef = ADC_AVDD; + + /* + * Resolution is not configurable directly but is based on the + * selected oversampling ratio (osrHighSpeed), which defaults to + * 2x and generates 12-bit results. + */ + initAllConfigs.configs[0].osrHighSpeed = iadcCfgOsrHighSpeed2x; + initAllConfigs.configs[0].analogGain = iadcCfgAnalogGain1x; + + /* + * CLK_SRC_ADC must be prescaled by some value greater than 1 to + * derive the intended CLK_ADC frequency. + * + * Based on the default 2x oversampling rate (OSRHS)... + * + * conversion time = ((4 * OSRHS) + 2) / fCLK_ADC + * + * ...which results in a maximum sampling rate of 833 ksps with the + * 2-clock input multiplexer switching time is included. + */ + initAllConfigs.configs[0].adcClkPrescale = + IADC_calcAdcClkPrescale(IADC0, + CLK_ADC_FREQ, + 0, + iadcCfgModeNormal, + init.srcClkPrescale); + + /* + * Specify the input channel. When negInput = iadcNegInputGnd, the + * conversion is single-ended. + */ + singleInput.posInput = get_adc_aportx(port, pin); + if (singleInput.posInput == iadcPosInputGnd) { + return SL_STATUS_FAIL; + } + singleInput.negInput = iadcNegInputGnd; + + // Allocate the analog bus for ADC inputs + if (SL_STATUS_OK != allocate_analog_bus_even0(port)) { + return SL_STATUS_FAIL; + } + + // Initialize IADC + IADC_init(IADC0, &init, &initAllConfigs); + + // Initialize a single-channel conversion + IADC_initSingle(IADC0, &initSingle, &singleInput); + + return SL_STATUS_OK; +} + +static void adc_deinit(void) +{ + IADC_reset(IADC0); +} + +static uint16_t adc_read(void) +{ + IADC_command(IADC0, iadcCmdStartSingle); + // while combined status bits 8 & 6 don't equal 1 and 0 respectively) + while ((IADC_getStatus(IADC0) + & (_IADC_STATUS_CONVERTING_MASK | _IADC_STATUS_SINGLEFIFODV_MASK)) + != IADC_STATUS_SINGLEFIFODV) {} + return IADC_pullSingleFifoResult(IADC0).data; +} + +/******************************************************************************* + * Delay function for 10us + ******************************************************************************/ +static void delay_10us(uint32_t idelay) +{ + sl_udelay_wait(idelay * 10); +} + +static void set_input(enum TOUCH_SCREEN_CHANNEL channel) +{ + switch (channel) { + case TOUCH_SCREEN_CHANNEL_XM: + GPIO_PinModeSet(TOUCHSCREEN_XM_PORT, + TOUCHSCREEN_XM_PIN, + gpioModeInput, + 0); + break; + case TOUCH_SCREEN_CHANNEL_XP: + GPIO_PinModeSet(TOUCHSCREEN_XP_PORT, + TOUCHSCREEN_XP_PIN, + gpioModeInput, + 0); + break; + case TOUCH_SCREEN_CHANNEL_YM: + GPIO_PinModeSet(TOUCHSCREEN_YM_PORT, + TOUCHSCREEN_YM_PIN, + gpioModeInput, + 0); + break; + case TOUCH_SCREEN_CHANNEL_YP: + GPIO_PinModeSet(TOUCHSCREEN_YP_PORT, + TOUCHSCREEN_YP_PIN, + gpioModeInput, + 0); + break; + } +} + +static void set_output(enum TOUCH_SCREEN_CHANNEL channel, uint8_t value) +{ + switch (channel) { + case TOUCH_SCREEN_CHANNEL_XM: + GPIO_PinModeSet(TOUCHSCREEN_XM_PORT, + TOUCHSCREEN_XM_PIN, + gpioModePushPull, + value); + break; + case TOUCH_SCREEN_CHANNEL_XP: + GPIO_PinModeSet(TOUCHSCREEN_XP_PORT, + TOUCHSCREEN_XP_PIN, + gpioModePushPull, + value); + break; + case TOUCH_SCREEN_CHANNEL_YM: + GPIO_PinModeSet(TOUCHSCREEN_YM_PORT, + TOUCHSCREEN_YM_PIN, + gpioModePushPull, + value); + break; + case TOUCH_SCREEN_CHANNEL_YP: + GPIO_PinModeSet(TOUCHSCREEN_YP_PORT, + TOUCHSCREEN_YP_PIN, + gpioModePushPull, + value); + break; + } +} + +static sl_status_t adc_start_read(enum TOUCH_SCREEN_CHANNEL channel) +{ + if (TOUCH_SCREEN_CHANNEL_XM == channel) { + adc_init(TOUCHSCREEN_XM_PORT, + TOUCHSCREEN_XM_PIN); + } else if (TOUCH_SCREEN_CHANNEL_YP == channel) { + adc_init(TOUCHSCREEN_YP_PORT, + TOUCHSCREEN_YP_PIN); + } else { + return SL_STATUS_INVALID_PARAMETER; + } + + return SL_STATUS_OK; +} + +static uint16_t adc_read_u12(void) +{ + return adc_read(); +} + +static void adc_stop(void) +{ + adc_deinit(); +} + +// ----------------------------------------------------------------------------- +// Public Function +// ----------------------------------------------------------------------------- + +/**************************************************************************//** + * Initialize Touch Screen feature. + *****************************************************************************/ +sl_status_t touch_screen_interface_init(struct touch_screen *ts) +{ + ts->aif = &ts_analog_interface; + ts->config = &touch_screen_config; + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/services_touch_screen/src/touch_screen_si91x.c b/driver/public/silabs/services_touch_screen/src/touch_screen_si91x.c new file mode 100644 index 00000000..2a7c1531 --- /dev/null +++ b/driver/public/silabs/services_touch_screen/src/touch_screen_si91x.c @@ -0,0 +1,334 @@ +/***************************************************************************//** + * @file adafruit_ili9341_touch.h + * @brief Adafruit ILI9341 TFT LCD with Touchscreen Header File + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- +#include "sl_si91x_adc.h" +#include "gpio_helper_si91x.h" +#include "touch_screen.h" +#include "touch_screen_config.h" + +// ----------------------------------------------------------------------------- +// Macros +// ----------------------------------------------------------------------------- +#define DELAY_10US_COUNTER 46 // Delay count + +#define PS4_SOC_FREQ 180000000 /* Single channel data acquisition done. + * ADC_STATIC_MODE_CALLBACK => Static mode adc data + * acquisition done. + ******************************************************************************/ +static void callback_event(uint8_t channel_no, uint8_t event) +{ + (void) channel_no; + + switch (event) { + case SL_INTERNAL_DMA: + adc_complete = true; + break; + case SL_ADC_STATIC_MODE_EVENT: + adc_complete = true; + break; + } +} + +static sl_status_t adc_init(void) +{ + sl_status_t status; + + // Initialize ADC + status = sl_si91x_adc_init(adc_channel_config, + adc_config, + (float)3.3f); + if (SL_STATUS_OK != status) { + return status; + } + + // Register user callback function + status = sl_si91x_adc_register_event_callback(callback_event); + if (SL_STATUS_OK != status) { + return status; + } + + adc_complete = false; + + return SL_STATUS_OK; +} + +static sl_status_t adc_start(uint8_t pos_inp_sel) +{ + sl_status_t status; + + channel = adc_channel_config.channel; + adc_channel_config.pos_inp_sel[channel] = pos_inp_sel; + + status = sl_si91x_adc_configure_static_mode(adc_channel_config, channel); + if (SL_STATUS_OK != status) { + return status; + } + + // Configure ADC channel. + status = sl_si91x_adc_set_channel_configuration(adc_channel_config, + adc_config); + if (SL_STATUS_OK != status) { + return status; + } + + // Start the ADC conversion + status = sl_si91x_adc_start(adc_config); + if (SL_STATUS_OK != status) { + return status; + } + + return SL_STATUS_OK; +} + +static sl_status_t adc_read(uint16_t *data) +{ + sl_status_t status; + uint16_t adc_value; + + // Wait until ADC data acquisition done + while (!adc_complete) {} + adc_complete = false; + + status = sl_si91x_adc_read_data_static(adc_channel_config, + adc_config, + &adc_value); + + if (adc_value & AUXADC_DATA_TWELFTH) { + adc_value = (int16_t)(adc_value & (ADC_MASK_VALUE)); + } else { + adc_value = adc_value | AUXADC_DATA_TWELFTH; + } + *data = adc_value; + return status; +} + +/******************************************************************************* + * Delay function for 10us + ******************************************************************************/ +static void delay_10us(uint32_t idelay) +{ + for (uint32_t x = 0; x < DELAY_10US_COUNTER * idelay; x++) { + __NOP(); + } +} + +static void set_input(enum TOUCH_SCREEN_CHANNEL channel) +{ + switch (channel) { + case TOUCH_SCREEN_CHANNEL_XM: + si91x_ulp_gpio_pin_setup( + TOUCHSCREEN_XM_PIN, + SL_GPIO_MODE_0, + EGPIO_PIN_MUX_MODE7, + GPIO_INPUT, + 0); + break; + case TOUCH_SCREEN_CHANNEL_XP: + si91x_gpio_setup(TOUCHSCREEN_XP_PIN, + SL_GPIO_MODE_0, + GPIO_INPUT, + 0); + break; + case TOUCH_SCREEN_CHANNEL_YM: + si91x_gpio_setup(TOUCHSCREEN_YM_PIN, + SL_GPIO_MODE_0, + GPIO_INPUT, + 0); + break; + case TOUCH_SCREEN_CHANNEL_YP: + si91x_ulp_gpio_pin_setup( + TOUCHSCREEN_YP_PIN, + SL_GPIO_MODE_0, + EGPIO_PIN_MUX_MODE7, + GPIO_INPUT, + 0); + break; + } +} + +static void set_output(enum TOUCH_SCREEN_CHANNEL channel, uint8_t value) +{ + switch (channel) { + case TOUCH_SCREEN_CHANNEL_XM: + si91x_ulp_gpio_pin_setup( + TOUCHSCREEN_XM_PIN, + SL_GPIO_MODE_0, + EGPIO_PIN_MUX_MODE0, + GPIO_OUTPUT, + value); + break; + case TOUCH_SCREEN_CHANNEL_XP: + si91x_gpio_setup(TOUCHSCREEN_XP_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + value); + break; + case TOUCH_SCREEN_CHANNEL_YM: + si91x_gpio_setup(TOUCHSCREEN_YM_PIN, + SL_GPIO_MODE_0, + GPIO_OUTPUT, + value); + break; + case TOUCH_SCREEN_CHANNEL_YP: + si91x_ulp_gpio_pin_setup( + TOUCHSCREEN_YP_PIN, + SL_GPIO_MODE_0, + EGPIO_PIN_MUX_MODE0, + GPIO_OUTPUT, + value); + break; + } +} + +static sl_status_t adc_start_read(enum TOUCH_SCREEN_CHANNEL channel) +{ + if (TOUCH_SCREEN_CHANNEL_XM == channel) { + adc_start(TOUCHSCREEN_XM_POS_INPUT_CHNL_SEL); + } else if (TOUCH_SCREEN_CHANNEL_YP == channel) { + adc_start(TOUCHSCREEN_YP_POS_INPUT_CHNL_SEL); + } else { + return SL_STATUS_INVALID_PARAMETER; + } + return SL_STATUS_OK; +} + +static uint16_t adc_read_u12(void) +{ + uint16_t adc_value = 0; + + if (SL_STATUS_OK == adc_read(&adc_value)) { + return adc_value; + } + return 0; +} + +static void adc_stop(void) +{ + sl_si91x_adc_stop(adc_config); +} + +// ----------------------------------------------------------------------------- +// Public Function +// ----------------------------------------------------------------------------- + +/**************************************************************************//** + * Initialize Touch Screen feature. + *****************************************************************************/ +sl_status_t touch_screen_interface_init(struct touch_screen *ts) +{ + ts->aif = &touch_screen_analog_interface; + ts->config = &touch_screen_config; + adc_init(); + return SL_STATUS_OK; +} diff --git a/driver/public/silabs/soil_moisture/config/sparkfun_soil_moisture_config.h b/driver/public/silabs/soil_moisture/config/sparkfun_soil_moisture_config.h new file mode 100644 index 00000000..6b8422d0 --- /dev/null +++ b/driver/public/silabs/soil_moisture/config/sparkfun_soil_moisture_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file sparkfun_sgp40_config.h + * @brief sparkfun sgp40 configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SPARKFUN_SOIL_MOISTURE_CONFIG_H +#define SPARKFUN_SOIL_MOISTURE_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// SPARKFUN QWIIC JOYSTICK I2C Configuration + +// SPARKFUN QWIIC JOYSTICK I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPARKFUN_SOIL_MOISTURE_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPARKFUN_SOIL_MOISTURE_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // SPARKFUN_SOIL_MOISTURE_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/soil_moisture/inc/sparkfun_soil_moisture.h b/driver/public/silabs/soil_moisture/inc/sparkfun_soil_moisture.h index e1a2ebfc..83a54430 100644 --- a/driver/public/silabs/soil_moisture/inc/sparkfun_soil_moisture.h +++ b/driver/public/silabs/soil_moisture/inc/sparkfun_soil_moisture.h @@ -35,10 +35,8 @@ #ifndef SPARKFUN_SOIL_MOISTURE_H_ #define SPARKFUN_SOIL_MOISTURE_H_ -#include - -#include "sl_i2cspm.h" #include "sl_status.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -124,7 +122,8 @@ typedef struct { * @retval SL_STATUS_OK Success * @retval SL_STATUS_ALREADY_INITIALIZED Initialization is done before. ******************************************************************************/ -sl_status_t sparkfun_soil_moisture_init(sl_i2cspm_t *i2cspm, uint16_t address); +sl_status_t sparkfun_soil_moisture_init(mikroe_i2c_handle_t i2cspm, + uint16_t address); /***************************************************************************//** * @brief diff --git a/driver/public/silabs/soil_moisture/src/sparkfun_soil_moisture.c b/driver/public/silabs/soil_moisture/src/sparkfun_soil_moisture.c index 4233ab3e..8f3ccc23 100644 --- a/driver/public/silabs/soil_moisture/src/sparkfun_soil_moisture.c +++ b/driver/public/silabs/soil_moisture/src/sparkfun_soil_moisture.c @@ -36,16 +36,16 @@ // Includes // ----------------------------------------------------------------------------- +#include "sl_sleeptimer.h" #include "sparkfun_soil_moisture.h" +#include "sparkfun_soil_moisture_config.h" // ----------------------------------------------------------------------------- // Local Variables // ----------------------------------------------------------------------------- -static sl_i2cspm_t *sparkfun_soil_moisture_i2cspm_instance = NULL; -static uint16_t sparkfun_soil_moisture_i2c_addr = - SPARKFUN_SOIL_MOISTURE_DEFAULT_ADDR; static bool initialized = false; +static i2c_master_t soil_moisture_i2c; static sparkfun_soil_moisture_calibration_t calib = { .dry_value = 0, .wet_value = 1023, @@ -74,23 +74,46 @@ static sl_status_t sparkfun_soil_moisture_read_blocking(uint8_t *pdata, /**************************************************************************//** * Initialize the sparkfun soil moisture sensor. *****************************************************************************/ -sl_status_t sparkfun_soil_moisture_init(sl_i2cspm_t *i2cspm, uint16_t address) +sl_status_t sparkfun_soil_moisture_init(mikroe_i2c_handle_t i2cspm, + uint16_t address) { if (initialized) { return SL_STATUS_ALREADY_INITIALIZED; } + if (i2cspm == NULL) { return SL_STATUS_NULL_POINTER; } + if ((address < 0x07) | (address > 0x78)) { return SL_STATUS_INVALID_PARAMETER; } - sparkfun_soil_moisture_i2cspm_instance = i2cspm; - if (!sparkfun_soil_moisture_is_present(address)) { + + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = address; + soil_moisture_i2c.handle = i2cspm; + +#if (SPARKFUN_SOIL_MOISTURE_I2C_UC == 1) + i2c_cfg.speed = SPARKFUN_SOIL_MOISTURE_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&soil_moisture_i2c, &i2c_cfg) == I2C_MASTER_ERROR) { return SL_STATUS_INITIALIZATION; } - sparkfun_soil_moisture_i2c_addr = address; + + i2c_master_set_speed(&soil_moisture_i2c, i2c_cfg.speed); + i2c_master_set_timeout(&soil_moisture_i2c, 0); + + // Wait for sensor to become ready + sl_sleeptimer_delay_millisecond(100); + if (!sparkfun_soil_moisture_is_present(address)) { + return SL_STATUS_NOT_AVAILABLE; + } + initialized = true; + return SL_STATUS_OK; } @@ -100,17 +123,21 @@ sl_status_t sparkfun_soil_moisture_init(sl_i2cspm_t *i2cspm, uint16_t address) bool sparkfun_soil_moisture_is_present(uint16_t address) { sl_status_t sc; - uint16_t backup_addr; - - backup_addr = sparkfun_soil_moisture_i2c_addr; - sparkfun_soil_moisture_i2c_addr = address; - sc = sparkfun_soil_moisture_write_blocking(NULL, 0); - sparkfun_soil_moisture_i2c_addr = backup_addr; - if (sc == SL_STATUS_OK) { - return true; - } else { + uint8_t backup_addr; + uint8_t data[2]; + + // Back up the current i2c addr + backup_addr = soil_moisture_i2c.config.addr; + // Use special addr to check + i2c_master_set_slave_address(&soil_moisture_i2c, address); + sc = sparkfun_soil_moisture_read_blocking(data, 2); + // Restore to the backed up i2c addr + i2c_master_set_slave_address(&soil_moisture_i2c, backup_addr); + if (sc != SL_STATUS_OK) { return false; } + + return true; } /**************************************************************************//** @@ -128,10 +155,12 @@ sl_status_t sparkfun_soil_moisture_set_address(uint16_t address) send_data[1] = (uint8_t)address; sc = sparkfun_soil_moisture_write_blocking(send_data, 2); - if (sc == SL_STATUS_OK) { - sparkfun_soil_moisture_i2c_addr = address; + if (sc != SL_STATUS_OK) { + return sc; } - return sc; + + i2c_master_set_slave_address(&soil_moisture_i2c, address); + return SL_STATUS_OK; } /**************************************************************************//** @@ -140,28 +169,19 @@ sl_status_t sparkfun_soil_moisture_set_address(uint16_t address) sl_status_t sparkfun_soil_moisture_scan_address(uint16_t *address, uint8_t *num_dev) { - uint16_t backup_addr; - sl_status_t sc; *num_dev = 0; if ((address == NULL) || (num_dev == NULL)) { return SL_STATUS_NULL_POINTER; } - // Back up current address before scanning - backup_addr = sparkfun_soil_moisture_i2c_addr; - - for (uint16_t addr = 0x08; addr < 0x78; addr++) { - sparkfun_soil_moisture_i2c_addr = addr; - sc = sparkfun_soil_moisture_write_blocking(NULL, 0); - if (sc == SL_STATUS_OK) { + for (uint8_t addr = 0x08; addr < 0x78; addr++) { + if (sparkfun_soil_moisture_is_present(addr)) { *(address + *num_dev) = addr; (*num_dev)++; } } - // Restore the back up address - sparkfun_soil_moisture_i2c_addr = backup_addr; return SL_STATUS_OK; } @@ -173,7 +193,9 @@ sl_status_t sparkfun_soil_moisture_select_device(uint16_t address) if ((address < 0x07) || (address > 0x78)) { return SL_STATUS_INVALID_PARAMETER; } - sparkfun_soil_moisture_i2c_addr = address; + + i2c_master_set_slave_address(&soil_moisture_i2c, address); + return SL_STATUS_OK; } @@ -182,7 +204,7 @@ sl_status_t sparkfun_soil_moisture_select_device(uint16_t address) *****************************************************************************/ uint16_t sparkfun_soil_moisture_get_device_address(void) { - return sparkfun_soil_moisture_i2c_addr; + return soil_moisture_i2c.config.addr; } /**************************************************************************//** @@ -314,18 +336,13 @@ sl_status_t sparkfun_soil_moisture_get_moisture_raw(uint16_t *value) static sl_status_t sparkfun_soil_moisture_write_blocking(uint8_t *pdata, uint8_t len) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; - - seq.addr = sparkfun_soil_moisture_i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE; - - seq.buf[0].data = pdata; - seq.buf[0].len = len; - - ret = I2CSPM_Transfer(sparkfun_soil_moisture_i2cspm_instance, &seq); + if (I2C_MASTER_SUCCESS != i2c_master_write(&soil_moisture_i2c, + pdata, + len)) { + return SL_STATUS_TRANSMIT; + } - return ret; + return SL_STATUS_OK; } /***************************************************************************//** @@ -346,23 +363,15 @@ static sl_status_t sparkfun_soil_moisture_write_blocking(uint8_t *pdata, static sl_status_t sparkfun_soil_moisture_read_blocking(uint8_t *pdata, uint8_t len) { - I2C_TransferSeq_TypeDef seq; - I2C_TransferReturn_TypeDef ret; uint8_t send_data = GET_VALUE; - if (pdata == NULL) { - return SL_STATUS_NULL_POINTER; + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&soil_moisture_i2c, + &send_data, + 1, + pdata, + len)) { + return SL_STATUS_TRANSMIT; } - seq.addr = sparkfun_soil_moisture_i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE_READ; - seq.buf[0].data = &send_data; - seq.buf[0].len = 1; - - seq.buf[1].data = pdata; - seq.buf[1].len = len; - - ret = I2CSPM_Transfer(sparkfun_soil_moisture_i2cspm_instance, &seq); - - return ret; + return SL_STATUS_OK; } diff --git a/driver/public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h b/driver/public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h index 10079fc3..88aafd75 100644 --- a/driver/public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h +++ b/driver/public/silabs/sparkfun_6dof_imu_bmi270/config/sparkfun_bmi270_config.h @@ -46,12 +46,12 @@ extern "C" { // <<< Use Configuration Wizard in Context Menu >>> -//SPARKFUN BMI270 I2C Configuration +// SPARKFUN BMI270 I2C Configuration -// SPARKFUN BMI270 I2C UC Configuration -// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). -// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. -// Default: 0 +// SPARKFUN BMI270 I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 #define SPARKFUN_BMI270_I2C_UC 0 // Speed mode diff --git a/driver/public/silabs/spectroscopy_as7265x/config/spectroscopy_as7265x_config.h b/driver/public/silabs/spectroscopy_as7265x/config/spectroscopy_as7265x_config.h new file mode 100644 index 00000000..cb7a8c36 --- /dev/null +++ b/driver/public/silabs/spectroscopy_as7265x/config/spectroscopy_as7265x_config.h @@ -0,0 +1,71 @@ + +/***************************************************************************/ /** + * @file spectroscopy_as7265x_config.h + * @brief spectroscopy as7265x configuration + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ + +#ifndef SPECTROSCOPY_AS7265X_CONFIG_H +#define SPECTROSCOPY_AS7265X_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +//SPECTROSCOPY AS7265X I2C Configuration + +// SPECTROSCOPY AS7265X I2C UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the default API to modify the peripheral configuration. +// Default: 0 +#define SPECTROSCOPY_AS7265X_I2C_UC 0 + +// Speed mode +// <0=> Standard mode (100kbit/s) +// <1=> Fast mode (400kbit/s) +// <2=> Fast mode plus (1Mbit/s) +// Default: 0 +#define SPECTROSCOPY_AS7265X_I2C_SPEED_MODE 0 + +// +// +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif // SPECTROSCOPY_AS7265X_CONFIG_H \ No newline at end of file diff --git a/driver/public/silabs/spectroscopy_as7265x/inc/sparkfun_as7265x.h b/driver/public/silabs/spectroscopy_as7265x/inc/sparkfun_as7265x.h index 00318dc8..6950572b 100644 --- a/driver/public/silabs/spectroscopy_as7265x/inc/sparkfun_as7265x.h +++ b/driver/public/silabs/spectroscopy_as7265x/inc/sparkfun_as7265x.h @@ -41,7 +41,8 @@ #define SPARKFUN_AS7265X_H_ #include "sl_status.h" -#include "sl_i2cspm.h" +#include "sl_sleeptimer.h" +#include "drv_i2c_master.h" #ifdef __cplusplus extern "C" { @@ -49,6 +50,18 @@ extern "C" { /** @defgroup as7265x AS7265X Driver API*/ +#define SPARKFUN_AS7265X_ADDR 0x49 // Device I2C address + +// Gets current tick count. +#define sparkfun_as7265x_get_tick_count() sl_sleeptimer_get_tick_count64() + +// Gets current millisecond count. +#define sparkfun_as7265x_get_ms() \ + sl_sleeptimer_tick_to_ms(sl_sleeptimer_get_tick_count64()) + +// Delay 'ms' milliseconds +#define sparkfun_as7265x_delay_ms(ms) sl_sleeptimer_delay_millisecond(ms) + /***************************************************************************//** * @addtogroup as7265x * @brief AS7265X Driver API @@ -511,7 +524,7 @@ sl_status_t sparkfun_as7265x_get_device_type(uint8_t *dev_type); * @return * sl_status_t SL_STATUS_OK on success or SL_STATUS_FAIL on failure. ******************************************************************************/ -sl_status_t sparkfun_as7265x_init(sl_i2cspm_t *i2cspm); +sl_status_t sparkfun_as7265x_init(mikroe_i2c_handle_t i2cspm); /** @} (end addtogroup as7265x) */ @@ -519,4 +532,4 @@ sl_status_t sparkfun_as7265x_init(sl_i2cspm_t *i2cspm); } #endif -#endif /* SPARKFUN_AS7265X_H_ */ +#endif // SPARKFUN_AS7265X_H_ diff --git a/driver/public/silabs/spectroscopy_as7265x/inc/sparkfun_as7265x_platform.h b/driver/public/silabs/spectroscopy_as7265x/inc/sparkfun_as7265x_platform.h deleted file mode 100644 index baad0129..00000000 --- a/driver/public/silabs/spectroscopy_as7265x/inc/sparkfun_as7265x_platform.h +++ /dev/null @@ -1,123 +0,0 @@ -/***************************************************************************//** - * @file sparkfun_as7265x_platform.h - * @brief AS7265X Platform Header File. - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software.s - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ - -/** - * @file sparkfun_as7265x_platform.h - * @brief Those platform functions are platform dependent and have - * to be implemented for the integrated platform. - */ - -#ifndef _SPARKFUN_AS7265X_PLATFORM_H_ -#define _SPARKFUN_AS7265X_PLATFORM_H_ - -#include -#include "sl_status.h" -#include "sl_i2cspm.h" -#include "sl_sleeptimer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @defgroup as7265x_platform AS7265X Driver Platform */ - -/***************************************************************************//** - * @addtogroup as7265x_platform - * @brief AS7265X Driver Platform - * @details - * @{ - ******************************************************************************/ - -#define SPARKFUN_AS7265X_ADDR 0x49 // Device I2C address - -// Gets current tick count. -#define sparkfun_as7265x_get_tick_count() sl_sleeptimer_get_tick_count() - -// Gets current millisecond count. -#define sparkfun_as7265x_get_ms() \ - sl_sleeptimer_tick_to_ms(sl_sleeptimer_get_tick_count()) - -// Delay 'ms' milliseconds -#define sparkfun_as7265x_delay_ms(ms) sl_sleeptimer_delay_millisecond(ms) - -// Delay 'us' microseconds -#define sparkfun_as7265x_delay_us(us) sl_udelay_wait(us) - -/***************************************************************************//** - * @brief - * This function is used to read a register. - * - * @param[in] dev - * I2C address, default: SPARKFUN_AS. - * @param[in] addr - * Address of register. - * @param[out] pdata - * Pointer of output value. - * - * @return sl_status_t SL_STATUS_OK on success or SL_STATUS_TRANSMIT on failure. - * - ******************************************************************************/ -sl_status_t sparkfun_as7265x_platform_read_register(uint8_t dev, - uint8_t addr, - uint8_t *pdata); - -/***************************************************************************//** - * @brief - * This function is used to read a register. - * - * @param[in] dev - * I2C address, default: SPARKFUN_AS7265X_ADDR. - * @param[in] addr - * Address of register. - * @param[out] pdata - * Pointer of output value. - * - * @return sl_status_t SL_STATUS_OK on success or SL_STATUS_TRANSMIT on failure. - * - ******************************************************************************/ -sl_status_t sparkfun_as7265x_platform_write_register(uint8_t dev, - uint8_t addr, - uint8_t data); - -/** @} (end addtogroup as7265x_platform) */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/driver/public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x.c b/driver/public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x.c index f0a7899d..1b587bc3 100644 --- a/driver/public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x.c +++ b/driver/public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x.c @@ -38,11 +38,7 @@ #include "string.h" #include "sparkfun_as7265x.h" -#include "sparkfun_as7265x_platform.h" - -#ifdef __cplusplus -extern "C" { -#endif +#include "spectroscopy_as7265x_config.h" // I2C physical registers. #define STATUS_REG 0x00 @@ -96,8 +92,6 @@ extern "C" { // Default integration cycles. #define DEFAULT_INTEGRATION_CYCLE 20 -sl_i2cspm_t *sparkfun_as7265x_i2cpsm_instance = NULL; - // Raw data channel register array. static const uint8_t channel_register[6] = { R_G_A_REG, S_H_B_REG, T_I_C_REG, U_J_D_REG, V_K_E_REG, W_L_F_REG }; @@ -115,6 +109,8 @@ static const uint8_t device_type[3] = { SPARKFUN_AS72653_UV, // Max wait time static uint32_t max_wait_time; +static i2c_master_t as7265_i2c_master; + // Virtual register function static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata); static sl_status_t write_virtual_register(uint8_t virtual_addr, uint8_t data); @@ -132,10 +128,45 @@ static sl_status_t get_calibrated_value(uint8_t cal_address, sparkfun_as7265x_device_type_t device, float *cal_val); +/***************************************************************************//** +* Read register value +*******************************************************************************/ +static sl_status_t sparkfun_as7265x_platform_read_register(uint8_t addr, + uint8_t *pdata) +{ + if ((pdata == NULL) || (as7265_i2c_master.handle == NULL)) { + return SL_STATUS_INVALID_PARAMETER; + } else { + if (I2C_MASTER_SUCCESS != i2c_master_write_then_read(&as7265_i2c_master, + &addr, + 1, + pdata, + 1)) { + return SL_STATUS_TRANSMIT; + } + } + return SL_STATUS_OK; +} + +/***************************************************************************//** +* Write into register +*******************************************************************************/ +static sl_status_t sparkfun_as7265x_platform_write_register(uint8_t addr, + uint8_t data) +{ + uint8_t i2c_write_data[2] = { addr, data }; + if (I2C_MASTER_SUCCESS != i2c_master_write(&as7265_i2c_master, + i2c_write_data, + 2)) { + return SL_STATUS_TRANSMIT; + } + return SL_STATUS_OK; +} + /***************************************************************************//** * Initialize as7265x sensor *******************************************************************************/ -sl_status_t sparkfun_as7265x_init(sl_i2cspm_t *i2cspm) +sl_status_t sparkfun_as7265x_init(mikroe_i2c_handle_t i2cspm) { uint8_t value = 0; sl_status_t sc = SL_STATUS_OK; @@ -145,7 +176,23 @@ sl_status_t sparkfun_as7265x_init(sl_i2cspm_t *i2cspm) } // Update i2cspm instance - sparkfun_as7265x_i2cpsm_instance = i2cspm; + i2c_master_config_t i2c_cfg; + i2c_master_configure_default(&i2c_cfg); + + i2c_cfg.addr = SPARKFUN_AS7265X_ADDR; + + as7265_i2c_master.handle = i2cspm; + +#if (SPECTROSCOPY_AS7265X_I2C_UC == 1) + i2c_cfg.speed = SPECTROSCOPY_AS7265X_I2C_SPEED_MODE; +#endif + + if (i2c_master_open(&as7265_i2c_master, &i2c_cfg) == I2C_MASTER_ERROR) { + return SL_STATUS_INITIALIZATION; + } + + i2c_master_set_speed(&as7265_i2c_master, i2c_cfg.speed); + i2c_master_set_timeout(&as7265_i2c_master, 0); // Init default max wait time. max_wait_time = (uint32_t)(DEFAULT_INTEGRATION_CYCLE * 2 * 2.8 * 2); @@ -468,11 +515,6 @@ sl_status_t sparkfun_as7265x_set_measurement_mode( sc |= read_virtual_register(INTERGRATION_TIME_REG, &value); - if ((mode == SPARKFUN_AS7265X_MEASUREMENT_MODE_6CHAN_CONTINUOUS) - || (mode == SPARKFUN_AS7265X_MEASUREMENT_MODE_6CHAN_ONE_SHOT)) { - max_wait_time = value * 2.8 * 2 * 2; - } - if (sc != SL_STATUS_OK) { return SL_STATUS_FAIL; } @@ -525,15 +567,6 @@ sl_status_t sparkfun_as7265x_set_integration_cycles(uint8_t cycle_value) mode &= 0b00001100; mode >>= 2; - if ((mode == SPARKFUN_AS7265X_MEASUREMENT_MODE_6CHAN_CONTINUOUS) - || (mode == SPARKFUN_AS7265X_MEASUREMENT_MODE_6CHAN_ONE_SHOT)) { - // Wait for integration time * 2 + 100% - max_wait_time = (uint32_t)(cycle_value * 2 * 2.8 * 2); - } else { - // Wait for integration time + 100% - max_wait_time = (uint32_t)(cycle_value * 2.8 * 2); - } - // Write return write_virtual_register(INTERGRATION_TIME_REG, cycle_value); } @@ -906,8 +939,7 @@ static sl_status_t write_virtual_register(uint8_t virtual_addr, uint8_t data) // Sensor failed to respond return SL_STATUS_TIMEOUT; } - sc = sparkfun_as7265x_platform_read_register(SPARKFUN_AS7265X_ADDR, - STATUS_REG, + sc = sparkfun_as7265x_platform_read_register(STATUS_REG, &status); if (sc != SL_STATUS_OK) { return SL_STATUS_FAIL; @@ -921,8 +953,7 @@ static sl_status_t write_virtual_register(uint8_t virtual_addr, uint8_t data) // Send the virtual register address (setting bit 7 to indicate we are writing // to a register). - sc = sparkfun_as7265x_platform_write_register(SPARKFUN_AS7265X_ADDR, - WRITE_REG, + sc = sparkfun_as7265x_platform_write_register(WRITE_REG, (virtual_addr | 1 << 7)); if (sc != SL_STATUS_OK) { @@ -939,8 +970,7 @@ static sl_status_t write_virtual_register(uint8_t virtual_addr, uint8_t data) return SL_STATUS_TIMEOUT; } - sc = sparkfun_as7265x_platform_read_register(SPARKFUN_AS7265X_ADDR, - STATUS_REG, + sc = sparkfun_as7265x_platform_read_register(STATUS_REG, &status); if (sc != SL_STATUS_OK) { @@ -955,8 +985,7 @@ static sl_status_t write_virtual_register(uint8_t virtual_addr, uint8_t data) } // Send the data to complete the operation. - sc = sparkfun_as7265x_platform_write_register(SPARKFUN_AS7265X_ADDR, - WRITE_REG, + sc = sparkfun_as7265x_platform_write_register(WRITE_REG, data); if (sc != SL_STATUS_OK) { @@ -976,8 +1005,7 @@ static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata) uint32_t start_time = 0; // Do a prelim check of the read register - sc = sparkfun_as7265x_platform_read_register(SPARKFUN_AS7265X_ADDR, - STATUS_REG, + sc = sparkfun_as7265x_platform_read_register(STATUS_REG, &status); if (sc != SL_STATUS_OK) { @@ -986,8 +1014,7 @@ static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata) if ((status & RX_VALID) != 0) { // There is data to be read. Read the byte but do nothing with it - sc = sparkfun_as7265x_platform_read_register(SPARKFUN_AS7265X_ADDR, - READ_REG, + sc = sparkfun_as7265x_platform_read_register(READ_REG, &data); if (sc != SL_STATUS_OK) { return SL_STATUS_FAIL; @@ -1003,8 +1030,7 @@ static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata) // Sensor failed to respond return SL_STATUS_TIMEOUT; } - sc = sparkfun_as7265x_platform_read_register(SPARKFUN_AS7265X_ADDR, - STATUS_REG, + sc = sparkfun_as7265x_platform_read_register(STATUS_REG, &status); if (sc != SL_STATUS_OK) { return SL_STATUS_FAIL; @@ -1018,8 +1044,7 @@ static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata) // Send the virtual register address (bit 7 should be 0 to indicate we are // reading a register). - sc = sparkfun_as7265x_platform_write_register(SPARKFUN_AS7265X_ADDR, - WRITE_REG, + sc = sparkfun_as7265x_platform_write_register(WRITE_REG, virtual_addr); // Wait for READ flag to be set @@ -1033,8 +1058,7 @@ static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata) return SL_STATUS_TIMEOUT; } - sc = sparkfun_as7265x_platform_read_register(SPARKFUN_AS7265X_ADDR, - STATUS_REG, + sc = sparkfun_as7265x_platform_read_register(STATUS_REG, &status); if (sc != SL_STATUS_OK) { @@ -1049,8 +1073,7 @@ static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata) sparkfun_as7265x_delay_ms(POLLING_DELAY); } - sc = sparkfun_as7265x_platform_read_register(SPARKFUN_AS7265X_ADDR, - READ_REG, + sc = sparkfun_as7265x_platform_read_register(READ_REG, pdata); if (sc != SL_STATUS_OK) { @@ -1058,7 +1081,3 @@ static sl_status_t read_virtual_register(uint8_t virtual_addr, uint8_t *pdata) } return SL_STATUS_OK; } - -#ifdef __cplusplus -} -#endif diff --git a/driver/public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x_platform.c b/driver/public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x_platform.c deleted file mode 100644 index ea8a95b9..00000000 --- a/driver/public/silabs/spectroscopy_as7265x/src/sparkfun_as7265x_platform.c +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************//** - * @file sparkfun_as7265x_platform.c - * @brief AS7265X Platform Source Code File. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ - -#include -#include "sparkfun_as7265x_platform.h" - -extern sl_i2cspm_t *sparkfun_as7265x_i2cpsm_instance; - -/***************************************************************************//** -* Read register value -*******************************************************************************/ -sl_status_t sparkfun_as7265x_platform_read_register(uint8_t i2c_addr, - uint8_t addr, - uint8_t *pdata) -{ - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data; - - if ((pdata == NULL) || (sparkfun_as7265x_i2cpsm_instance == NULL)) { - return SL_STATUS_INVALID_PARAMETER; - } else { - seq.addr = i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE_READ; - - i2c_write_data = addr; - - /*Write buffer*/ - seq.buf[0].data = &i2c_write_data; - seq.buf[0].len = 1; - - /*Read buffer*/ - seq.buf[1].data = pdata; - seq.buf[1].len = 1; - - if (I2CSPM_Transfer(sparkfun_as7265x_i2cpsm_instance, - &seq) != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - return SL_STATUS_OK; - } -} - -/***************************************************************************//** -* Write into register -*******************************************************************************/ -sl_status_t sparkfun_as7265x_platform_write_register(uint8_t i2c_addr, - uint8_t addr, - uint8_t data) -{ - I2C_TransferSeq_TypeDef seq; - uint8_t i2c_write_data[2]; - - if (sparkfun_as7265x_i2cpsm_instance == NULL) { - return SL_STATUS_INVALID_PARAMETER; - } - seq.addr = i2c_addr << 1; - seq.flags = I2C_FLAG_WRITE; - - i2c_write_data[0] = addr; - i2c_write_data[1] = data; - - /*Write buffer*/ - seq.buf[0].data = i2c_write_data; - seq.buf[0].len = 2; - - if (I2CSPM_Transfer(sparkfun_as7265x_i2cpsm_instance, - &seq) != i2cTransferDone) { - return SL_STATUS_TRANSMIT; - } - return SL_STATUS_OK; -} diff --git a/driver/public/silabs/stepper_a3967/config/brd2703a/mikroe_a3967_config.h b/driver/public/silabs/stepper_a3967/config/brd2703a/mikroe_a3967_config.h index 3dc7fb67..6d4ff1e3 100644 --- a/driver/public/silabs/stepper_a3967/config/brd2703a/mikroe_a3967_config.h +++ b/driver/public/silabs/stepper_a3967/config/brd2703a/mikroe_a3967_config.h @@ -39,16 +39,17 @@ #ifndef MIKROE_A3967_CONFIG_H_ #define MIKROE_A3967_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu // Stepper Motor Step Frequency // Default: 500 -#define MIKROE_A3967_STEP_FREQUENCY 500 +#define MIKROE_A3967_STEP_FREQUENCY 500 // end Stepper Motor config // <<< end of configuration section >>> diff --git a/driver/public/silabs/stepper_a3967/config/brd4108a/mikroe_a3967_config.h b/driver/public/silabs/stepper_a3967/config/brd4108a/mikroe_a3967_config.h index 711f597a..a0da2661 100644 --- a/driver/public/silabs/stepper_a3967/config/brd4108a/mikroe_a3967_config.h +++ b/driver/public/silabs/stepper_a3967/config/brd4108a/mikroe_a3967_config.h @@ -39,16 +39,17 @@ #ifndef MIKROE_A3967_CONFIG_H_ #define MIKROE_A3967_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu // Stepper Motor Step Frequency // Default: 500 -#define MIKROE_A3967_STEP_FREQUENCY 500 +#define MIKROE_A3967_STEP_FREQUENCY 500 // end Stepper Motor config // <<< end of configuration section >>> diff --git a/driver/public/silabs/stepper_a3967/config/brd4314a/mikroe_a3967_config.h b/driver/public/silabs/stepper_a3967/config/brd4314a/mikroe_a3967_config.h index 711f597a..a0da2661 100644 --- a/driver/public/silabs/stepper_a3967/config/brd4314a/mikroe_a3967_config.h +++ b/driver/public/silabs/stepper_a3967/config/brd4314a/mikroe_a3967_config.h @@ -39,16 +39,17 @@ #ifndef MIKROE_A3967_CONFIG_H_ #define MIKROE_A3967_CONFIG_H_ +#include "em_gpio.h" + #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu // Stepper Motor Step Frequency // Default: 500 -#define MIKROE_A3967_STEP_FREQUENCY 500 +#define MIKROE_A3967_STEP_FREQUENCY 500 // end Stepper Motor config // <<< end of configuration section >>> diff --git a/driver/public/silabs/stepper_a3967/config/brd4338a/mikroe_a3967_config.h b/driver/public/silabs/stepper_a3967/config/brd4338a/mikroe_a3967_config.h new file mode 100644 index 00000000..11843384 --- /dev/null +++ b/driver/public/silabs/stepper_a3967/config/brd4338a/mikroe_a3967_config.h @@ -0,0 +1,87 @@ +/***************************************************************************//** + * @file mikroe_a3967_config.h + * @brief Stepper motor driver configuration. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef MIKROE_A3967_CONFIG_H_ +#define MIKROE_A3967_CONFIG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu + +// Stepper Motor Step Frequency +// Default: 500 +#define MIKROE_A3967_STEP_FREQUENCY 500 +// end Stepper Motor config + +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// MIKROE_A3967_STEP +// $[GPIO_MIKROE_A3967_STEP] +#define MIKROE_A3967_STEP_PORT HP +#define MIKROE_A3967_STEP_PIN 46 +// [GPIO_MIKROE_A3967_STEP]$ + +// MIKROE_A3967_DIR +// $[GPIO_MIKROE_A3967_DIR] +#define MIKROE_A3967_DIR_PORT HP +#define MIKROE_A3967_DIR_PIN 47 +// [GPIO_MIKROE_A3967_DIR]$ + +// MIKROE_A3967_MS1 +// $[GPIO_MIKROE_A3967_MS1] +#define MIKROE_A3967_MS1_PORT HP +#define MIKROE_A3967_MS1_PIN 48 +// [GPIO_MIKROE_A3967_MS1]$ + +// MIKROE_A3967_MS2 +// $[GPIO_MIKROE_A3967_MS2] +#define MIKROE_A3967_MS2_PORT HP +#define MIKROE_A3967_MS2_PIN 49 +// [GPIO_MIKROE_A3967_MS2]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif + +#endif /* MIKROE_A3967_CONFIG_H_ */ diff --git a/driver/public/silabs/stepper_a3967/config/other/mikroe_a3967_config.h b/driver/public/silabs/stepper_a3967/config/other/mikroe_a3967_config.h index 4131c9c3..18084feb 100644 --- a/driver/public/silabs/stepper_a3967/config/other/mikroe_a3967_config.h +++ b/driver/public/silabs/stepper_a3967/config/other/mikroe_a3967_config.h @@ -39,16 +39,19 @@ #ifndef MIKROE_A3967_CONFIG_H_ #define MIKROE_A3967_CONFIG_H_ +#ifndef SLI_SI917 +#include "em_gpio.h" +#endif + #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif // <<< Use Configuration Wizard in Context Menu // Stepper Motor Step Frequency // Default: 500 -#define MIKROE_A3967_STEP_FREQUENCY 500 +#define MIKROE_A3967_STEP_FREQUENCY 500 // end Stepper Motor config // <<< end of configuration section >>> diff --git a/driver/public/silabs/stepper_a3967/inc/mikroe_a3967.h b/driver/public/silabs/stepper_a3967/inc/mikroe_a3967.h index baf0bd7e..045da38e 100644 --- a/driver/public/silabs/stepper_a3967/inc/mikroe_a3967.h +++ b/driver/public/silabs/stepper_a3967/inc/mikroe_a3967.h @@ -43,6 +43,10 @@ #include #include "sl_status.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MIKROE_A3967_STEP_MIN_FREQUENCY 1 #define MIKROE_A3967_STEP_MAX_FREQUENCY 500000 @@ -166,4 +170,7 @@ bool mikroe_a3967_get_state(void); ******************************************************************************/ sl_status_t mikroe_a3967_step(uint16_t step); -#endif /* MIKROE_A3967_H_ */ +#ifdef __cplusplus +} +#endif +#endif // MIKROE_A3967_H_ diff --git a/driver/public/silabs/stepper_a3967/src/mikroe_a3967.c b/driver/public/silabs/stepper_a3967/src/mikroe_a3967.c index 6bb911d4..c12c42bb 100644 --- a/driver/public/silabs/stepper_a3967/src/mikroe_a3967.c +++ b/driver/public/silabs/stepper_a3967/src/mikroe_a3967.c @@ -39,7 +39,14 @@ #include "mikroe_a3967.h" #include "mikroe_a3967_config.h" #include "sl_sleeptimer.h" -#include "em_gpio.h" +#include "drv_digital_out.h" + +typedef struct { + digital_out_t ms1_pin; + digital_out_t ms2_pin; + digital_out_t dir_pin; + digital_out_t step_pin; +} stepper_t; // ----------------------------------------------------------------------------- // Static Variables Declarations @@ -48,6 +55,7 @@ static sl_sleeptimer_timer_handle_t mikroe_a3967_timer_handle; static uint32_t mikroe_a3967_step_frequency = MIKROE_A3967_STEP_FREQUENCY; static volatile uint32_t mikroe_a3967_pulses_count; +static stepper_t stepper; // ----------------------------------------------------------------------------- // Static Function Declarations @@ -69,28 +77,22 @@ static uint32_t mikroe_a3967_step_freq_to_tick(void); ******************************************************************************/ sl_status_t mikroe_a3967_init(void) { - sl_status_t sc = SL_STATUS_OK; - - GPIO_PinModeSet(MIKROE_A3967_STEP_PORT, - MIKROE_A3967_STEP_PIN, - gpioModePushPull, - 0); - - GPIO_PinModeSet(MIKROE_A3967_DIR_PORT, - MIKROE_A3967_DIR_PIN, - gpioModePushPull, - 0); - - GPIO_PinModeSet(MIKROE_A3967_MS1_PORT, - MIKROE_A3967_MS1_PIN, - gpioModePushPull, - 0); - - GPIO_PinModeSet(MIKROE_A3967_MS2_PORT, - MIKROE_A3967_MS2_PIN, - gpioModePushPull, - 0); - return sc; + digital_out_init(&stepper.step_pin, + hal_gpio_pin_name(MIKROE_A3967_STEP_PORT, + MIKROE_A3967_STEP_PIN)); + + digital_out_init(&stepper.dir_pin, + hal_gpio_pin_name(MIKROE_A3967_DIR_PORT, + MIKROE_A3967_DIR_PIN)); + + digital_out_init(&stepper.ms1_pin, + hal_gpio_pin_name(MIKROE_A3967_MS1_PORT, + MIKROE_A3967_MS1_PIN)); + + digital_out_init(&stepper.ms2_pin, + hal_gpio_pin_name(MIKROE_A3967_MS2_PORT, + MIKROE_A3967_MS2_PIN)); + return SL_STATUS_OK; } /***************************************************************************//** @@ -98,8 +100,6 @@ sl_status_t mikroe_a3967_init(void) ******************************************************************************/ sl_status_t mikroe_a3967_config_mode(mikroe_a3967_mode_t mode) { - sl_status_t sc = SL_STATUS_OK; - if (mikroe_a3967_get_state()) { return SL_STATUS_INVALID_STATE; } @@ -107,27 +107,27 @@ sl_status_t mikroe_a3967_config_mode(mikroe_a3967_mode_t mode) switch (mode) { case MIKROE_A3967_FULL_STEP: - GPIO_PinOutClear(MIKROE_A3967_MS1_PORT, MIKROE_A3967_MS1_PIN); - GPIO_PinOutClear(MIKROE_A3967_MS2_PORT, MIKROE_A3967_MS2_PIN); + digital_out_low(&stepper.ms1_pin); + digital_out_low(&stepper.ms2_pin); break; case MIKROE_A3967_HALF_STEP: - GPIO_PinOutSet(MIKROE_A3967_MS1_PORT, MIKROE_A3967_MS1_PIN); - GPIO_PinOutClear(MIKROE_A3967_MS2_PORT, MIKROE_A3967_MS2_PIN); + digital_out_high(&stepper.ms1_pin); + digital_out_low(&stepper.ms2_pin); break; case MIKROE_A3967_QUARTER_STEP: - GPIO_PinOutClear(MIKROE_A3967_MS1_PORT, MIKROE_A3967_MS1_PIN); - GPIO_PinOutSet(MIKROE_A3967_MS2_PORT, MIKROE_A3967_MS2_PIN); + digital_out_low(&stepper.ms1_pin); + digital_out_high(&stepper.ms2_pin); break; case MIKROE_A3967_EIGHTH_STEP: - GPIO_PinOutSet(MIKROE_A3967_MS1_PORT, MIKROE_A3967_MS1_PIN); - GPIO_PinOutSet(MIKROE_A3967_MS2_PORT, MIKROE_A3967_MS2_PIN); + digital_out_high(&stepper.ms1_pin); + digital_out_high(&stepper.ms2_pin); break; } - return sc; + return SL_STATUS_OK; } /***************************************************************************//** @@ -153,9 +153,9 @@ sl_status_t mikroe_a3967_set_direction(mikroe_a3967_direction_t dir) return SL_STATUS_INVALID_STATE; } if (dir == MIKROE_A3967_COUNTERCLOCKWISE) { - GPIO_PinOutSet(MIKROE_A3967_DIR_PORT, MIKROE_A3967_DIR_PIN); + digital_out_high(&stepper.dir_pin); } else { - GPIO_PinOutClear(MIKROE_A3967_DIR_PORT, MIKROE_A3967_DIR_PIN); + digital_out_low(&stepper.dir_pin); } return sc; @@ -194,7 +194,7 @@ sl_status_t mikroe_a3967_start(void) return SL_STATUS_INVALID_STATE; } - GPIO_PinOutClear(MIKROE_A3967_STEP_PORT, MIKROE_A3967_STEP_PIN); + digital_out_low(&stepper.step_pin); timeout = mikroe_a3967_step_freq_to_tick(); sc = sl_sleeptimer_start_periodic_timer(&mikroe_a3967_timer_handle, @@ -226,7 +226,7 @@ sl_status_t mikroe_a3967_step(uint16_t step) if (mikroe_a3967_get_state()) { sc = SL_STATUS_INVALID_STATE; } - GPIO_PinOutClear(MIKROE_A3967_STEP_PORT, MIKROE_A3967_STEP_PIN); + digital_out_low(&stepper.step_pin); timeout = mikroe_a3967_step_freq_to_tick(); mikroe_a3967_pulses_count = step; @@ -251,7 +251,7 @@ static void mikroe_a3967_step_callback(sl_sleeptimer_timer_handle_t *handle, (void) data; mikroe_a3967_pulses_count--; - GPIO_PinOutToggle(MIKROE_A3967_STEP_PORT, MIKROE_A3967_STEP_PIN); + digital_out_toggle(&stepper.step_pin); if (mikroe_a3967_pulses_count == 0) { sl_sleeptimer_stop_timer(&mikroe_a3967_timer_handle); } @@ -263,7 +263,7 @@ static void mikroe_a3967_run_callback(sl_sleeptimer_timer_handle_t *handle, (void) handle; (void) data; - GPIO_PinOutToggle(MIKROE_A3967_STEP_PORT, MIKROE_A3967_STEP_PIN); + digital_out_toggle(&stepper.step_pin); } /******************************************************************************* diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_usart_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_config.h similarity index 74% rename from driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_usart_config.h rename to driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_config.h index fabc26f7..a471cd98 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_config.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file adafruit_hxd8357d_config.h + * @file adafruit_hxd8357d_spi_config.h * @brief Configuration file for Adafruit hxd8357d board. * @version 1.0.0 ******************************************************************************* @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // HXD8357D SPI settings -// HXD8357D SPI bitrate -// Default: 40000000 -#define ADAFRUIT_HXD8357D_SPI_BITRATE 40000000 +// HXD8357D SPI bitrate +// Default: 20000000 +#define ADAFRUIT_HXD8357D_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_HXD8357D_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_HXD8357D_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -76,11 +88,11 @@ extern "C" // [USART_ADAFRUIT_HXD8357D]$ -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 5 -// [GPIO_HXD8357D_SPI_DC]$ +// ADAFRUIT_HXD8357D_DC +// $[GPIO_ADAFRUIT_HXD8357D_DC] +#define ADAFRUIT_HXD8357D_DC_PORT gpioPortC +#define ADAFRUIT_HXD8357D_DC_PIN 5 +// [GPIO_ADAFRUIT_HXD8357D_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_dma_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_dma_config.h deleted file mode 100644 index 4576d7a2..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/adafruit_hxd8357d_spi_dma_config.h +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************//** - * @file adafruit_hxd8357d_config.h - * @brief Configuration file for Adafruit HXD8357D board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_HXD8357D_CONFIG_H_ -#define ADAFRUIT_HXD8357D_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -// <<< sl:start pin_tool >>> - -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 5 -// [GPIO_HXD8357D_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_HXD8357D_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/sl_spidrv_hxd8357d_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/sl_spidrv_hxd8357d_config.h deleted file mode 100644 index 3a27b929..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2601b/sl_spidrv_hxd8357d_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_HXD8357D_CONFIG_H -#define SL_SPIDRV_HXD8357D_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_HXD8357D_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_HXD8357D_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_HXD8357D_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_HXD8357D_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_HXD8357D_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_HXD8357D_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_HXD8357D_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_HXD8357D -// $[USART_SL_SPIDRV_HXD8357D] -#define SL_SPIDRV_HXD8357D_PERIPHERAL USART0 -#define SL_SPIDRV_HXD8357D_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_HXD8357D_TX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_HXD8357D_RX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_RX_PIN 2 - -// USART0 CLK on PC02 -#define SL_SPIDRV_HXD8357D_CLK_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CLK_PIN 1 - -// USART0 CS on PC03 -#define SL_SPIDRV_HXD8357D_CS_PORT gpioPortA -#define SL_SPIDRV_HXD8357D_CS_PIN 7 - -// [USART_SL_SPIDRV_HXD8357D]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_HXD8357D_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_usart_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_config.h similarity index 74% rename from driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_usart_config.h rename to driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_config.h index 867b7c68..62dc061c 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_config.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file adafruit_hxd8357d_config.h + * @file adafruit_hxd8357d_spi_config.h * @brief Configuration file for Adafruit HXD8357D board. * @version 1.0.0 ******************************************************************************* @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // HXD8357D SPI settings -// HXD8357D SPI bitrate -// Default: 40000000 -#define ADAFRUIT_HXD8357D_SPI_BITRATE 40000000 +// HXD8357D SPI bitrate +// Default: 20000000 +#define ADAFRUIT_HXD8357D_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_HXD8357D_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_HXD8357D_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -76,11 +88,11 @@ extern "C" // [USART_ADAFRUIT_HXD8357D]$ -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 8 -// [GPIO_HXD8357D_SPI_DC]$ +// ADAFRUIT_HXD8357D_DC +// $[GPIO_ADAFRUIT_HXD8357D_DC] +#define ADAFRUIT_HXD8357D_DC_PORT gpioPortC +#define ADAFRUIT_HXD8357D_DC_PIN 8 +// [GPIO_ADAFRUIT_HXD8357D_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_dma_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_dma_config.h deleted file mode 100644 index d109cb6c..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/adafruit_hxd8357d_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_hxd8357d_config.h - * @brief Configuration file for Adafruit HXD8357D board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_HXD8357D_CONFIG_H_ -#define ADAFRUIT_HXD8357D_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 8 -// [GPIO_HXD8357D_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_HXD8357D_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/sl_spidrv_hxd8357d_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/sl_spidrv_hxd8357d_config.h deleted file mode 100644 index c4961eec..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2703a/sl_spidrv_hxd8357d_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_HXD8357D_CONFIG_H -#define SL_SPIDRV_HXD8357D_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_HXD8357D_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_HXD8357D_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_HXD8357D_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_HXD8357D_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_HXD8357D_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_HXD8357D_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_HXD8357D_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_HXD8357D -// $[USART_SL_SPIDRV_HXD8357D] -#define SL_SPIDRV_HXD8357D_PERIPHERAL USART0 -#define SL_SPIDRV_HXD8357D_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_HXD8357D_TX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_HXD8357D_RX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_RX_PIN 2 - -// USART0 CLK on PC02 -#define SL_SPIDRV_HXD8357D_CLK_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CLK_PIN 1 - -// USART0 CS on PC03 -#define SL_SPIDRV_HXD8357D_CS_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CS_PIN 0 - -// [USART_SL_SPIDRV_HXD8357D]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_HXD8357D_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_usart_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_config.h similarity index 74% rename from driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_usart_config.h rename to driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_config.h index 91a37c12..faf466a0 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/adafruit_hxd8357d_spi_config.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file adafruit_hxd8357d_config.h + * @file adafruit_hxd8357d_spi_config.h * @brief Configuration file for Adafruit HXD8357D board. * @version 1.0.0 ******************************************************************************* @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // HXD8357D SPI settings -// HXD8357D SPI bitrate -// Default: 40000000 -#define ADAFRUIT_HXD8357D_SPI_BITRATE 40000000 +// HXD8357D SPI bitrate +// Default: 20000000 +#define ADAFRUIT_HXD8357D_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_HXD8357D_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_HXD8357D_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_HXD8357D]$ -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 0 -// [GPIO_HXD8357D_SPI_DC]$ +// ADAFRUIT_HXD8357D_DC +// $[GPIO_ADAFRUIT_HXD8357D_DC] +#define ADAFRUIT_HXD8357D_DC_PORT gpioPortC +#define ADAFRUIT_HXD8357D_DC_PIN 0 +// [GPIO_ADAFRUIT_HXD8357D_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/sl_spidrv_hxd8357d_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/sl_spidrv_hxd8357d_config.h deleted file mode 100644 index 8261d595..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd2704a/sl_spidrv_hxd8357d_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_HXD8357D_CONFIG_H -#define SL_SPIDRV_HXD8357D_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_HXD8357D_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_HXD8357D_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_HXD8357D_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_HXD8357D_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_HXD8357D_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_HXD8357D_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_HXD8357D_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_HXD8357D -// $[USART_SL_SPIDRV_HXD8357D] -#define SL_SPIDRV_HXD8357D_PERIPHERAL USART0 -#define SL_SPIDRV_HXD8357D_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_HXD8357D_TX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_HXD8357D_RX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_RX_PIN 6 - -// USART0 CLK on PC02 -#define SL_SPIDRV_HXD8357D_CLK_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_HXD8357D_CS_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CS_PIN 1 - -// [USART_SL_SPIDRV_HXD8357D]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_HXD8357D_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_usart_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_config.h similarity index 74% rename from driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_usart_config.h rename to driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_config.h index 2b724b85..e5f91afe 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_config.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file adafruit_hxd8357d_config.h + * @file adafruit_hxd8357d_spi_config.h * @brief Configuration file for Adafruit HXD8357D board. * @version 1.0.0 ******************************************************************************* @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // HXD8357D SPI settings -// HXD8357D SPI bitrate -// Default: 40000000 -#define ADAFRUIT_HXD8357D_SPI_BITRATE 40000000 +// HXD8357D SPI bitrate +// Default: 20000000 +#define ADAFRUIT_HXD8357D_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_HXD8357D_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_HXD8357D_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_HXD8357D]$ -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 6 -// [GPIO_HXD8357D_SPI_DC]$ +// ADAFRUIT_HXD8357D_DC +// $[GPIO_ADAFRUIT_HXD8357D_DC] +#define ADAFRUIT_HXD8357D_DC_PORT gpioPortC +#define ADAFRUIT_HXD8357D_DC_PIN 6 +// [GPIO_ADAFRUIT_HXD8357D_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_dma_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_dma_config.h deleted file mode 100644 index 07cf348f..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_hxd8357d_config.h - * @brief Configuration file for Adafruit HXD8357D board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_HXD8357D_CONFIG_H_ -#define ADAFRUIT_HXD8357D_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 6 -// [GPIO_HXD8357D_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_HXD8357D_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/sl_spidrv_hxd8357d_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/sl_spidrv_hxd8357d_config.h deleted file mode 100644 index 2801848c..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/sl_spidrv_hxd8357d_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_HXD8357D_CONFIG_H -#define SL_SPIDRV_HXD8357D_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_HXD8357D_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_HXD8357D_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_HXD8357D_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_HXD8357D_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_HXD8357D_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_HXD8357D_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_HXD8357D_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_HXD8357D -// $[USART_SL_SPIDRV_HXD8357D] -#define SL_SPIDRV_HXD8357D_PERIPHERAL USART0 -#define SL_SPIDRV_HXD8357D_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_HXD8357D_TX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_HXD8357D_RX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_HXD8357D_CLK_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_HXD8357D_CS_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CS_PIN 3 - -// [USART_SL_SPIDRV_HXD8357D]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_HXD8357D_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_usart_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_config.h similarity index 74% rename from driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_usart_config.h rename to driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_config.h index 2b724b85..e5f91afe 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4108a/adafruit_hxd8357d_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_config.h @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file adafruit_hxd8357d_config.h + * @file adafruit_hxd8357d_spi_config.h * @brief Configuration file for Adafruit HXD8357D board. * @version 1.0.0 ******************************************************************************* @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // HXD8357D SPI settings -// HXD8357D SPI bitrate -// Default: 40000000 -#define ADAFRUIT_HXD8357D_SPI_BITRATE 40000000 +// HXD8357D SPI bitrate +// Default: 20000000 +#define ADAFRUIT_HXD8357D_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_HXD8357D_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_HXD8357D_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_HXD8357D]$ -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 6 -// [GPIO_HXD8357D_SPI_DC]$ +// ADAFRUIT_HXD8357D_DC +// $[GPIO_ADAFRUIT_HXD8357D_DC] +#define ADAFRUIT_HXD8357D_DC_PORT gpioPortC +#define ADAFRUIT_HXD8357D_DC_PIN 6 +// [GPIO_ADAFRUIT_HXD8357D_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_dma_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_dma_config.h deleted file mode 100644 index 07cf348f..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/adafruit_hxd8357d_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_hxd8357d_config.h - * @brief Configuration file for Adafruit HXD8357D board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_HXD8357D_CONFIG_H_ -#define ADAFRUIT_HXD8357D_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] -#define HXD8357D_SPI_DC_PORT gpioPortC -#define HXD8357D_SPI_DC_PIN 6 -// [GPIO_HXD8357D_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_HXD8357D_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/sl_spidrv_hxd8357d_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/sl_spidrv_hxd8357d_config.h deleted file mode 100644 index 2801848c..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4314a/sl_spidrv_hxd8357d_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_HXD8357D_CONFIG_H -#define SL_SPIDRV_HXD8357D_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_HXD8357D_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_HXD8357D_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_HXD8357D_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_HXD8357D_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_HXD8357D_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_HXD8357D_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_HXD8357D_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_HXD8357D -// $[USART_SL_SPIDRV_HXD8357D] -#define SL_SPIDRV_HXD8357D_PERIPHERAL USART0 -#define SL_SPIDRV_HXD8357D_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_HXD8357D_TX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_HXD8357D_RX_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_HXD8357D_CLK_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_HXD8357D_CS_PORT gpioPortC -#define SL_SPIDRV_HXD8357D_CS_PIN 3 - -// [USART_SL_SPIDRV_HXD8357D]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_HXD8357D_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/brd4338a/adafruit_hxd8357d_spi_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4338a/adafruit_hxd8357d_spi_config.h new file mode 100644 index 00000000..fa0cfeef --- /dev/null +++ b/driver/public/silabs/tft_lcd_hxd8357d/config/brd4338a/adafruit_hxd8357d_spi_config.h @@ -0,0 +1,82 @@ +/***************************************************************************//** + * @file adafruit_hxd8357d_spi_config.h + * @brief Configuration file for Adafruit TFT Display Driver. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ +#ifndef ADAFRUIT_HXD8357D_CONFIG_H_ +#define ADAFRUIT_HXD8357D_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// ST7789 SPI settings + +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_HXD8357D_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_HXD8357D_CLOCK_MODE SL_GSPI_MODE_0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_HXD8357D_CS_CONTROL SL_GSPI_MASTER_HW_OUTPUT +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ADAFRUIT_HXD8357D_DC +// $[GPIO_ADAFRUIT_HXD8357D_DC] +#ifndef ADAFRUIT_HXD8357D_DC_PORT +#define ADAFRUIT_HXD8357D_DC_PORT HP +#endif +#ifndef ADAFRUIT_HXD8357D_DC_PIN +#define ADAFRUIT_HXD8357D_DC_PIN 47 +#endif +// [GPIO_ADAFRUIT_HXD8357D_DC]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +extern "C" +} +#endif + +#endif /* ADAFRUIT_HXD8357D_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_usart_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_config.h similarity index 73% rename from driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_usart_config.h rename to driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_config.h index 818fae69..4ff08395 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_hxd8357d/config/other/adafruit_hxd8357d_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // HXD8357D SPI settings -// HXD8357D SPI bitrate -// Default: 40000000 -#define ADAFRUIT_HXD8357D_SPI_BITRATE 40000000 +// HXD8357D SPI bitrate +// Default: 20000000 +#define ADAFRUIT_HXD8357D_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_HXD8357D_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_HXD8357D_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -57,10 +69,10 @@ extern "C" #warning "HXD8357D SPI Peripheral not configured" // [USART_ADAFRUIT_HXD8357D]$ -// HXD8357D_SPI_DC -// $[GPIO_HXD8357D_SPI_DC] +// ADAFRUIT_HXD8357D_DC +// $[GPIO_ADAFRUIT_HXD8357D_DC] #warning "HXD8357D SPI DC Pin not configured" -// [GPIO_HXD8357D_SPI_DC]$ +// [GPIO_ADAFRUIT_HXD8357D_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_hxd8357d/config/other/sl_spidrv_hxd8357d_config.h b/driver/public/silabs/tft_lcd_hxd8357d/config/other/sl_spidrv_hxd8357d_config.h deleted file mode 100644 index 0ca97c47..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/config/other/sl_spidrv_hxd8357d_config.h +++ /dev/null @@ -1,85 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_HXD8357D_CONFIG_H -#define SL_SPIDRV_HXD8357D_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_HXD8357D_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_HXD8357D_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_HXD8357D_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_HXD8357D_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_HXD8357D_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_HXD8357D_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_HXD8357D_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_HXD8357D -// $[USART_SL_SPIDRV_HXD8357D] -#warning "HXD8357D SPI Peripheral not configured" -// [USART_SL_SPIDRV_HXD8357D]$ - -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_HXD8357D_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_hxd8357d/inc/adafruit_hxd8357d.h b/driver/public/silabs/tft_lcd_hxd8357d/inc/adafruit_hxd8357d.h index c74bac7e..23a3eb1d 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/inc/adafruit_hxd8357d.h +++ b/driver/public/silabs/tft_lcd_hxd8357d/inc/adafruit_hxd8357d.h @@ -46,6 +46,8 @@ #include #include "sl_status.h" #include "sl_component_catalog.h" +#include "mipi_dbi.h" +#include "mipi_dbi_spi.h" #ifdef __cplusplus extern "C" { @@ -133,16 +135,10 @@ typedef void (*adafruit_hxd8357d_dma_complete_callback_t)(sl_status_t status); * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_PRESENT) -sl_status_t adafruit_hxd8357d_spi_usart_init(void); +sl_status_t adafruit_hxd8357d_spi_init(const struct mipi_dbi_config *config); -#define adafruit_hxd8357d_init adafruit_hxd8357d_spi_usart_init -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_HXD8357D_DMA_PRESENT) -#include "spidrv.h" -sl_status_t adafruit_hxd8357d_spi_dma_init(SPIDRV_Handle_t spidrv_handle); - -#define adafruit_hxd8357d_init adafruit_hxd8357d_spi_dma_init -#endif +#define adafruit_hxd8357d_init(config) \ + adafruit_hxd8357d_spi_init((const struct mipi_dbi_config *)config) /***************************************************************************//** * @brief diff --git a/driver/public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d.c b/driver/public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d.c index 66bc23b2..4a55ff69 100644 --- a/driver/public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d.c +++ b/driver/public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d.c @@ -39,120 +39,123 @@ // ----------------------------------------------------------------------------- // Includes // ----------------------------------------------------------------------------- -#include "em_cmu.h" -#include "em_gpio.h" #include "sl_status.h" #include "sl_sleeptimer.h" #include "sl_component_catalog.h" -#include "em_usart.h" -#include "adafruit_hxd8357d_spi_usart_config.h" #include "adafruit_hxd8357d.h" -/****************************************************************************** -* Macros -******************************************************************************/ +// ----------------------------------------------------------------------------- +// Macros +// ----------------------------------------------------------------------------- -#define MADCTL_MY 0x80 ///< Bottom to top -#define MADCTL_MX 0x40 ///< Right to left -#define MADCTL_MV 0x20 ///< Reverse Mode -#define MADCTL_ML 0x10 ///< LCD refresh Bottom to top -#define MADCTL_RGB 0x00 ///< Red-Green-Blue pixel order -#define MADCTL_BGR 0x08 ///< Blue-Green-Red pixel order -#define MADCTL_MH 0x04 ///< LCD refresh right to left +#define MADCTL_MY 0x80 ///< Bottom to top +#define MADCTL_MX 0x40 ///< Right to left +#define MADCTL_MV 0x20 ///< Reverse Mode +#define MADCTL_ML 0x10 ///< LCD refresh Bottom to top +#define MADCTL_RGB 0x00 ///< Red-Green-Blue pixel order +#define MADCTL_BGR 0x08 ///< Blue-Green-Red pixel order +#define MADCTL_MH 0x04 ///< LCD refresh right to left #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) +#define _swap_int16_t(a, b) \ + { \ + int16_t t = a; \ + a = b; \ + b = t; \ + } -#define SPI_CS_LOW() \ - GPIO_PinOutClear(ADAFRUIT_HXD8357D_CS_PORT, ADAFRUIT_HXD8357D_CS_PIN); -#define SPI_CS_HIGH() \ - GPIO_PinOutSet(ADAFRUIT_HXD8357D_CS_PORT, ADAFRUIT_HXD8357D_CS_PIN); - -#define SPI_DC_LOW() \ - GPIO_PinOutClear(HXD8357D_SPI_DC_PORT, HXD8357D_SPI_DC_PIN); -#define SPI_DC_HIGH() \ - GPIO_PinOutSet(HXD8357D_SPI_DC_PORT, HXD8357D_SPI_DC_PIN); +#define BYTE_PER_PIXEL (2) /* 2 Bytes color data per pixel */ +#define MAX_XFER_PIXEL_COUNT \ + (MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX / BYTE_PER_PIXEL) -/****************************************************************************** -* Static variables -******************************************************************************/ -static int _width; // screen dimensions +// ----------------------------------------------------------------------------- +// Local Variables +// ----------------------------------------------------------------------------- +static bool color_swap_enabled = false; +static uint32_t gtotal_pixel = 0; +static uint32_t gpixel_transmit = 0; +static uint32_t gpixel_transmit_counter = 0; +static uint8_t *pColorBuffer = NULL; +static void (*flush_area_callback)(void *arg) = NULL; +static void *flush_area_callback_arg = NULL; +static uint8_t *pColorSwap = NULL; + +static uint16_t dma_buffer[MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX / 2]; + +static int _width; static int _height; -/***************************************************************************//** - * @brief - * Adafruit_SPITFT Send Command handles complete sending of commands and - * data. - * - * @param[in] command - * The Command Byte. - * @param[in] data - * A pointer to the Data bytes to send. - * @param[in] len - * The number of bytes we should send. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_INVALID_PARAMETER if NULL pointer or 'len' equals to zero. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_spi_send_command(uint8_t command, - uint8_t *data, - uint8_t len) +static struct mipi_dbi_device mipi_dbi_device; + +static sl_status_t command_write(uint8_t cmd) { - SPI_CS_LOW(); - SPI_DC_LOW(); - USART_SpiTransfer(ADAFRUIT_HXD8357D_PERIPHERAL, command); - SPI_DC_HIGH(); - while (len--) { - USART_SpiTransfer(ADAFRUIT_HXD8357D_PERIPHERAL, *data); - data++; - } - SPI_CS_HIGH(); + return mipi_dbi_device.api->command_write( + &mipi_dbi_device, + cmd, + NULL, 0); +} - return SL_STATUS_OK; +static sl_status_t write_display(const void *framebuf, + size_t framebuf_len, + mipi_dbi_transfer_complete_callback_t callback) +{ + struct mipi_dbi_display_buffer_descriptor desc; + + desc.buf_size = framebuf_len; + + return mipi_dbi_device.api->write_display( + &mipi_dbi_device, + (const uint8_t *)framebuf, + &desc, + PIXEL_FORMAT_RGB_565, + callback); } -/***************************************************************************//** - * @brief - * Write a single command byte to the display. - * - * @param[in] cmd - * 8-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_spi_write_command(uint8_t cmd) +static sl_status_t write_display16(uint16_t data) { - SPI_DC_LOW(); - USART_SpiTransfer(ADAFRUIT_HXD8357D_PERIPHERAL, cmd); - SPI_DC_HIGH(); + struct mipi_dbi_display_buffer_descriptor desc; + uint8_t bytes[2]; - return SL_STATUS_OK; + bytes[0] = data >> 8; + bytes[1] = data & 0x00FF; + + desc.buf_size = 2; + + return mipi_dbi_device.api->write_display( + &mipi_dbi_device, + bytes, + &desc, + PIXEL_FORMAT_RGB_565, + NULL); } /***************************************************************************//** * @brief - * Write a single command word to the display. + * Adafruit_SPITFT Send Command handles complete sending of commands and + * data. * - * @param[in] cmd - * 16-bit command to write. + * @param[in] command + * The Command Byte. + * @param[in] data + * A pointer to the Data bytes to send. + * @param[in] len + * The number of bytes we should send. * * @return * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. + * SL_STATUS_INVALID_PARAMETER or SL_STATUS_IO if the process is failed. ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_spi_write16(uint16_t data) +static sl_status_t send_command(uint8_t command, + const uint8_t *data, + uint8_t len) { - uint8_t bytes[2]; - - bytes[0] = data >> 8; - bytes[1] = data & 0x00FF; - - USART_SpiTransfer(ADAFRUIT_HXD8357D_PERIPHERAL, bytes[0]); - USART_SpiTransfer(ADAFRUIT_HXD8357D_PERIPHERAL, bytes[1]); + sl_status_t status; - return SL_STATUS_OK; + status = mipi_dbi_device.api->command_write( + &mipi_dbi_device, + command, + data, len); + return status; } /***************************************************************************//** @@ -166,14 +169,31 @@ static sl_status_t adafruit_hxd8357d_spi_write16(uint16_t data) * * @return * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. + * SL_STATUS_IO if the process is failed. ******************************************************************************/ static sl_status_t adafruit_hxd8357d_write_color(uint16_t color, uint32_t len) { - while (len--) { - adafruit_hxd8357d_spi_write16(color); + uint32_t i, n, size; + sl_status_t status; + + if (!len) { + return SL_STATUS_INVALID_PARAMETER; } + for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { + if (n + MAX_XFER_PIXEL_COUNT <= len) { + size = MAX_XFER_PIXEL_COUNT; + } else { + size = len - n; + } + for (i = 0; i < size; i++) { + dma_buffer[i] = color >> 8 | ((uint16_t)(color & 0xff) << 8); + } + status = write_display(dma_buffer, size * 2, NULL); + if (SL_STATUS_OK != status) { + return status; + } + } return SL_STATUS_OK; } @@ -188,18 +208,33 @@ static sl_status_t adafruit_hxd8357d_write_color(uint16_t color, uint32_t len) * * @return * SL_STATUS_OK if there are no errors. - * SL_STATUS_INVALID_PARAMETER if the process is failed. + * SL_STATUS_INVALID_PARAMETER or SL_STATUS_IO if the process is failed. ******************************************************************************/ static sl_status_t adafruit_hxd8357d_write_pixels(uint16_t *colors, uint32_t len) { - if ((!len) || (colors == NULL)) { + uint32_t i, n, size; + sl_status_t status; + + if (!len) { return SL_STATUS_INVALID_PARAMETER; } - while (len--) { - adafruit_hxd8357d_spi_write16(*colors); - colors++; + for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { + if (n + MAX_XFER_PIXEL_COUNT <= len) { + size = MAX_XFER_PIXEL_COUNT; + } else { + size = len - n; + } + + for (i = 0; i < size; i++) { + dma_buffer[i] = *colors >> 8 | ((uint16_t)(*colors & 0xff) << 8); + colors++; + } + status = write_display(dma_buffer, size * 2, NULL); + if (SL_STATUS_OK != status) { + return status; + } } return SL_STATUS_OK; } @@ -297,9 +332,7 @@ static sl_status_t adafruit_hxd8357d_fill_rect(int16_t x, if (y2 >= HXD8357D_TFTHEIGHT) { h = HXD8357D_TFTHEIGHT - y; } - SPI_CS_LOW(); adafruit_hxd8357d_write_fill_rect_preclipped(x, y, w, h, color); - SPI_CS_HIGH(); } } } @@ -309,82 +342,6 @@ static sl_status_t adafruit_hxd8357d_fill_rect(int16_t x, return SL_STATUS_OK; } -static void spi_usart_init(void) -{ - USART_InitSync_TypeDef usartInit = USART_INITSYNC_DEFAULT; - - usartInit.msbf = true; - usartInit.clockMode = usartClockMode0; - usartInit.master = true; - usartInit.baudrate = ADAFRUIT_HXD8357D_SPI_BITRATE; - -#if defined(_CMU_HFPERCLKEN0_MASK) - CMU_ClockEnable(cmuClock_HFPER, true); -#endif - CMU_ClockEnable(cmuClock_GPIO, true); -#if ADAFRUIT_HXD8357D_PERIPHERAL_NO == 0 - CMU_ClockEnable(cmuClock_USART0, true); -#elif ADAFRUIT_HXD8357D_PERIPHERAL_NO == 1 - CMU_ClockEnable(cmuClock_USART1, true); -#elif ADAFRUIT_HXD8357D_PERIPHERAL_NO == 2 - CMU_ClockEnable(cmuClock_USART2, true); -#endif - - usartInit.databits = usartDatabits8; - USART_InitSync(ADAFRUIT_HXD8357D_PERIPHERAL, &usartInit); - -#if defined(USART_ROUTEPEN_TXPEN) - ADAFRUIT_HXD8357D_PERIPHERAL->ROUTELOC0 = - (ADAFRUIT_HXD8357D_PERIPHERAL->ROUTELOC0 - & ~(_USART_ROUTELOC0_TXLOC_MASK - | _USART_ROUTELOC0_RXLOC_MASK - | _USART_ROUTELOC0_CLKLOC_MASK)) - | (ADAFRUIT_HXD8357D_TX_LOC << _USART_ROUTELOC0_TXLOC_SHIFT) - | (ADAFRUIT_HXD8357D_RX_LOC << _USART_ROUTELOC0_RXLOC_SHIFT) - | (ADAFRUIT_HXD8357D_CLK_LOC << _USART_ROUTELOC0_CLKLOC_SHIFT); - - ADAFRUIT_HXD8357D_PERIPHERAL->ROUTEPEN = USART_ROUTEPEN_TXPEN - | USART_ROUTEPEN_RXPEN - | USART_ROUTEPEN_CLKPEN - | USART_ROUTEPEN_CSPEN; -#else - GPIO->USARTROUTE[ADAFRUIT_HXD8357D_PERIPHERAL_NO].ROUTEEN = - GPIO_USART_ROUTEEN_TXPEN - | GPIO_USART_ROUTEEN_RXPEN - | GPIO_USART_ROUTEEN_CLKPEN; - GPIO->USARTROUTE[ADAFRUIT_HXD8357D_PERIPHERAL_NO].TXROUTE = - ((uint32_t)ADAFRUIT_HXD8357D_TX_PORT << _GPIO_USART_TXROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_HXD8357D_TX_PIN << _GPIO_USART_TXROUTE_PIN_SHIFT); - GPIO->USARTROUTE[ADAFRUIT_HXD8357D_PERIPHERAL_NO].RXROUTE = - ((uint32_t)ADAFRUIT_HXD8357D_RX_PORT << _GPIO_USART_RXROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_HXD8357D_RX_PIN << _GPIO_USART_RXROUTE_PIN_SHIFT); - GPIO->USARTROUTE[ADAFRUIT_HXD8357D_PERIPHERAL_NO].CLKROUTE = - ((uint32_t)ADAFRUIT_HXD8357D_CLK_PORT << _GPIO_USART_CLKROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_HXD8357D_CLK_PIN << _GPIO_USART_CLKROUTE_PIN_SHIFT); -#endif - - GPIO_PinModeSet(ADAFRUIT_HXD8357D_TX_PORT, - ADAFRUIT_HXD8357D_TX_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ADAFRUIT_HXD8357D_RX_PORT, - ADAFRUIT_HXD8357D_RX_PIN, - gpioModeInput, - 0); - GPIO_PinModeSet(ADAFRUIT_HXD8357D_CLK_PORT, - ADAFRUIT_HXD8357D_CLK_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ADAFRUIT_HXD8357D_CS_PORT, - ADAFRUIT_HXD8357D_CS_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(HXD8357D_SPI_DC_PORT, - HXD8357D_SPI_DC_PIN, - gpioModePushPull, - 0); -} - // ----------------------------------------------------------------------------- // Public Function // ----------------------------------------------------------------------------- @@ -392,9 +349,11 @@ static void spi_usart_init(void) /**************************************************************************//** * Initialize the Adafruit 3.5" TFT LCD with Touchscreen. *****************************************************************************/ -sl_status_t adafruit_hxd8357d_spi_usart_init(void) +sl_status_t adafruit_hxd8357d_spi_init(const struct mipi_dbi_config *config) { - static uint8_t init_cmd[] = { + mipi_dbi_device_init(&mipi_dbi_device, config); + + static const uint8_t init_cmd[] = { HXD8357D_SWRESET, 0x80 + 100 / 5, // Soft reset, then delay 10 ms HXD8357D_SETC, @@ -500,25 +459,24 @@ sl_status_t adafruit_hxd8357d_spi_usart_init(void) 0, // END OF COMMAND LIST }; - spi_usart_init(); - sl_sleeptimer_delay_millisecond(150); - uint8_t cmd, x, num_args; - uint8_t *addr = init_cmd; - while ((cmd = pgm_read_byte(addr++)) > 0) { + uint8_t cmd, x, numArgs; + const uint8_t *addr = init_cmd; + while ((cmd = pgm_read_byte(addr++)) > 0) { // '0' command ends list x = pgm_read_byte(addr++); - num_args = x & 0x7F; - if (cmd != 0xff) { - if (x & 0x80) { - adafruit_hxd8357d_spi_send_command(cmd, NULL, 0); + numArgs = x & 0x7F; + if (cmd != 0xFF) { // '255' is ignored + if (x & 0x80) { // If high bit set, numArgs is a delay time + send_command(cmd, NULL, 0); } else { - adafruit_hxd8357d_spi_send_command(cmd, addr, num_args); - addr += num_args; + send_command(cmd, addr, numArgs); + addr += numArgs; } } - if (x & 0x80) { - sl_sleeptimer_delay_millisecond(150); + if (x & 0x80) { // If high bit set... + // numArgs is actually a delay time (5ms units) + sl_sleeptimer_delay_millisecond(numArgs * 5); } } @@ -558,7 +516,7 @@ sl_status_t adafruit_hxd8357d_set_rotation(uint8_t rotate) break; } - return adafruit_hxd8357d_spi_send_command(HXD8357D_MADCTL, &rotate, 1); + return send_command(HXD8357D_MADCTL, &rotate, 1); } /**************************************************************************//** @@ -566,7 +524,7 @@ sl_status_t adafruit_hxd8357d_set_rotation(uint8_t rotate) *****************************************************************************/ sl_status_t adafruit_hxd8357d_invert_display(bool invert) { - return adafruit_hxd8357d_spi_send_command( + return send_command( invert ? HXD8357D_INVON : HXD8357D_INVOFF, NULL, 0); } @@ -579,25 +537,34 @@ sl_status_t adafruit_hxd8357d_set_addr_window(uint16_t x1, uint16_t y1, static uint16_t old_x1 = 0xffff, old_x2 = 0xffff; static uint16_t old_y1 = 0xffff, old_y2 = 0xffff; uint16_t x2 = (x1 + w - 1), y2 = (y1 + h - 1); + uint16_t tmp[2]; + sl_status_t status; if ((x1 != old_x1) || (x2 != old_x2)) { // Column address set - adafruit_hxd8357d_spi_write_command(HXD8357D_CASET); - adafruit_hxd8357d_spi_write16(x1); - adafruit_hxd8357d_spi_write16(x2); + tmp[0] = x1 >> 8 | ((uint16_t)(x1 & 0xff) << 8); + tmp[1] = x2 >> + 8 | ((uint16_t)(x2 & 0xff) << 8); + status = send_command(HXD8357D_CASET, (uint8_t *)tmp, 4); + if (SL_STATUS_OK != status) { + return status; + } old_x1 = x1; old_x2 = x2; } if ((y1 != old_y1) || (y2 != old_y2)) { // Row address set - adafruit_hxd8357d_spi_write_command(HXD8357D_PASET); - adafruit_hxd8357d_spi_write16(y1); - adafruit_hxd8357d_spi_write16(y2); + tmp[0] = y1 >> 8 | ((uint16_t)(y1 & 0xff) << 8); + tmp[1] = y2 >> 8 | ((uint16_t)(y2 & 0xff) << 8); + status = send_command(HXD8357D_PASET, (uint8_t *)tmp, 4); + if (SL_STATUS_OK != status) { + return status; + } old_y1 = y1; old_y2 = y2; } // Write to RAM - return adafruit_hxd8357d_spi_write_command(HXD8357D_RAMWR); + return command_write(HXD8357D_RAMWR); } /**************************************************************************//** @@ -605,15 +572,16 @@ sl_status_t adafruit_hxd8357d_set_addr_window(uint16_t x1, uint16_t y1, *****************************************************************************/ sl_status_t adafruit_hxd8357d_draw_pixel(int16_t x, int16_t y, uint16_t color) { + sl_status_t status; + if ((x >= 0) && (x < HXD8357D_TFTWIDTH) && (y >= 0) && (y < HXD8357D_TFTHEIGHT)) { // THEN set up transaction (if needed) and draw... - SPI_CS_LOW(); - adafruit_hxd8357d_set_addr_window(x, y, 1, 1); - adafruit_hxd8357d_spi_write16(color); - SPI_CS_HIGH(); - - return SL_STATUS_OK; + status = adafruit_hxd8357d_set_addr_window(x, y, 1, 1); + if (SL_STATUS_OK != status) { + return status; + } + return write_display16(color); } return SL_STATUS_INVALID_PARAMETER; } @@ -668,19 +636,17 @@ sl_status_t adafruit_hxd8357d_draw_rgb_bitmap(int16_t x, h = HXD8357D_TFTHEIGHT - y; } color += by1 * save_w + bx1; - SPI_CS_LOW(); adafruit_hxd8357d_set_addr_window(x, y, w, h); while (h--) { adafruit_hxd8357d_write_pixels(color, w); color += save_w; } - SPI_CS_HIGH(); return SL_STATUS_OK; } /**************************************************************************//** - * Fill the screen area with color. After the process + * Fill the screen area with color using SPI transmit DMA. After the process * is complete call the user callback to notify the higher layer. *****************************************************************************/ sl_status_t adafruit_hxd8357d_flush_area_rgb565(int16_t x1, int16_t y1, @@ -690,37 +656,73 @@ sl_status_t adafruit_hxd8357d_flush_area_rgb565(int16_t x1, int16_t y1, void (*callback)(void *arg), void *callback_arg) { - sl_status_t sc = SL_STATUS_FAIL; + sl_status_t status; - if ((pcolor == NULL) || (callback == NULL)) { - return SL_STATUS_INVALID_PARAMETER; - } - - if ((x1 >= 0) && (x1 < HXD8357D_TFTWIDTH) + if ((pcolor != NULL) && (callback != NULL) + && (x1 >= 0) && (x1 < HXD8357D_TFTWIDTH) && (x2 >= 0) && (x2 < HXD8357D_TFTWIDTH) && (y1 >= 0) && (y1 < HXD8357D_TFTHEIGHT) && (y2 >= 0) && (y2 < HXD8357D_TFTHEIGHT) && (x2 >= x1) && (y2 >= y1)) { - uint16_t *p_color = (uint16_t *)pcolor; + uint16_t width = x2 - x1 + 1; + uint16_t hight = y2 - y1 + 1; + + adafruit_hxd8357d_set_addr_window(x1, y1, width, hight); + + gtotal_pixel = width * hight; + gpixel_transmit = 0; + gpixel_transmit_counter = 0; + color_swap_enabled = color_swap; + flush_area_callback = callback; + flush_area_callback_arg = callback_arg; + + while (gpixel_transmit_counter < gtotal_pixel) { + uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; + gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT + ? MAX_XFER_PIXEL_COUNT : pixel_remaining; + + if (!color_swap_enabled) { + uint16_t i; + pColorSwap = pcolor; + uint8_t colorData_H; + uint8_t colorData_L; + + for (i = 0; i < gpixel_transmit; i++) { + colorData_H = + pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; + colorData_L = + pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; + + /* Swap 2 bytes color data before sending to TFT LCD */ + dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; + } - for (int16_t y = y1; y <= y2; y++) { - for (int16_t x = x1; x <= x2; x++) { - uint16_t color; + pColorBuffer = (uint8_t *)dma_buffer; + } else { + pColorBuffer = (uint8_t *)pcolor; + } - if (color_swap) { - color = *p_color >> 8 | ((uint16_t)(*p_color & 0xff) << 8); - } else { - color = *p_color; - } - sc = adafruit_hxd8357d_draw_pixel(x, y, color); - if (SL_STATUS_OK != sc) { - goto end; - } - p_color++; + /* Start transmit data, the process is continued in + * adafruit_hxd8357d_flush_area_transmit_callback function + */ + status = write_display(pColorBuffer, + gpixel_transmit * BYTE_PER_PIXEL, + NULL); + if (SL_STATUS_OK != status) { + goto error; } + + if (color_swap_enabled) { + pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); + } + + gpixel_transmit_counter += gpixel_transmit; } + callback(callback_arg); + return SL_STATUS_OK; } - end: + return SL_STATUS_INVALID_PARAMETER; + error: callback(callback_arg); - return sc; + return status; } diff --git a/driver/public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d_dma.c b/driver/public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d_dma.c deleted file mode 100644 index 5a6ddd96..00000000 --- a/driver/public/silabs/tft_lcd_hxd8357d/src/adafruit_hxd8357d_dma.c +++ /dev/null @@ -1,833 +0,0 @@ -/***************************************************************************//** - * @file adafruit_hxd8357d.c - * @brief Adafruit HXD8357D TFT LCD with Touchscreen Source File - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- -#include "em_cmu.h" -#include "em_gpio.h" -#include "sl_status.h" -#include "sl_sleeptimer.h" -#include "sl_component_catalog.h" -#include "spidrv.h" -#include "adafruit_hxd8357d_spi_dma_config.h" -#include "sl_spidrv_hxd8357d_config.h" -#include "adafruit_hxd8357d.h" - -// ----------------------------------------------------------------------------- -// Macros -// ----------------------------------------------------------------------------- - -#define MADCTL_MY 0x80 ///< Bottom to top -#define MADCTL_MX 0x40 ///< Right to left -#define MADCTL_MV 0x20 ///< Reverse Mode -#define MADCTL_ML 0x10 ///< LCD refresh Bottom to top -#define MADCTL_RGB 0x00 ///< Red-Green-Blue pixel order -#define MADCTL_BGR 0x08 ///< Blue-Green-Red pixel order -#define MADCTL_MH 0x04 ///< LCD refresh right to left - -#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) -#define _swap_int16_t(a, b) \ - { \ - int16_t t = a; \ - a = b; \ - b = t; \ - } - -#define BYTE_PER_PIXEL (2) /* 2 Bytes color data per pixel */ -#define MAX_XFER_PIXEL_COUNT ((DMADRV_MAX_XFER_COUNT) / BYTE_PER_PIXEL) - -#define SPI_CS_LOW(handle) \ - GPIO_PinOutClear(handle->portCs, handle->pinCs); -#define SPI_CS_HIGH(handle) \ - GPIO_PinOutSet(handle->portCs, handle->pinCs); - -#define SPI_DC_LOW() \ - GPIO_PinOutClear(HXD8357D_SPI_DC_PORT, HXD8357D_SPI_DC_PIN); -#define SPI_DC_HIGH() \ - GPIO_PinOutSet(HXD8357D_SPI_DC_PORT, HXD8357D_SPI_DC_PIN); - -static void hxd8357d_flush_area_transmit_callback( - struct SPIDRV_HandleData *handle, - Ecode_t transferStatus, - int itemsTransferred); - -static SPIDRV_Handle_t gspi_handle = NULL; - -// ----------------------------------------------------------------------------- -// Local Variables -// ----------------------------------------------------------------------------- -static bool color_swap_enabled = false; -static uint32_t gtotal_pixel = 0; -static uint32_t gpixel_transmit = 0; -static uint32_t gpixel_transmit_counter = 0; -static uint8_t *pColorBuffer = NULL; -static void (*flush_area_callback)(void *arg) = NULL; -static void *flush_area_callback_arg = NULL; - -static uint16_t dma_buffer[(DMADRV_MAX_XFER_COUNT + 1) / 2]; -static uint8_t *pColorSwap = NULL; - -static int _width; -static int _height; - -/***************************************************************************//** - * @brief - * Adafruit_SPITFT Send Command handles complete sending of commands and - * data. - * - * @param[in] command - * The Command Byte. - * @param[in] data - * A pointer to the Data bytes to send. - * @param[in] len - * The number of bytes we should send. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_INVALID_PARAMETER or SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_spi_send_command(uint8_t command, - const uint8_t *data, - uint8_t len) -{ - Ecode_t retVal; - - SPI_CS_LOW(gspi_handle); - SPI_DC_LOW(); - retVal = SPIDRV_MTransmitB(gspi_handle, &command, 1); - SPI_DC_HIGH(); - if (ECODE_OK != retVal) { - goto error; - } - - retVal = SPIDRV_MTransmitB(gspi_handle, data, len); - if (ECODE_OK != retVal) { - goto error; - } - - SPI_CS_HIGH(gspi_handle); - return SL_STATUS_OK; - error: - SPI_CS_HIGH(gspi_handle); - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Write a single command byte to the display. - * - * @param[in] cmd - * 8-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_spi_write_command(uint8_t cmd) -{ - SPI_DC_LOW(); - Ecode_t retVal = SPIDRV_MTransmitB(gspi_handle, &cmd, 1); - SPI_DC_HIGH(); - - return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Write a single command word to the display. - * - * @param[in] cmd - * 16-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_spi_write16(uint16_t data) -{ - uint8_t bytes[2]; - - bytes[0] = data >> 8; - bytes[1] = data & 0x00FF; - - Ecode_t retVal = SPIDRV_MTransmitB(gspi_handle, bytes, 2); - - return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Issue a series of pixels, all the same color. - * - * @param[in] color - * 16-bit pixel color in '565' RGB format. - * @param[in] len - * Number of pixels to draw. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_write_color(uint16_t color, uint32_t len) -{ - uint32_t i, n, size; - Ecode_t retVal; - - if (!len) { - return SL_STATUS_INVALID_PARAMETER; - } - for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { - if (n + MAX_XFER_PIXEL_COUNT <= len) { - size = MAX_XFER_PIXEL_COUNT; - } else { - size = len - n; - } - - for (i = 0; i < size; i++) { - dma_buffer[i] = color >> 8 | ((uint16_t)(color & 0xff) << 8); - } - retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); - if (ECODE_OK != retVal) { - goto error; - } - } - - return SL_STATUS_OK; - error: - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Issue a series of pixels from memory to the display. - * - * @param[in] colors - * Pointer to array of 16-bit pixel values in '565' RGB format. - * @param[in] len - * Number of elements in 'colors' array. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_INVALID_PARAMETER or SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_write_pixels(uint16_t *colors, - uint32_t len) -{ - uint32_t i, n, size; - Ecode_t retVal; - - if (!len) { - return SL_STATUS_INVALID_PARAMETER; - } - - for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { - if (n + MAX_XFER_PIXEL_COUNT <= len) { - size = MAX_XFER_PIXEL_COUNT; - } else { - size = len - n; - } - - for (i = 0; i < size; i++) { - dma_buffer[i] = *colors >> 8 | ((uint16_t)(*colors & 0xff) << 8); - colors++; - } - retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); - if (ECODE_OK != retVal) { - goto error; - } - } - - return SL_STATUS_OK; - error: - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * A lower-level version of adafruit_hxd8357d_fill_rect(). This version - * requires all inputs are in-bounds, that width and height are positive, - * and no part extends offscreen. NO EDGE CLIPPING OR REJECTION IS PERFORMED. - * If higher-level graphics primitives are written to handle their own - * clipping earlier in the drawing process, this can avoid unnecessary - * function calls and repeated clipping operations in the lower-level - * functions. - * - * @param[in] x - * Horizontal position of first corner. MUST BE WITHIN SCREEN BOUNDS. - * @param[in] y - * Vertical position of first corner. MUST BE WITHIN SCREEN BOUNDS. - * @param[in] w - * Rectangle width in pixels. MUST BE POSITIVE AND NOT EXTEND OFF SCREEN. - * @param[in] h - * Rectangle height in pixels. MUST BE POSITIVE AND NOT EXTEND OFF SCREEN. - * @param[in] color - * 16-bit fill color in '565' RGB format. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_write_fill_rect_preclipped(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) -{ - adafruit_hxd8357d_set_addr_window(x, y, w, h); - adafruit_hxd8357d_write_color(color, (uint32_t)w * h); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Draw a filled rectangle to the display. - * - * @param[in] x - * Horizontal position of first corner. - * @param[in] y - * Vertical position of first corner. - * @param[in] w - * Rectangle width in pixels (positive = right of first corner, - * negative = left of first corner). - * @param[in] h - * Rectangle height in pixels (positive = below first corner, - * negative = above first corner) - * @param[in] color - * 16-bit fill color in '565' RGB format. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_hxd8357d_fill_rect(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) -{ - if (w && h) { - if (w < 0) { - x += w + 1; - w = -w; - } - if (x < HXD8357D_TFTWIDTH) { - if (h < 0) { - y += h + 1; - h = -h; - } - if (y < HXD8357D_TFTHEIGHT) { - int16_t x2 = x + w - 1; - if (x2 >= 0) { - int16_t y2 = y + h - 1; - if (y2 >= 0) { - if (x < 0) { - x = 0; - w = x2 + 1; - } - if (y < 0) { - y = 0; - h = y2 + 1; - } - if (x2 >= HXD8357D_TFTWIDTH) { - w = HXD8357D_TFTWIDTH - x; - } - if (y2 >= HXD8357D_TFTHEIGHT) { - h = HXD8357D_TFTHEIGHT - y; - } - SPI_CS_LOW(gspi_handle); - adafruit_hxd8357d_write_fill_rect_preclipped(x, y, w, h, color); - SPI_CS_HIGH(gspi_handle); - } - } - } - } - } - - return SL_STATUS_OK; -} - -// ----------------------------------------------------------------------------- -// Public Function -// ----------------------------------------------------------------------------- - -/**************************************************************************//** - * Initialize the Adafruit 3.5" TFT LCD with Touchscreen. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_spi_dma_init(SPIDRV_Handle_t spidrv_handle) -{ - gspi_handle = spidrv_handle; - - GPIO_PinModeSet(SL_SPIDRV_HXD8357D_CS_PORT, - SL_SPIDRV_HXD8357D_CS_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(HXD8357D_SPI_DC_PORT, - HXD8357D_SPI_DC_PIN, - gpioModePushPull, - 0); - - static const uint8_t init_cmd[] = { - HXD8357D_SWRESET, - 0x80 + 100 / 5, // Soft reset, then delay 10 ms - HXD8357D_SETC, - 3, - 0xFF, - 0x83, - 0x57, - 0xFF, - 0x80 + 500 / 5, // No command, just delay 300 ms - HXD8357D_SETRGB, - 4, - 0x80, - 0x00, - 0x06, - 0x06, // 0x80 enables SDO pin (0x00 disables) - HXD8357D_SETCOM, - 1, - 0x25, // -1.52V - HXD8357D_SETOSC, - 1, - 0x68, // Normal mode 70Hz, Idle mode 55 Hz - HXD8357D_SETPANEL, - 1, - 0x05, // BGR, Gate direction swapped - HXD8357D_SETPWR1, - 6, - 0x00, // Not deep standby - 0x15, // BT - 0x1C, // VSPR - 0x1C, // VSNR - 0x83, // AP - 0xAA, // FS - HXD8357D_SETSTBA, - 6, - 0x50, // OPON normal - 0x50, // OPON idle - 0x01, // STBA - 0x3C, // STBA - 0x1E, // STBA - 0x08, // GEN - HXD8357D_SETCYC, - 7, - 0x02, // NW 0x02 - 0x40, // RTN - 0x00, // DIV - 0x2A, // DUM - 0x2A, // DUM - 0x0D, // GDON - 0x78, // GDOFF - HXD8357D_SETGAMMA, - 34, - 0x02, - 0x0A, - 0x11, - 0x1d, - 0x23, - 0x35, - 0x41, - 0x4b, - 0x4b, - 0x42, - 0x3A, - 0x27, - 0x1B, - 0x08, - 0x09, - 0x03, - 0x02, - 0x0A, - 0x11, - 0x1d, - 0x23, - 0x35, - 0x41, - 0x4b, - 0x4b, - 0x42, - 0x3A, - 0x27, - 0x1B, - 0x08, - 0x09, - 0x03, - 0x00, - 0x01, - HXD8357D_COLMOD, - 1, - 0x55, // 16 bit - HXD8357D_MADCTL, - 1, - 0xC0, - HXD8357D_TEON, - 1, - 0x00, // TW off - HXD8357D_TEARLINE, - 2, - 0x00, - 0x02, - HXD8357D_SLPOUT, - 0x80 + 150 / 5, // Exit Sleep, then delay 150 ms - HXD8357D_DISPON, - 0x80 + 50 / 5, // Main screen turn on, delay 50 ms - 0, // END OF COMMAND LIST - }; - - sl_sleeptimer_delay_millisecond(150); - - uint8_t cmd, x, numArgs; - const uint8_t *addr = init_cmd; - while ((cmd = pgm_read_byte(addr++)) > 0) { // '0' command ends list - x = pgm_read_byte(addr++); - numArgs = x & 0x7F; - if (cmd != 0xFF) { // '255' is ignored - if (x & 0x80) { // If high bit set, numArgs is a delay time - adafruit_hxd8357d_spi_send_command(cmd, NULL, 0); - } else { - adafruit_hxd8357d_spi_send_command(cmd, addr, numArgs); - addr += numArgs; - } - } - if (x & 0x80) { // If high bit set... - // numArgs is actually a delay time (5ms units) - sl_sleeptimer_delay_millisecond(numArgs * 5); - } - } - - _width = HXD8357D_TFTWIDTH; // Screen dimensions for default rotation 0 - _height = HXD8357D_TFTHEIGHT; - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * Set display rotation. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_set_rotation(uint8_t rotate) -{ - static uint8_t rotation = 0; - rotation = rotate & 3; // can't be higher than 3 - switch (rotation) { - case 0: - rotate = MADCTL_MX | MADCTL_MY | MADCTL_RGB; - _width = HXD8357D_TFTWIDTH; - _height = HXD8357D_TFTHEIGHT; - break; - case 1: - rotate = MADCTL_MV | MADCTL_MY | MADCTL_RGB; - _width = HXD8357D_TFTHEIGHT; - _height = HXD8357D_TFTWIDTH; - break; - case 2: - rotate = MADCTL_RGB; - _width = HXD8357D_TFTWIDTH; - _height = HXD8357D_TFTHEIGHT; - break; - case 3: - rotate = MADCTL_MX | MADCTL_MV | MADCTL_RGB; - _width = HXD8357D_TFTHEIGHT; - _height = HXD8357D_TFTWIDTH; - break; - } - - return adafruit_hxd8357d_spi_send_command(HXD8357D_MADCTL, &rotate, 1); -} - -/**************************************************************************//** - * Enable/Disable display color inversion. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_invert_display(bool invert) -{ - return adafruit_hxd8357d_spi_send_command( - invert ? HXD8357D_INVON : HXD8357D_INVOFF, NULL, 0); -} - -/**************************************************************************//** - * Set the "address window" - the rectangle we will write to RAM. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_set_addr_window(uint16_t x1, uint16_t y1, - uint16_t w, uint16_t h) -{ - static uint16_t old_x1 = 0xffff, old_x2 = 0xffff; - static uint16_t old_y1 = 0xffff, old_y2 = 0xffff; - uint16_t x2 = (x1 + w - 1), y2 = (y1 + h - 1); - uint16_t tmp[2]; - Ecode_t retVal; - - if ((x1 != old_x1) || (x2 != old_x2)) { - // Column address set - adafruit_hxd8357d_spi_write_command(HXD8357D_CASET); - tmp[0] = x1 >> 8 | ((uint16_t)(x1 & 0xff) << 8); - tmp[1] = x2 >> 8 | ((uint16_t)(x2 & 0xff) << 8); - retVal = SPIDRV_MTransmitB(gspi_handle, tmp, 4); - if (ECODE_OK != retVal) { - goto error; - } - old_x1 = x1; - old_x2 = x2; - } - if ((y1 != old_y1) || (y2 != old_y2)) { - // Row address set - adafruit_hxd8357d_spi_write_command(HXD8357D_PASET); - tmp[0] = y1 >> 8 | ((uint16_t)(y1 & 0xff) << 8); - tmp[1] = y2 >> 8 | ((uint16_t)(y2 & 0xff) << 8); - retVal = SPIDRV_MTransmitB(gspi_handle, tmp, 4); - if (ECODE_OK != retVal) { - goto error; - } - old_y1 = y1; - old_y2 = y2; - } - // Write to RAM - return adafruit_hxd8357d_spi_write_command(HXD8357D_RAMWR); - error: - return SL_STATUS_IO; -} - -/**************************************************************************//** - * Draw a single pixel to the display at requested coordinates. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_draw_pixel(int16_t x, int16_t y, uint16_t color) -{ - if ((x >= 0) && (x < HXD8357D_TFTWIDTH) && (y >= 0) - && (y < HXD8357D_TFTHEIGHT)) { - // THEN set up transaction (if needed) and draw... - SPI_CS_LOW(gspi_handle); - adafruit_hxd8357d_set_addr_window(x, y, 1, 1); - adafruit_hxd8357d_spi_write16(color); - SPI_CS_HIGH(gspi_handle); - - return SL_STATUS_OK; - } - return SL_STATUS_INVALID_PARAMETER; -} - -/**************************************************************************//** - * Fill the screen completely with one color. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_fill_screen(uint16_t color) -{ - return adafruit_hxd8357d_fill_rect(0, - 0, - HXD8357D_TFTWIDTH, - HXD8357D_TFTHEIGHT, - color); -} - -/**************************************************************************//** - * Draw a 16-bit image (565 RGB) at the specified (x,y) position. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_draw_rgb_bitmap(int16_t x, - int16_t y, - uint16_t *color, - int16_t w, - int16_t h) -{ - int16_t x2; - int16_t y2; - int16_t bx1 = 0; - int16_t by1 = 0; - int16_t save_w = w; - - if ((x >= HXD8357D_TFTWIDTH) - || (y >= HXD8357D_TFTHEIGHT) - || ((x2 = (x + w - 1)) < 0) - || ((y2 = (y + h - 1)) < 0)) { - return SL_STATUS_INVALID_PARAMETER; - } - if (x < 0) { - w += x; - bx1 = -x; - x = 0; - } - if (y < 0) { - h += y; - by1 = -y; - y = 0; - } - if (x2 >= HXD8357D_TFTWIDTH) { - w = HXD8357D_TFTWIDTH - x; - } - if (y2 >= HXD8357D_TFTHEIGHT) { - h = HXD8357D_TFTHEIGHT - y; - } - color += by1 * save_w + bx1; - SPI_CS_LOW(gspi_handle); - adafruit_hxd8357d_set_addr_window(x, y, w, h); - while (h--) { - adafruit_hxd8357d_write_pixels(color, w); - color += save_w; - } - SPI_CS_HIGH(gspi_handle); - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * Fill the screen area with color using SPI transmit DMA. After the process - * is complete call the user callback to notify the higher layer. - *****************************************************************************/ -sl_status_t adafruit_hxd8357d_flush_area_rgb565(int16_t x1, int16_t y1, - int16_t x2, int16_t y2, - uint8_t *pcolor, - bool color_swap, - void (*callback)(void *arg), - void *callback_arg) -{ - if ((pcolor != NULL) && (callback != NULL) - && (x1 >= 0) && (x1 < HXD8357D_TFTWIDTH) - && (x2 >= 0) && (x2 < HXD8357D_TFTWIDTH) - && (y1 >= 0) && (y1 < HXD8357D_TFTHEIGHT) - && (y2 >= 0) && (y2 < HXD8357D_TFTHEIGHT) - && (x2 >= x1) && (y2 >= y1)) { - uint16_t width = x2 - x1 + 1; - uint16_t hight = y2 - y1 + 1; - - SPI_CS_LOW(gspi_handle); - adafruit_hxd8357d_set_addr_window(x1, y1, width, hight); - - gtotal_pixel = width * hight; - gpixel_transmit = 0; - gpixel_transmit_counter = 0; - color_swap_enabled = color_swap; - flush_area_callback = callback; - flush_area_callback_arg = callback_arg; - - if (gpixel_transmit_counter < gtotal_pixel) { - uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; - gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT - ? MAX_XFER_PIXEL_COUNT : pixel_remaining; - - if (!color_swap_enabled) { - uint16_t i; - pColorSwap = pcolor; - uint8_t colorData_H; - uint8_t colorData_L; - - for (i = 0; i < gpixel_transmit; i++) { - colorData_H = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; - colorData_L = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; - - /* Swap 2 bytes color data before sending to TFT LCD */ - dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; - } - - pColorBuffer = (uint8_t *)dma_buffer; - } else { - pColorBuffer = (uint8_t *)pcolor; - } - - /* Start transmit data, the process is continued in - * adafruit_hxd8357d_flush_area_transmit_callback function - */ - - SPIDRV_MTransmit(gspi_handle, - (uint8_t *)pColorBuffer, - gpixel_transmit * BYTE_PER_PIXEL, - hxd8357d_flush_area_transmit_callback); - - if (color_swap_enabled) { - pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); - } - - gpixel_transmit_counter += gpixel_transmit; - } - - return SL_STATUS_OK; - } - return SL_STATUS_INVALID_PARAMETER; -} - -static void hxd8357d_flush_area_transmit_callback( - struct SPIDRV_HandleData *handle, - Ecode_t transferStatus, - int itemsTransferred) -{ - (void)itemsTransferred; - - if (handle == gspi_handle) { - if (transferStatus == ECODE_OK) { - if (gpixel_transmit_counter < gtotal_pixel) { - /* Continue transmit the data */ - uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; - gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT - ? MAX_XFER_PIXEL_COUNT : pixel_remaining; - - if (!color_swap_enabled) { - uint16_t i; - uint8_t colorData_H; - uint8_t colorData_L; - - for (i = 0; i < gpixel_transmit; i++) { - colorData_H = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; - colorData_L = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; - - /* Swap 2 bytes color data before sending to TFT LCD */ - dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; - } - - pColorBuffer = (uint8_t *)dma_buffer; - } - SPIDRV_MTransmit(gspi_handle, - (uint8_t *)pColorBuffer, - gpixel_transmit * BYTE_PER_PIXEL, - hxd8357d_flush_area_transmit_callback); - - if (color_swap_enabled) { - pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); - } - - gpixel_transmit_counter += gpixel_transmit; - } else { - /* After the process is complete call the user callback to - * notify the higher layer. - */ - SPI_CS_HIGH(gspi_handle); - - if (flush_area_callback != NULL) { - flush_area_callback(flush_area_callback_arg); - } - } - } - } -} diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_usart_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_usart_config.h rename to driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_config.h index a2a88041..a9319bca 100644 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ILI9341 SPI settings -// ILI9341 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ILI9341_SPI_BITRATE 40000000 +// ILI9341 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ILI9341_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ILI9341_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ILI9341_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -76,11 +88,11 @@ extern "C" // [USART_ADAFRUIT_ILI9341]$ -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 5 -// [GPIO_ILI9341_SPI_DC]$ +// ADAFRUIT_ILI9341_DC +// $[GPIO_ADAFRUIT_ILI9341_DC] +#define ADAFRUIT_ILI9341_DC_PORT gpioPortC +#define ADAFRUIT_ILI9341_DC_PIN 5 +// [GPIO_ADAFRUIT_ILI9341_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_dma_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_dma_config.h deleted file mode 100644 index cb61ce4e..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/adafruit_ili9341_spi_dma_config.h +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************//** - * @file adafruit_is31fl3741_config.h - * @brief Configuration file for Adafruit RGB LED Driver board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ILI9341_CONFIG_H_ -#define ADAFRUIT_ILI9341_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -// <<< sl:start pin_tool >>> - -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 5 -// [GPIO_ILI9341_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ILI9341_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/sl_spidrv_ili9341_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/sl_spidrv_ili9341_config.h deleted file mode 100644 index ffeabbae..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2601b/sl_spidrv_ili9341_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ILI9341_CONFIG_H -#define SL_SPIDRV_ILI9341_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ILI9341_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ILI9341_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ILI9341_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ILI9341_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ILI9341_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ILI9341_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ILI9341_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ILI9341 -// $[USART_SL_SPIDRV_ILI9341] -#define SL_SPIDRV_ILI9341_PERIPHERAL USART0 -#define SL_SPIDRV_ILI9341_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ILI9341_TX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_ILI9341_RX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_RX_PIN 2 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ILI9341_CLK_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CLK_PIN 1 - -// USART0 CS on PC03 -#define SL_SPIDRV_ILI9341_CS_PORT gpioPortA -#define SL_SPIDRV_ILI9341_CS_PIN 7 - -// [USART_SL_SPIDRV_ILI9341]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ILI9341_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_usart_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_usart_config.h rename to driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_config.h index 04af48bf..91267a2f 100644 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ILI9341 SPI settings -// ILI9341 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ILI9341_SPI_BITRATE 40000000 +// ILI9341 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ILI9341_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ILI9341_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ILI9341_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -76,11 +88,11 @@ extern "C" // [USART_ADAFRUIT_ILI9341]$ -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 8 -// [GPIO_ILI9341_SPI_DC]$ +// ADAFRUIT_ILI9341_DC +// $[GPIO_ADAFRUIT_ILI9341_DC] +#define ADAFRUIT_ILI9341_DC_PORT gpioPortC +#define ADAFRUIT_ILI9341_DC_PIN 8 +// [GPIO_ADAFRUIT_ILI9341_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_dma_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_dma_config.h deleted file mode 100644 index f938fde0..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/adafruit_ili9341_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_is31fl3741_config.h - * @brief Configuration file for Adafruit RGB LED Driver board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ILI9341_CONFIG_H_ -#define ADAFRUIT_ILI9341_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 8 -// [GPIO_ILI9341_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ILI9341_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/sl_spidrv_ili9341_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/sl_spidrv_ili9341_config.h deleted file mode 100644 index 185a423c..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2703a/sl_spidrv_ili9341_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ILI9341_CONFIG_H -#define SL_SPIDRV_ILI9341_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ILI9341_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ILI9341_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ILI9341_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ILI9341_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ILI9341_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ILI9341_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ILI9341_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ILI9341 -// $[USART_SL_SPIDRV_ILI9341] -#define SL_SPIDRV_ILI9341_PERIPHERAL USART0 -#define SL_SPIDRV_ILI9341_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ILI9341_TX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_ILI9341_RX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_RX_PIN 2 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ILI9341_CLK_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CLK_PIN 1 - -// USART0 CS on PC03 -#define SL_SPIDRV_ILI9341_CS_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CS_PIN 0 - -// [USART_SL_SPIDRV_ILI9341]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ILI9341_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_usart_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_usart_config.h rename to driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_config.h index af6c0f8f..76a17124 100644 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ILI9341 SPI settings -// ILI9341 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ILI9341_SPI_BITRATE 40000000 +// ILI9341 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ILI9341_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ILI9341_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ILI9341_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_ILI9341]$ -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 0 -// [GPIO_ILI9341_SPI_DC]$ +// ADAFRUIT_ILI9341_DC +// $[GPIO_ADAFRUIT_ILI9341_DC] +#define ADAFRUIT_ILI9341_DC_PORT gpioPortC +#define ADAFRUIT_ILI9341_DC_PIN 0 +// [GPIO_ADAFRUIT_ILI9341_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_dma_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_dma_config.h deleted file mode 100644 index ee4e2175..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/adafruit_ili9341_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_is31fl3741_config.h - * @brief Configuration file for Adafruit RGB LED Driver board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ILI9341_CONFIG_H_ -#define ADAFRUIT_ILI9341_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 0 -// [GPIO_ILI9341_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ILI9341_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/sl_spidrv_ili9341_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/sl_spidrv_ili9341_config.h deleted file mode 100644 index 93352b29..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd2704a/sl_spidrv_ili9341_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ILI9341_CONFIG_H -#define SL_SPIDRV_ILI9341_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ILI9341_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ILI9341_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ILI9341_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ILI9341_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ILI9341_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ILI9341_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ILI9341_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ILI9341 -// $[USART_SL_SPIDRV_ILI9341] -#define SL_SPIDRV_ILI9341_PERIPHERAL USART0 -#define SL_SPIDRV_ILI9341_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ILI9341_TX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_ILI9341_RX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_RX_PIN 6 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ILI9341_CLK_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_ILI9341_CS_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CS_PIN 1 - -// [USART_SL_SPIDRV_ILI9341]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ILI9341_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_usart_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_usart_config.h rename to driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_config.h index 3a990757..8551a2f7 100644 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ILI9341 SPI settings -// ILI9341 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ILI9341_SPI_BITRATE 40000000 +// ILI9341 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ILI9341_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ILI9341_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ILI9341_CS_CONTROL spidrvCsControlApplication // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_ILI9341]$ -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 6 -// [GPIO_ILI9341_SPI_DC]$ +// ADAFRUIT_ILI9341_DC +// $[GPIO_ADAFRUIT_ILI9341_DC] +#define ADAFRUIT_ILI9341_DC_PORT gpioPortC +#define ADAFRUIT_ILI9341_DC_PIN 6 +// [GPIO_ADAFRUIT_ILI9341_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_dma_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_dma_config.h deleted file mode 100644 index 34ccf304..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_is31fl3741_config.h - * @brief Configuration file for Adafruit RGB LED Driver board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ILI9341_CONFIG_H_ -#define ADAFRUIT_ILI9341_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 6 -// [GPIO_ILI9341_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ILI9341_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/sl_spidrv_ili9341_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/sl_spidrv_ili9341_config.h deleted file mode 100644 index 54be090c..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/sl_spidrv_ili9341_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ILI9341_CONFIG_H -#define SL_SPIDRV_ILI9341_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ILI9341_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ILI9341_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ILI9341_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ILI9341_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ILI9341_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ILI9341_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ILI9341_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ILI9341 -// $[USART_SL_SPIDRV_ILI9341] -#define SL_SPIDRV_ILI9341_PERIPHERAL USART0 -#define SL_SPIDRV_ILI9341_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ILI9341_TX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_ILI9341_RX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ILI9341_CLK_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_ILI9341_CS_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CS_PIN 3 - -// [USART_SL_SPIDRV_ILI9341]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ILI9341_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_usart_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_usart_config.h rename to driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_config.h index 3a990757..bb5daf58 100644 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd4108a/adafruit_ili9341_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ILI9341 SPI settings -// ILI9341 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ILI9341_SPI_BITRATE 40000000 +// ILI9341 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ILI9341_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ILI9341_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ILI9341_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_ILI9341]$ -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 6 -// [GPIO_ILI9341_SPI_DC]$ +// ADAFRUIT_ILI9341_DC +// $[GPIO_ADAFRUIT_ILI9341_DC] +#define ADAFRUIT_ILI9341_DC_PORT gpioPortC +#define ADAFRUIT_ILI9341_DC_PIN 6 +// [GPIO_ADAFRUIT_ILI9341_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_dma_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_dma_config.h deleted file mode 100644 index 34ccf304..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/adafruit_ili9341_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_is31fl3741_config.h - * @brief Configuration file for Adafruit RGB LED Driver board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ILI9341_CONFIG_H_ -#define ADAFRUIT_ILI9341_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#define ILI9341_SPI_DC_PORT gpioPortC -#define ILI9341_SPI_DC_PIN 6 -// [GPIO_ILI9341_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ILI9341_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/sl_spidrv_ili9341_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/sl_spidrv_ili9341_config.h deleted file mode 100644 index 54be090c..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/brd4314a/sl_spidrv_ili9341_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ILI9341_CONFIG_H -#define SL_SPIDRV_ILI9341_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ILI9341_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ILI9341_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ILI9341_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ILI9341_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ILI9341_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ILI9341_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ILI9341_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ILI9341 -// $[USART_SL_SPIDRV_ILI9341] -#define SL_SPIDRV_ILI9341_PERIPHERAL USART0 -#define SL_SPIDRV_ILI9341_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ILI9341_TX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_ILI9341_RX_PORT gpioPortC -#define SL_SPIDRV_ILI9341_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ILI9341_CLK_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_ILI9341_CS_PORT gpioPortC -#define SL_SPIDRV_ILI9341_CS_PIN 3 - -// [USART_SL_SPIDRV_ILI9341]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ILI9341_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_ili9341/config/brd4338a/adafruit_ili9341_spi_config.h b/driver/public/silabs/tft_lcd_ili9341/config/brd4338a/adafruit_ili9341_spi_config.h new file mode 100644 index 00000000..cc85e192 --- /dev/null +++ b/driver/public/silabs/tft_lcd_ili9341/config/brd4338a/adafruit_ili9341_spi_config.h @@ -0,0 +1,82 @@ +/***************************************************************************//** + * @file adafruit_ili9341_spi_usart_config.h + * @brief Configuration file for Adafruit TFT Display Driver. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ +#ifndef ADAFRUIT_ILI9341_CONFIG_H_ +#define ADAFRUIT_ILI9341_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// ST7789 SPI settings + +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ILI9341_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ILI9341_CLOCK_MODE SL_GSPI_MODE_0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ILI9341_CS_CONTROL SL_GSPI_MASTER_HW_OUTPUT +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ADAFRUIT_ILI9341_DC +// $[GPIO_ADAFRUIT_ILI9341_DC] +#ifndef ADAFRUIT_ILI9341_DC_PORT +#define ADAFRUIT_ILI9341_DC_PORT HP +#endif +#ifndef ADAFRUIT_ILI9341_DC_PIN +#define ADAFRUIT_ILI9341_DC_PIN 47 +#endif +// [GPIO_ADAFRUIT_ILI9341_DC]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +extern "C" +} +#endif + +#endif /* ADAFRUIT_ILI9341_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_usart_config.h b/driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_config.h similarity index 74% rename from driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_usart_config.h rename to driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_config.h index 117899fa..4882c8b4 100644 --- a/driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ILI9341 SPI settings -// ILI9341 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ILI9341_SPI_BITRATE 40000000 +// ILI9341 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ILI9341_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ILI9341_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ILI9341_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -57,10 +69,10 @@ extern "C" #warning "ILI9341 SPI Peripheral not configured" // [USART_ADAFRUIT_ILI9341]$ -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] +// ADAFRUIT_ILI9341_DC +// $[GPIO_ADAFRUIT_ILI9341_DC] #warning "ILI9341 SPI DC Pin not configured" -// [GPIO_ILI9341_SPI_DC]$ +// [GPIO_ADAFRUIT_ILI9341_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_dma_config.h b/driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_dma_config.h deleted file mode 100644 index 829851e2..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/other/adafruit_ili9341_spi_dma_config.h +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************//** - * @file adafruit_is31fl3741_config.h - * @brief Configuration file for Adafruit RGB LED Driver board. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ILI9341_CONFIG_H_ -#define ADAFRUIT_ILI9341_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ILI9341_SPI_DC -// $[GPIO_ILI9341_SPI_DC] -#warning "ILI9341 SPI DC Pin not configured" -// [GPIO_ILI9341_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ILI9341_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_ili9341/config/other/sl_spidrv_ili9341_config.h b/driver/public/silabs/tft_lcd_ili9341/config/other/sl_spidrv_ili9341_config.h deleted file mode 100644 index 5bda0ab8..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/config/other/sl_spidrv_ili9341_config.h +++ /dev/null @@ -1,85 +0,0 @@ -/***************************************************************************//** - * @file - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ILI9341_CONFIG_H -#define SL_SPIDRV_ILI9341_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ILI9341_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ILI9341_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ILI9341_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ILI9341_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ILI9341_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ILI9341_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ILI9341_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ILI9341 -// $[USART_SL_SPIDRV_ILI9341] -#warning "ILI9341 SPI Peripheral not configured" -// [USART_SL_SPIDRV_ILI9341]$ - -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ILI9341_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_ili9341/inc/adafruit_ili9341.h b/driver/public/silabs/tft_lcd_ili9341/inc/adafruit_ili9341.h index 5bbbaea4..c6d39806 100644 --- a/driver/public/silabs/tft_lcd_ili9341/inc/adafruit_ili9341.h +++ b/driver/public/silabs/tft_lcd_ili9341/inc/adafruit_ili9341.h @@ -46,6 +46,8 @@ #include #include "sl_status.h" #include "sl_component_catalog.h" +#include "mipi_dbi.h" +#include "mipi_dbi_spi.h" #ifdef __cplusplus extern "C" { @@ -153,16 +155,10 @@ typedef void (*adafruit_ili9341_dma_complete_callback_t)(sl_status_t status); * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_PRESENT) -sl_status_t adafruit_ili9341_spi_usart_init(void); +sl_status_t adafruit_ili9341_device_init(const struct mipi_dbi_config *config); -#define adafruit_ili9341_init adafruit_ili9341_spi_usart_init -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_DMA_PRESENT) -#include "spidrv.h" -sl_status_t adafruit_ili9341_spi_dma_init(SPIDRV_Handle_t spidrv_handle); - -#define adafruit_ili9341_init adafruit_ili9341_spi_dma_init -#endif +#define adafruit_ili9341_init(config) \ + adafruit_ili9341_device_init((const struct mipi_dbi_config *)config) /***************************************************************************//** * @brief diff --git a/driver/public/silabs/tft_lcd_ili9341/src/adafruit_ili9341.c b/driver/public/silabs/tft_lcd_ili9341/src/adafruit_ili9341.c index f7c93b4e..f4c140d6 100644 --- a/driver/public/silabs/tft_lcd_ili9341/src/adafruit_ili9341.c +++ b/driver/public/silabs/tft_lcd_ili9341/src/adafruit_ili9341.c @@ -39,20 +39,9 @@ // ----------------------------------------------------------------------------- // Includes // ----------------------------------------------------------------------------- -#include "em_cmu.h" -#include "em_gpio.h" #include "sl_status.h" #include "sl_sleeptimer.h" #include "sl_component_catalog.h" -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_PRESENT) -#include "em_usart.h" -#include "adafruit_ili9341_spi_usart_config.h" -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_DMA_PRESENT) -#include "spidrv.h" -#include "adafruit_ili9341_spi_dma_config.h" -#include "sl_spidrv_ili9341_config.h" -#endif - #include "adafruit_ili9341.h" // ----------------------------------------------------------------------------- @@ -66,93 +55,92 @@ b = t; \ } -#define SPI_CS_LOW() \ - GPIO_PinOutClear(ADAFRUIT_ILI9341_CS_PORT, ADAFRUIT_ILI9341_CS_PIN); -#define SPI_CS_HIGH() \ - GPIO_PinOutSet(ADAFRUIT_ILI9341_CS_PORT, ADAFRUIT_ILI9341_CS_PIN); +#define BYTE_PER_PIXEL (2) /* 2 Bytes color data per pixel */ +#define MAX_XFER_PIXEL_COUNT \ + (MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX / BYTE_PER_PIXEL) -#define SPI_DC_LOW() \ - GPIO_PinOutClear(ILI9341_SPI_DC_PORT, ILI9341_SPI_DC_PIN); -#define SPI_DC_HIGH() \ - GPIO_PinOutSet(ILI9341_SPI_DC_PORT, ILI9341_SPI_DC_PIN); +// ----------------------------------------------------------------------------- +// Local Variables +// ----------------------------------------------------------------------------- +static bool color_swap_enabled = false; +static uint32_t gtotal_pixel = 0; +static uint32_t gpixel_transmit = 0; +static uint32_t gpixel_transmit_counter = 0; +static uint8_t *pColorBuffer = NULL; +static void (*flush_area_callback)(void *arg) = NULL; +static void *flush_area_callback_arg = NULL; +static uint8_t *pColorSwap = NULL; -/***************************************************************************//** - * @brief - * Adafruit_SPITFT Send Command handles complete sending of commands and - * data. - * - * @param[in] command - * The Command Byte. - * @param[in] data - * A pointer to the Data bytes to send. - * @param[in] len - * The number of bytes we should send. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_spi_send_command(uint8_t command, - uint8_t *data, - uint8_t len) +static uint16_t dma_buffer[MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX / 2]; + +static struct mipi_dbi_device mipi_dbi_device; + +static sl_status_t command_write(uint8_t cmd) { - SPI_CS_LOW(); - SPI_DC_LOW(); - USART_SpiTransfer(ADAFRUIT_ILI9341_PERIPHERAL, command); - if (len != 0) { - SPI_DC_HIGH(); - while (len--) { - USART_SpiTransfer(ADAFRUIT_ILI9341_PERIPHERAL, *data); - data++; - } - } - SPI_CS_HIGH(); + return mipi_dbi_device.api->command_write( + &mipi_dbi_device, + cmd, + NULL, 0); +} - return SL_STATUS_OK; +static sl_status_t write_display(const void *framebuf, + size_t framebuf_len, + mipi_dbi_transfer_complete_callback_t callback) +{ + struct mipi_dbi_display_buffer_descriptor desc; + + desc.buf_size = framebuf_len; + + return mipi_dbi_device.api->write_display( + &mipi_dbi_device, + (const uint8_t *)framebuf, + &desc, + PIXEL_FORMAT_RGB_565, + callback); } -/***************************************************************************//** - * @brief - * Write a single command byte to the display. - * - * @param[in] cmd - * 8-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_spi_write_command(uint8_t cmd) +static sl_status_t write_display16(uint16_t data) { - SPI_DC_LOW(); - USART_SpiTransfer(ADAFRUIT_ILI9341_PERIPHERAL, cmd); - SPI_DC_HIGH(); + struct mipi_dbi_display_buffer_descriptor desc; + uint8_t bytes[2]; - return SL_STATUS_OK; + bytes[0] = data >> 8; + bytes[1] = data & 0x00FF; + + desc.buf_size = 2; + + return mipi_dbi_device.api->write_display( + &mipi_dbi_device, + bytes, + &desc, + PIXEL_FORMAT_RGB_565, + NULL); } /***************************************************************************//** * @brief - * Write a single command word to the display. + * Adafruit_SPITFT Send Command handles complete sending of commands and + * data. * - * @param[in] cmd - * 16-bit command to write. + * @param[in] command + * The Command Byte. + * @param[in] data + * A pointer to the Data bytes to send. + * @param[in] len + * The number of bytes we should send. * * @return * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -static sl_status_t adafruit_ili9341_spi_write16(uint16_t data) +static sl_status_t send_command(uint8_t command, + const uint8_t *data, + uint8_t len) { - uint8_t bytes[2]; - - bytes[0] = data >> 8; - bytes[1] = data & 0x00FF; - - USART_SpiTransfer(ADAFRUIT_ILI9341_PERIPHERAL, bytes[0]); - USART_SpiTransfer(ADAFRUIT_ILI9341_PERIPHERAL, bytes[1]); - - return SL_STATUS_OK; + return mipi_dbi_device.api->command_write( + &mipi_dbi_device, + command, + data, len); } /***************************************************************************//** @@ -174,15 +162,21 @@ static sl_status_t adafruit_ili9341_spi_read_command8(uint8_t *result, uint8_t command, uint8_t index) { - SPI_CS_LOW(); - SPI_DC_LOW(); - USART_SpiTransfer(ADAFRUIT_ILI9341_PERIPHERAL, command); - SPI_DC_HIGH(); + sl_status_t status; + + status = command_write(command); + if (SL_STATUS_OK != status) { + return status; + } do { - *result = USART_SpiTransfer(ADAFRUIT_ILI9341_PERIPHERAL, 0x00); + status = mipi_dbi_device.api->command_read( + &mipi_dbi_device, + NULL, 0, + result, 1); + if (SL_STATUS_OK != status) { + return status; + } } while (index--); // Discard bytes up to index'th - SPI_CS_HIGH(); - return SL_STATUS_OK; } @@ -201,11 +195,38 @@ static sl_status_t adafruit_ili9341_spi_read_command8(uint8_t *result, ******************************************************************************/ static sl_status_t adafruit_ili9341_write_color(uint16_t color, uint32_t len) { - while (len--) { - adafruit_ili9341_spi_write16(color); + uint32_t i, n, size; + sl_status_t status; + + if (!len) { + return SL_STATUS_INVALID_PARAMETER; + } + for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { + if (n + MAX_XFER_PIXEL_COUNT <= len) { + size = MAX_XFER_PIXEL_COUNT; + } else { + size = len - n; + } + + for (i = 0; i < size; i++) { + dma_buffer[i] = color >> 8 | ((uint16_t)(color & 0xff) << 8); + } +// retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); +// if (ECODE_OK != retVal) { +// goto error; +// } + + status = write_display(dma_buffer, + size * 2, + NULL); + if (SL_STATUS_OK != status) { + goto error; + } } return SL_STATUS_OK; + error: + return SL_STATUS_IO; } /***************************************************************************//** @@ -223,15 +244,39 @@ static sl_status_t adafruit_ili9341_write_color(uint16_t color, uint32_t len) ******************************************************************************/ static sl_status_t adafruit_ili9341_write_pixels(uint16_t *colors, uint32_t len) { + uint32_t i, n, size; + sl_status_t status; + if (!len) { return SL_STATUS_INVALID_PARAMETER; } - while (len--) { - adafruit_ili9341_spi_write16(*colors); - colors++; + for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { + if (n + MAX_XFER_PIXEL_COUNT <= len) { + size = MAX_XFER_PIXEL_COUNT; + } else { + size = len - n; + } + + for (i = 0; i < size; i++) { + dma_buffer[i] = *colors >> 8 | ((uint16_t)(*colors & 0xff) << 8); + colors++; + } +// retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); +// if (ECODE_OK != retVal) { +// goto error; +// } + status = write_display(dma_buffer, + size * 2, + NULL); + if (SL_STATUS_OK != status) { + goto error; + } } + return SL_STATUS_OK; + error: + return SL_STATUS_IO; } /***************************************************************************//** @@ -327,9 +372,7 @@ static sl_status_t adafruit_ili9341_fill_rect(int16_t x, if (y2 >= ILI9341_TFTHEIGHT) { h = ILI9341_TFTHEIGHT - y; } - SPI_CS_LOW(); adafruit_ili9341_write_fill_rect_preclipped(x, y, w, h, color); - SPI_CS_HIGH(); } } } @@ -339,82 +382,6 @@ static sl_status_t adafruit_ili9341_fill_rect(int16_t x, return SL_STATUS_OK; } -static void spi_usart_init(void) -{ - USART_InitSync_TypeDef usartInit = USART_INITSYNC_DEFAULT; - - usartInit.msbf = true; - usartInit.clockMode = usartClockMode0; - usartInit.master = true; - usartInit.baudrate = ADAFRUIT_ILI9341_SPI_BITRATE; - -#if defined(_CMU_HFPERCLKEN0_MASK) - CMU_ClockEnable(cmuClock_HFPER, true); -#endif - CMU_ClockEnable(cmuClock_GPIO, true); -#if ADAFRUIT_ILI9341_PERIPHERAL_NO == 0 - CMU_ClockEnable(cmuClock_USART0, true); -#elif ADAFRUIT_ILI9341_PERIPHERAL_NO == 1 - CMU_ClockEnable(cmuClock_USART1, true); -#elif ADAFRUIT_ILI9341_PERIPHERAL_NO == 2 - CMU_ClockEnable(cmuClock_USART2, true); -#endif - - usartInit.databits = usartDatabits8; - USART_InitSync(ADAFRUIT_ILI9341_PERIPHERAL, &usartInit); - -#if defined(USART_ROUTEPEN_TXPEN) - ADAFRUIT_ILI9341_PERIPHERAL->ROUTELOC0 = - (ADAFRUIT_ILI9341_PERIPHERAL->ROUTELOC0 - & ~(_USART_ROUTELOC0_TXLOC_MASK - | _USART_ROUTELOC0_RXLOC_MASK - | _USART_ROUTELOC0_CLKLOC_MASK)) - | (ADAFRUIT_ILI9341_TX_LOC << _USART_ROUTELOC0_TXLOC_SHIFT) - | (ADAFRUIT_ILI9341_RX_LOC << _USART_ROUTELOC0_RXLOC_SHIFT) - | (ADAFRUIT_ILI9341_CLK_LOC << _USART_ROUTELOC0_CLKLOC_SHIFT); - - ADAFRUIT_ILI9341_PERIPHERAL->ROUTEPEN = USART_ROUTEPEN_TXPEN - | USART_ROUTEPEN_RXPEN - | USART_ROUTEPEN_CLKPEN - | USART_ROUTEPEN_CSPEN; -#else - GPIO->USARTROUTE[ADAFRUIT_ILI9341_PERIPHERAL_NO].ROUTEEN = - GPIO_USART_ROUTEEN_TXPEN - | GPIO_USART_ROUTEEN_RXPEN - | GPIO_USART_ROUTEEN_CLKPEN; - GPIO->USARTROUTE[ADAFRUIT_ILI9341_PERIPHERAL_NO].TXROUTE = - ((uint32_t)ADAFRUIT_ILI9341_TX_PORT << _GPIO_USART_TXROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_ILI9341_TX_PIN << _GPIO_USART_TXROUTE_PIN_SHIFT); - GPIO->USARTROUTE[ADAFRUIT_ILI9341_PERIPHERAL_NO].RXROUTE = - ((uint32_t)ADAFRUIT_ILI9341_RX_PORT << _GPIO_USART_RXROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_ILI9341_RX_PIN << _GPIO_USART_RXROUTE_PIN_SHIFT); - GPIO->USARTROUTE[ADAFRUIT_ILI9341_PERIPHERAL_NO].CLKROUTE = - ((uint32_t)ADAFRUIT_ILI9341_CLK_PORT << _GPIO_USART_CLKROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_ILI9341_CLK_PIN << _GPIO_USART_CLKROUTE_PIN_SHIFT); -#endif - - GPIO_PinModeSet(ADAFRUIT_ILI9341_TX_PORT, - ADAFRUIT_ILI9341_TX_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ADAFRUIT_ILI9341_RX_PORT, - ADAFRUIT_ILI9341_RX_PIN, - gpioModeInput, - 0); - GPIO_PinModeSet(ADAFRUIT_ILI9341_CLK_PORT, - ADAFRUIT_ILI9341_CLK_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ADAFRUIT_ILI9341_CS_PORT, - ADAFRUIT_ILI9341_CS_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ILI9341_SPI_DC_PORT, - ILI9341_SPI_DC_PIN, - gpioModePushPull, - 0); -} - // ----------------------------------------------------------------------------- // Public Function // ----------------------------------------------------------------------------- @@ -422,9 +389,11 @@ static void spi_usart_init(void) /**************************************************************************//** * Initialize the Adafruit 2.4" TFT LCD with Touchscreen. *****************************************************************************/ -sl_status_t adafruit_ili9341_spi_usart_init(void) +sl_status_t adafruit_ili9341_device_init(const struct mipi_dbi_config *config) { - static uint8_t init_cmd[] = { + mipi_dbi_device_init(&mipi_dbi_device, config); + + static const uint8_t init_cmd[] = { 0xEF, 3, 0x03, 0x80, 0x02, 0xCF, 3, 0x00, 0xC1, 0x30, 0xED, 4, 0x64, 0x03, 0x12, 0x81, @@ -451,18 +420,15 @@ sl_status_t adafruit_ili9341_spi_usart_init(void) ILI9341_DISPON, 0x80, // Display on 0x00 }; - - spi_usart_init(); - - adafruit_ili9341_spi_send_command(ILI9341_SWRESET, NULL, 0); + send_command(ILI9341_SWRESET, NULL, 0); sl_sleeptimer_delay_millisecond(150); uint8_t cmd, x, num_args; - uint8_t *addr = init_cmd; + const uint8_t *addr = init_cmd; while ((cmd = pgm_read_byte(addr++)) > 0) { x = pgm_read_byte(addr++); num_args = x & 0x7F; - adafruit_ili9341_spi_send_command(cmd, addr, num_args); + send_command(cmd, addr, num_args); addr += num_args; if (x & 0x80) { sl_sleeptimer_delay_millisecond(150); @@ -477,7 +443,7 @@ sl_status_t adafruit_ili9341_spi_usart_init(void) *****************************************************************************/ sl_status_t adafruit_ili9341_invert_display(bool invert) { - return adafruit_ili9341_spi_send_command( + return send_command( invert ? ILI9341_INVON : ILI9341_INVOFF, NULL, 0); } @@ -491,7 +457,7 @@ sl_status_t adafruit_ili9341_scroll_to(uint16_t y) data[0] = y >> 8; data[1] = y & 0xff; - return adafruit_ili9341_spi_send_command(ILI9341_VSCRSADD, data, 2); + return send_command(ILI9341_VSCRSADD, data, 2); } /**************************************************************************//** @@ -508,7 +474,7 @@ sl_status_t adafruit_ili9341_set_scroll_margins(uint16_t top, uint16_t bottom) data[3] = middle & 0xff; data[4] = bottom >> 8; data[5] = bottom & 0xff; - return adafruit_ili9341_spi_send_command(ILI9341_VSCRDEF, data, 6); + return send_command(ILI9341_VSCRDEF, data, 6); } else { return SL_STATUS_INVALID_PARAMETER; } @@ -523,25 +489,35 @@ sl_status_t adafruit_ili9341_set_addr_window(uint16_t x1, uint16_t y1, static uint16_t old_x1 = 0xffff, old_x2 = 0xffff; static uint16_t old_y1 = 0xffff, old_y2 = 0xffff; uint16_t x2 = (x1 + w - 1), y2 = (y1 + h - 1); + uint16_t tmp[2]; + sl_status_t status; if ((x1 != old_x1) || (x2 != old_x2)) { // Column address set - adafruit_ili9341_spi_write_command(ILI9341_CASET); - adafruit_ili9341_spi_write16(x1); - adafruit_ili9341_spi_write16(x2); + tmp[0] = x1 >> 8 | ((uint16_t)(x1 & 0xff) << 8); + tmp[1] = x2 >> 8 | ((uint16_t)(x2 & 0xff) << 8); + status = send_command(ILI9341_CASET, + (const uint8_t *)tmp, 4); + if (SL_STATUS_OK != status) { + return status; + } old_x1 = x1; old_x2 = x2; } if ((y1 != old_y1) || (y2 != old_y2)) { // Row address set - adafruit_ili9341_spi_write_command(ILI9341_PASET); - adafruit_ili9341_spi_write16(y1); - adafruit_ili9341_spi_write16(y2); + tmp[0] = y1 >> 8 | ((uint16_t)(y1 & 0xff) << 8); + tmp[1] = y2 >> 8 | ((uint16_t)(y2 & 0xff) << 8); + status = send_command(ILI9341_PASET, + (const uint8_t *)tmp, 4); + if (SL_STATUS_OK != status) { + return status; + } old_y1 = y1; old_y2 = y2; } // Write to RAM - return adafruit_ili9341_spi_write_command(ILI9341_RAMWR); + return command_write(ILI9341_RAMWR); } /**************************************************************************//** @@ -554,7 +530,7 @@ sl_status_t adafruit_ili9341_read_command8(uint8_t *result, uint8_t data = 0x10 + index; // Set Index Register - adafruit_ili9341_spi_send_command(0xD9, &data, 1); + send_command(0xD9, &data, 1); adafruit_ili9341_spi_read_command8(result, command, 0); return SL_STATUS_OK; @@ -568,10 +544,8 @@ sl_status_t adafruit_ili9341_draw_pixel(int16_t x, int16_t y, uint16_t color) if ((x >= 0) && (x < ILI9341_TFTWIDTH) && (y >= 0) && (y < ILI9341_TFTHEIGHT)) { // THEN set up transaction (if needed) and draw... - SPI_CS_LOW(); adafruit_ili9341_set_addr_window(x, y, 1, 1); - adafruit_ili9341_spi_write16(color); - SPI_CS_HIGH(); + write_display16(color); return SL_STATUS_OK; } @@ -628,21 +602,15 @@ sl_status_t adafruit_ili9341_draw_rgb_bitmap(int16_t x, h = ILI9341_TFTHEIGHT - y; } color += by1 * save_w + bx1; - SPI_CS_LOW(); adafruit_ili9341_set_addr_window(x, y, w, h); while (h--) { adafruit_ili9341_write_pixels(color, w); color += save_w; } - SPI_CS_HIGH(); return SL_STATUS_OK; } -/**************************************************************************//** - * Fill the screen area with color. After the process - * is complete call the user callback to notify the higher layer. - *****************************************************************************/ sl_status_t adafruit_ili9341_flush_area_rgb565(int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t *pcolor, @@ -650,37 +618,73 @@ sl_status_t adafruit_ili9341_flush_area_rgb565(int16_t x1, int16_t y1, void (*callback)(void *arg), void *callback_arg) { - sl_status_t sc = SL_STATUS_FAIL; + sl_status_t status; - if ((pcolor == NULL) || (callback == NULL)) { - return SL_STATUS_INVALID_PARAMETER; - } - - if ((x1 >= 0) && (x1 < ILI9341_TFTWIDTH) + if ((pcolor != NULL) && (callback != NULL) + && (x1 >= 0) && (x1 < ILI9341_TFTWIDTH) && (x2 >= 0) && (x2 < ILI9341_TFTWIDTH) && (y1 >= 0) && (y1 < ILI9341_TFTHEIGHT) && (y2 >= 0) && (y2 < ILI9341_TFTHEIGHT) && (x2 >= x1) && (y2 >= y1)) { - uint16_t *p_color = (uint16_t *)pcolor; + uint16_t width = x2 - x1 + 1; + uint16_t hight = y2 - y1 + 1; + + adafruit_ili9341_set_addr_window(x1, y1, width, hight); + + gtotal_pixel = width * hight; + gpixel_transmit = 0; + gpixel_transmit_counter = 0; + color_swap_enabled = color_swap; + flush_area_callback = callback; + flush_area_callback_arg = callback_arg; + + while (gpixel_transmit_counter < gtotal_pixel) { + uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; + gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT + ? MAX_XFER_PIXEL_COUNT : pixel_remaining; + + if (!color_swap_enabled) { + uint16_t i; + pColorSwap = pcolor; + uint8_t colorData_H; + uint8_t colorData_L; + + for (i = 0; i < gpixel_transmit; i++) { + colorData_H = + pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; + colorData_L = + pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; + + /* Swap 2 bytes color data before sending to TFT LCD */ + dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; + } - for (int16_t y = y1; y <= y2; y++) { - for (int16_t x = x1; x <= x2; x++) { - uint16_t color; + pColorBuffer = (uint8_t *)dma_buffer; + } else { + pColorBuffer = (uint8_t *)pcolor; + } - if (color_swap) { - color = *p_color >> 8 | ((uint16_t)(*p_color & 0xff) << 8); - } else { - color = *p_color; - } - sc = adafruit_ili9341_draw_pixel(x, y, color); - if (SL_STATUS_OK != sc) { - goto end; - } - p_color++; + /* Start transmit data, the process is continued in + * adafruit_ili9341_flush_area_transmit_callback function + */ + status = write_display((uint8_t *)pColorBuffer, + gpixel_transmit * BYTE_PER_PIXEL, + NULL); + if (SL_STATUS_OK != status) { + goto error; + } + + if (color_swap_enabled) { + pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); } + + gpixel_transmit_counter += gpixel_transmit; } + callback(callback_arg); + return SL_STATUS_OK; } - end: + return SL_STATUS_INVALID_PARAMETER; + error: callback(callback_arg); - return sc; + return status; } diff --git a/driver/public/silabs/tft_lcd_ili9341/src/adafruit_ili9341_dma.c b/driver/public/silabs/tft_lcd_ili9341/src/adafruit_ili9341_dma.c deleted file mode 100644 index 806cac4b..00000000 --- a/driver/public/silabs/tft_lcd_ili9341/src/adafruit_ili9341_dma.c +++ /dev/null @@ -1,795 +0,0 @@ -/***************************************************************************//** - * @file adafruit_ili9341.c - * @brief Adafruit ILI9341 TFT LCD with Touchscreen Source File - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- -#include "em_cmu.h" -#include "em_gpio.h" -#include "sl_status.h" -#include "sl_sleeptimer.h" -#include "sl_component_catalog.h" -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_PRESENT) -#include "em_usart.h" -#include "adafruit_ili9341_spi_usart_config.h" -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ILI9341_DMA_PRESENT) -#include "spidrv.h" -#include "adafruit_ili9341_spi_dma_config.h" -#include "sl_spidrv_ili9341_config.h" -#endif - -#include "adafruit_ili9341.h" - -// ----------------------------------------------------------------------------- -// Macros -// ----------------------------------------------------------------------------- -#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) -#define _swap_int16_t(a, b) \ - { \ - int16_t t = a; \ - a = b; \ - b = t; \ - } - -#define BYTE_PER_PIXEL (2) /* 2 Bytes color data per pixel */ -#define MAX_XFER_PIXEL_COUNT ((DMADRV_MAX_XFER_COUNT) / BYTE_PER_PIXEL) - -#define SPI_CS_LOW(handle) \ - GPIO_PinOutClear(handle->portCs, handle->pinCs); -#define SPI_CS_HIGH(handle) \ - GPIO_PinOutSet(handle->portCs, handle->pinCs); - -#define SPI_DC_LOW() \ - GPIO_PinOutClear(ILI9341_SPI_DC_PORT, ILI9341_SPI_DC_PIN); -#define SPI_DC_HIGH() \ - GPIO_PinOutSet(ILI9341_SPI_DC_PORT, ILI9341_SPI_DC_PIN); - -static void ili9341_flush_area_transmit_callback( - struct SPIDRV_HandleData *handle, - Ecode_t transferStatus, - int itemsTransferred); - -static SPIDRV_Handle_t gspi_handle = NULL; - -// ----------------------------------------------------------------------------- -// Local Variables -// ----------------------------------------------------------------------------- -static bool color_swap_enabled = false; -static uint32_t gtotal_pixel = 0; -static uint32_t gpixel_transmit = 0; -static uint32_t gpixel_transmit_counter = 0; -static uint8_t *pColorBuffer = NULL; -static void (*flush_area_callback)(void *arg) = NULL; -static void *flush_area_callback_arg = NULL; - -static uint16_t dma_buffer[(DMADRV_MAX_XFER_COUNT + 1) / 2]; -static uint8_t *pColorSwap = NULL; - -/***************************************************************************//** - * @brief - * Adafruit_SPITFT Send Command handles complete sending of commands and - * data. - * - * @param[in] command - * The Command Byte. - * @param[in] data - * A pointer to the Data bytes to send. - * @param[in] len - * The number of bytes we should send. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_spi_send_command(uint8_t command, - const uint8_t *data, - uint8_t len) -{ - Ecode_t retVal; - - SPI_CS_LOW(gspi_handle); - SPI_DC_LOW(); - retVal = SPIDRV_MTransmitB(gspi_handle, &command, 1); - if (ECODE_OK != retVal) { - goto error; - } - if (len != 0) { - SPI_DC_HIGH(); - retVal = SPIDRV_MTransmitB(gspi_handle, data, len); - if (ECODE_OK != retVal) { - goto error; - } - } - SPI_CS_HIGH(gspi_handle); - return SL_STATUS_OK; - error: - SPI_CS_HIGH(gspi_handle); - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Write a single command byte to the display. - * - * @param[in] cmd - * 8-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_spi_write_command(uint8_t cmd) -{ - SPI_DC_LOW(); - Ecode_t retVal = SPIDRV_MTransmitB(gspi_handle, &cmd, 1); - SPI_DC_HIGH(); - - return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Write a single command word to the display. - * - * @param[in] cmd - * 16-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_spi_write16(uint16_t data) -{ - uint8_t bytes[2]; - - bytes[0] = data >> 8; - bytes[1] = data & 0x00FF; - - Ecode_t retVal = SPIDRV_MTransmitB(gspi_handle, bytes, 2); - - return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Read 8 bits of data from display configuration memory (not RAM). - * - * @param[out] result - * Data read from display configuration memory. - * @param[in] command - * The command register to read data from. - * @param[in] index - * The byte index into the command to read from. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_spi_read_command8(uint8_t *result, - uint8_t command, - uint8_t index) -{ - Ecode_t retVal; - - SPI_CS_LOW(gspi_handle); - SPI_DC_LOW(); - retVal = SPIDRV_MTransmitB(gspi_handle, &command, 1); - if (ECODE_OK != retVal) { - goto error; - } - SPI_DC_HIGH(); - do { - retVal = SPIDRV_MReceiveB(gspi_handle, result, 1); - if (ECODE_OK != retVal) { - goto error; - } - } while (index--); // Discard bytes up to index'th - SPI_CS_HIGH(gspi_handle); - return SL_STATUS_OK; - error: - SPI_CS_HIGH(gspi_handle); - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Issue a series of pixels, all the same color. - * - * @param[in] color - * 16-bit pixel color in '565' RGB format. - * @param[in] len - * Number of pixels to draw. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_write_color(uint16_t color, uint32_t len) -{ - uint32_t i, n, size; - Ecode_t retVal; - - if (!len) { - return SL_STATUS_INVALID_PARAMETER; - } - for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { - if (n + MAX_XFER_PIXEL_COUNT <= len) { - size = MAX_XFER_PIXEL_COUNT; - } else { - size = len - n; - } - - for (i = 0; i < size; i++) { - dma_buffer[i] = color >> 8 | ((uint16_t)(color & 0xff) << 8); - } - retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); - if (ECODE_OK != retVal) { - goto error; - } - } - - return SL_STATUS_OK; - error: - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Issue a series of pixels from memory to the display. - * - * @param[in] colors - * Pointer to array of 16-bit pixel values in '565' RGB format. - * @param[in] len - * Number of elements in 'colors' array. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_write_pixels(uint16_t *colors, uint32_t len) -{ - uint32_t i, n, size; - Ecode_t retVal; - - if (!len) { - return SL_STATUS_INVALID_PARAMETER; - } - - for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { - if (n + MAX_XFER_PIXEL_COUNT <= len) { - size = MAX_XFER_PIXEL_COUNT; - } else { - size = len - n; - } - - for (i = 0; i < size; i++) { - dma_buffer[i] = *colors >> 8 | ((uint16_t)(*colors & 0xff) << 8); - colors++; - } - retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); - if (ECODE_OK != retVal) { - goto error; - } - } - - return SL_STATUS_OK; - error: - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * A lower-level version of adafruit_ili9341_fill_rect(). This version - * requires all inputs are in-bounds, that width and height are positive, - * and no part extends offscreen. NO EDGE CLIPPING OR REJECTION IS PERFORMED. - * If higher-level graphics primitives are written to handle their own - * clipping earlier in the drawing process, this can avoid unnecessary - * function calls and repeated clipping operations in the lower-level - * functions. - * - * @param[in] x - * Horizontal position of first corner. MUST BE WITHIN SCREEN BOUNDS. - * @param[in] y - * Vertical position of first corner. MUST BE WITHIN SCREEN BOUNDS. - * @param[in] w - * Rectangle width in pixels. MUST BE POSITIVE AND NOT EXTEND OFF SCREEN. - * @param[in] h - * Rectangle height in pixels. MUST BE POSITIVE AND NOT EXTEND OFF SCREEN. - * @param[in] color - * 16-bit fill color in '565' RGB format. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_write_fill_rect_preclipped(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) -{ - adafruit_ili9341_set_addr_window(x, y, w, h); - adafruit_ili9341_write_color(color, (uint32_t)w * h); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Draw a filled rectangle to the display. - * - * @param[in] x - * Horizontal position of first corner. - * @param[in] y - * Vertical position of first corner. - * @param[in] w - * Rectangle width in pixels (positive = right of first corner, - * negative = left of first corner). - * @param[in] h - * Rectangle height in pixels (positive = below first corner, - * negative = above first corner) - * @param[in] color - * 16-bit fill color in '565' RGB format. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_ili9341_fill_rect(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) -{ - if (w && h) { - if (w < 0) { - x += w + 1; - w = -w; - } - if (x < ILI9341_TFTWIDTH) { - if (h < 0) { - y += h + 1; - h = -h; - } - if (y < ILI9341_TFTHEIGHT) { - int16_t x2 = x + w - 1; - if (x2 >= 0) { - int16_t y2 = y + h - 1; - if (y2 >= 0) { - if (x < 0) { - x = 0; - w = x2 + 1; - } - if (y < 0) { - y = 0; - h = y2 + 1; - } - if (x2 >= ILI9341_TFTWIDTH) { - w = ILI9341_TFTWIDTH - x; - } - if (y2 >= ILI9341_TFTHEIGHT) { - h = ILI9341_TFTHEIGHT - y; - } - SPI_CS_LOW(gspi_handle); - adafruit_ili9341_write_fill_rect_preclipped(x, y, w, h, color); - SPI_CS_HIGH(gspi_handle); - } - } - } - } - } - - return SL_STATUS_OK; -} - -// ----------------------------------------------------------------------------- -// Public Function -// ----------------------------------------------------------------------------- - -/**************************************************************************//** - * Initialize the Adafruit 2.4" TFT LCD with Touchscreen. - *****************************************************************************/ -sl_status_t adafruit_ili9341_spi_dma_init(SPIDRV_Handle_t spidrv_handle) -{ - gspi_handle = spidrv_handle; - - GPIO_PinModeSet(SL_SPIDRV_ILI9341_CS_PORT, - SL_SPIDRV_ILI9341_CS_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ILI9341_SPI_DC_PORT, - ILI9341_SPI_DC_PIN, - gpioModePushPull, - 0); - - static const uint8_t init_cmd[] = { - 0xEF, 3, 0x03, 0x80, 0x02, - 0xCF, 3, 0x00, 0xC1, 0x30, - 0xED, 4, 0x64, 0x03, 0x12, 0x81, - 0xE8, 3, 0x85, 0x00, 0x78, - 0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, - 0xF7, 1, 0x20, - 0xEA, 2, 0x00, 0x00, - ILI9341_PWCTR1, 1, 0x23, // Power control VRH[5:0] - ILI9341_PWCTR2, 1, 0x10, // Power control SAP[2:0];BT[3:0] - ILI9341_VMCTR1, 2, 0x3e, 0x28, // VCM control - ILI9341_VMCTR2, 1, 0x86, // VCM control2 - ILI9341_MADCTL, 1, 0x48, // Memory Access Control - ILI9341_VSCRSADD, 1, 0x00, // Vertical scroll zero - ILI9341_PIXFMT, 1, 0x55, - ILI9341_FRMCTR1, 2, 0x00, 0x18, - ILI9341_DFUNCTR, 3, 0x08, 0x82, 0x27, // Display Function Control - 0xF2, 1, 0x00, // 3Gamma Function Disable - ILI9341_GAMMASET, 1, 0x01, // Gamma curve selected - ILI9341_GMCTRP1, 15, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, // Set Gamma - 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00, - ILI9341_GMCTRN1, 15, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, // Set Gamma - 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F, - ILI9341_SLPOUT, 0x80, // Exit Sleep - ILI9341_DISPON, 0x80, // Display on - 0x00 - }; - adafruit_ili9341_spi_send_command(ILI9341_SWRESET, NULL, 0); - sl_sleeptimer_delay_millisecond(150); - - uint8_t cmd, x, num_args; - const uint8_t *addr = init_cmd; - while ((cmd = pgm_read_byte(addr++)) > 0) { - x = pgm_read_byte(addr++); - num_args = x & 0x7F; - adafruit_ili9341_spi_send_command(cmd, addr, num_args); - addr += num_args; - if (x & 0x80) { - sl_sleeptimer_delay_millisecond(150); - } - } - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * Enable/Disable display color inversion. - *****************************************************************************/ -sl_status_t adafruit_ili9341_invert_display(bool invert) -{ - return adafruit_ili9341_spi_send_command( - invert ? ILI9341_INVON : ILI9341_INVOFF, NULL, 0); -} - -/**************************************************************************//** - * Scroll display memory. - *****************************************************************************/ -sl_status_t adafruit_ili9341_scroll_to(uint16_t y) -{ - uint8_t data[2]; - - data[0] = y >> 8; - data[1] = y & 0xff; - - return adafruit_ili9341_spi_send_command(ILI9341_VSCRSADD, data, 2); -} - -/**************************************************************************//** - * Set the height of the Top and Bottom Scroll Margins. - *****************************************************************************/ -sl_status_t adafruit_ili9341_set_scroll_margins(uint16_t top, uint16_t bottom) -{ - if (top + bottom <= ILI9341_TFTHEIGHT) { - uint16_t middle = ILI9341_TFTHEIGHT - (top + bottom); - uint8_t data[6]; - data[0] = top >> 8; - data[1] = top & 0xff; - data[2] = middle >> 8; - data[3] = middle & 0xff; - data[4] = bottom >> 8; - data[5] = bottom & 0xff; - return adafruit_ili9341_spi_send_command(ILI9341_VSCRDEF, data, 6); - } else { - return SL_STATUS_INVALID_PARAMETER; - } -} - -/**************************************************************************//** - * Set the "address window" - the rectangle we will write to RAM. - *****************************************************************************/ -sl_status_t adafruit_ili9341_set_addr_window(uint16_t x1, uint16_t y1, - uint16_t w, uint16_t h) -{ - static uint16_t old_x1 = 0xffff, old_x2 = 0xffff; - static uint16_t old_y1 = 0xffff, old_y2 = 0xffff; - uint16_t x2 = (x1 + w - 1), y2 = (y1 + h - 1); - uint16_t tmp[2]; - Ecode_t retVal; - - if ((x1 != old_x1) || (x2 != old_x2)) { - // Column address set - adafruit_ili9341_spi_write_command(ILI9341_CASET); - tmp[0] = x1 >> 8 | ((uint16_t)(x1 & 0xff) << 8); - tmp[1] = x2 >> 8 | ((uint16_t)(x2 & 0xff) << 8); - retVal = SPIDRV_MTransmitB(gspi_handle, tmp, 4); - if (ECODE_OK != retVal) { - goto error; - } - old_x1 = x1; - old_x2 = x2; - } - if ((y1 != old_y1) || (y2 != old_y2)) { - // Row address set - adafruit_ili9341_spi_write_command(ILI9341_PASET); - tmp[0] = y1 >> 8 | ((uint16_t)(y1 & 0xff) << 8); - tmp[1] = y2 >> 8 | ((uint16_t)(y2 & 0xff) << 8); - retVal = SPIDRV_MTransmitB(gspi_handle, tmp, 4); - if (ECODE_OK != retVal) { - goto error; - } - old_y1 = y1; - old_y2 = y2; - } - // Write to RAM - return adafruit_ili9341_spi_write_command(ILI9341_RAMWR); - error: - return SL_STATUS_IO; -} - -/**************************************************************************//** - * Read 8 bits of data from ILI9341 configuration memory. - *****************************************************************************/ -sl_status_t adafruit_ili9341_read_command8(uint8_t *result, - uint8_t command, - uint8_t index) -{ - uint8_t data = 0x10 + index; - - // Set Index Register - adafruit_ili9341_spi_send_command(0xD9, &data, 1); - adafruit_ili9341_spi_read_command8(result, command, 0); - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * Draw a single pixel to the display at requested coordinates. - *****************************************************************************/ -sl_status_t adafruit_ili9341_draw_pixel(int16_t x, int16_t y, uint16_t color) -{ - if ((x >= 0) && (x < ILI9341_TFTWIDTH) && (y >= 0) - && (y < ILI9341_TFTHEIGHT)) { - // THEN set up transaction (if needed) and draw... - SPI_CS_LOW(gspi_handle); - adafruit_ili9341_set_addr_window(x, y, 1, 1); - adafruit_ili9341_spi_write16(color); - SPI_CS_HIGH(gspi_handle); - - return SL_STATUS_OK; - } - return SL_STATUS_INVALID_PARAMETER; -} - -/**************************************************************************//** - * Fill the screen completely with one color. - *****************************************************************************/ -sl_status_t adafruit_ili9341_fill_screen(uint16_t color) -{ - return adafruit_ili9341_fill_rect(0, - 0, - ILI9341_TFTWIDTH, - ILI9341_TFTHEIGHT, - color); -} - -/**************************************************************************//** - * Draw a 16-bit image (565 RGB) at the specified (x,y) position. - *****************************************************************************/ -sl_status_t adafruit_ili9341_draw_rgb_bitmap(int16_t x, - int16_t y, - uint16_t *color, - int16_t w, - int16_t h) -{ - int16_t x2; - int16_t y2; - int16_t bx1 = 0; - int16_t by1 = 0; - int16_t save_w = w; - - if ((x >= ILI9341_TFTWIDTH) - || (y >= ILI9341_TFTHEIGHT) - || ((x2 = (x + w - 1)) < 0) - || ((y2 = (y + h - 1)) < 0)) { - return SL_STATUS_INVALID_PARAMETER; - } - if (x < 0) { - w += x; - bx1 = -x; - x = 0; - } - if (y < 0) { - h += y; - by1 = -y; - y = 0; - } - if (x2 >= ILI9341_TFTWIDTH) { - w = ILI9341_TFTWIDTH - x; - } - if (y2 >= ILI9341_TFTHEIGHT) { - h = ILI9341_TFTHEIGHT - y; - } - color += by1 * save_w + bx1; - SPI_CS_LOW(gspi_handle); - adafruit_ili9341_set_addr_window(x, y, w, h); - while (h--) { - adafruit_ili9341_write_pixels(color, w); - color += save_w; - } - SPI_CS_HIGH(gspi_handle); - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * Fill the screen area with color using SPI transmit DMA. After the process - * is complete call the user callback to notify the higher layer. - *****************************************************************************/ -sl_status_t adafruit_ili9341_flush_area_rgb565(int16_t x1, int16_t y1, - int16_t x2, int16_t y2, - uint8_t *pcolor, - bool color_swap, - void (*callback)(void *arg), - void *callback_arg) -{ - if ((pcolor != NULL) && (callback != NULL) - && (x1 >= 0) && (x1 < ILI9341_TFTWIDTH) - && (x2 >= 0) && (x2 < ILI9341_TFTWIDTH) - && (y1 >= 0) && (y1 < ILI9341_TFTHEIGHT) - && (y2 >= 0) && (y2 < ILI9341_TFTHEIGHT) - && (x2 >= x1) && (y2 >= y1)) { - uint16_t width = x2 - x1 + 1; - uint16_t hight = y2 - y1 + 1; - - SPI_CS_LOW(gspi_handle); - adafruit_ili9341_set_addr_window(x1, y1, width, hight); - - gtotal_pixel = width * hight; - gpixel_transmit = 0; - gpixel_transmit_counter = 0; - color_swap_enabled = color_swap; - flush_area_callback = callback; - flush_area_callback_arg = callback_arg; - - if (gpixel_transmit_counter < gtotal_pixel) { - uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; - gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT - ? MAX_XFER_PIXEL_COUNT : pixel_remaining; - - if (!color_swap_enabled) { - uint16_t i; - pColorSwap = pcolor; - uint8_t colorData_H; - uint8_t colorData_L; - - for (i = 0; i < gpixel_transmit; i++) { - colorData_H = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; - colorData_L = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; - - /* Swap 2 bytes color data before sending to TFT LCD */ - dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; - } - - pColorBuffer = (uint8_t *)dma_buffer; - } else { - pColorBuffer = (uint8_t *)pcolor; - } - - /* Start transmit data, the process is continued in - * adafruit_ili9341_flush_area_transmit_callback function - */ - - SPIDRV_MTransmit(gspi_handle, - (uint8_t *)pColorBuffer, - gpixel_transmit * BYTE_PER_PIXEL, - ili9341_flush_area_transmit_callback); - - if (color_swap_enabled) { - pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); - } - - gpixel_transmit_counter += gpixel_transmit; - } - - return SL_STATUS_OK; - } - return SL_STATUS_INVALID_PARAMETER; -} - -static void ili9341_flush_area_transmit_callback( - struct SPIDRV_HandleData *handle, - Ecode_t transferStatus, - int itemsTransferred) -{ - (void)itemsTransferred; - - if (handle == gspi_handle) { - if (transferStatus == ECODE_OK) { - if (gpixel_transmit_counter < gtotal_pixel) { - /* Continue transmit the data */ - uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; - gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT - ? MAX_XFER_PIXEL_COUNT : pixel_remaining; - - if (!color_swap_enabled) { - uint16_t i; - uint8_t colorData_H; - uint8_t colorData_L; - - for (i = 0; i < gpixel_transmit; i++) { - colorData_H = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; - colorData_L = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; - - /* Swap 2 bytes color data before sending to TFT LCD */ - dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; - } - - pColorBuffer = (uint8_t *)dma_buffer; - } - SPIDRV_MTransmit(gspi_handle, - (uint8_t *)pColorBuffer, - gpixel_transmit * BYTE_PER_PIXEL, - ili9341_flush_area_transmit_callback); - - if (color_swap_enabled) { - pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); - } - - gpixel_transmit_counter += gpixel_transmit; - } else { - /* After the process is complete call the user callback to - * notify the higher layer. - */ - SPI_CS_HIGH(gspi_handle); - - if (flush_area_callback != NULL) { - flush_area_callback(flush_area_callback_arg); - } - } - } - } -} diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_usart_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_usart_config.h rename to driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_config.h index 5f81e776..18250d27 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ST7789 SPI settings -// ST7789 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ST7789_SPI_BITRATE 40000000 +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ST7789_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ST7789_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ST7789_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -76,11 +88,11 @@ extern "C" // [USART_ADAFRUIT_ST7789]$ -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 5 -// [GPIO_ST7789_SPI_DC]$ +// ADAFRUIT_ST7789_DC +// $[GPIO_ADAFRUIT_ST7789_DC] +#define ADAFRUIT_ST7789_DC_PORT gpioPortC +#define ADAFRUIT_ST7789_DC_PIN 5 +// [GPIO_ADAFRUIT_ST7789_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_dma_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_dma_config.h deleted file mode 100644 index 69ecfa1a..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2601b/adafruit_st7789_spi_dma_config.h +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************//** - * @file adafruit_st7789_spi_dma_config.h - * @brief Configuration file for Adafruit TFT Display Driver. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ST7789_CONFIG_H_ -#define ADAFRUIT_ST7789_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -// <<< sl:start pin_tool >>> - -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 5 -// [GPIO_ST7789_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ST7789_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_usart_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_usart_config.h rename to driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_config.h index 370407f7..a3759fe2 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ST7789 SPI settings -// ST7789 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ST7789_SPI_BITRATE 40000000 +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ST7789_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ST7789_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ST7789_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -76,11 +88,11 @@ extern "C" // [USART_ADAFRUIT_ST7789]$ -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 8 -// [GPIO_ST7789_SPI_DC]$ +// ADAFRUIT_ST7789_DC +// $[GPIO_ADAFRUIT_ST7789_DC] +#define ADAFRUIT_ST7789_DC_PORT gpioPortC +#define ADAFRUIT_ST7789_DC_PIN 8 +// [GPIO_ADAFRUIT_ST7789_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_dma_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_dma_config.h deleted file mode 100644 index 100a358d..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2703a/adafruit_st7789_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file sl_spidrv_st7789_config.h.h - * @brief Configuration file for Adafruit TFT Display Driver. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ST7789_CONFIG_H_ -#define ADAFRUIT_ST7789_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 8 -// [GPIO_ST7789_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ST7789_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2703a/sl_spidrv_st7789_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2703a/sl_spidrv_st7789_config.h deleted file mode 100644 index 273d376f..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2703a/sl_spidrv_st7789_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file sl_spidrv_st7789_config.h - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ST7789_CONFIG_H -#define SL_SPIDRV_ST7789_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ST7789_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ST7789_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ST7789_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ST7789_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ST7789_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ST7789_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ST7789_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ST7789 -// $[USART_SL_SPIDRV_ST7789] -#define SL_SPIDRV_ST7789_PERIPHERAL USART0 -#define SL_SPIDRV_ST7789_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ST7789_TX_PORT gpioPortC -#define SL_SPIDRV_ST7789_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_ST7789_RX_PORT gpioPortC -#define SL_SPIDRV_ST7789_RX_PIN 2 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ST7789_CLK_PORT gpioPortC -#define SL_SPIDRV_ST7789_CLK_PIN 1 - -// USART0 CS on PC03 -#define SL_SPIDRV_ST7789_CS_PORT gpioPortC -#define SL_SPIDRV_ST7789_CS_PIN 0 - -// [USART_SL_SPIDRV_ST7789]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ST7789_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_usart_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_usart_config.h rename to driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_config.h index 804ca4ab..8d4ae63d 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ST7789 SPI settings -// ST7789 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ST7789_SPI_BITRATE 40000000 +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ST7789_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ST7789_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ST7789_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_ST7789]$ -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 0 -// [GPIO_ST7789_SPI_DC]$ +// ADAFRUIT_ST7789_DC +// $[GPIO_ADAFRUIT_ST7789_DC] +#define ADAFRUIT_ST7789_DC_PORT gpioPortC +#define ADAFRUIT_ST7789_DC_PIN 0 +// [GPIO_ADAFRUIT_ST7789_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_dma_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_dma_config.h deleted file mode 100644 index fad73f81..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2704a/adafruit_st7789_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_st7789_spi_dma_config.h - * @brief Configuration file for Adafruit TFT Display Driver. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ST7789_CONFIG_H_ -#define ADAFRUIT_ST7789_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 0 -// [GPIO_ST7789_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ST7789_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd2704a/sl_spidrv_st7789_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd2704a/sl_spidrv_st7789_config.h deleted file mode 100644 index 4f0e96ae..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd2704a/sl_spidrv_st7789_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file sl_spidrv_st7789_config.h - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ST7789_CONFIG_H -#define SL_SPIDRV_ST7789_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ST7789_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ST7789_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ST7789_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ST7789_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ST7789_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ST7789_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ST7789_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ST7789 -// $[USART_SL_SPIDRV_ST7789] -#define SL_SPIDRV_ST7789_PERIPHERAL USART0 -#define SL_SPIDRV_ST7789_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ST7789_TX_PORT gpioPortC -#define SL_SPIDRV_ST7789_TX_PIN 3 - -// USART0 RX on PC01 -#define SL_SPIDRV_ST7789_RX_PORT gpioPortC -#define SL_SPIDRV_ST7789_RX_PIN 6 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ST7789_CLK_PORT gpioPortC -#define SL_SPIDRV_ST7789_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_ST7789_CS_PORT gpioPortC -#define SL_SPIDRV_ST7789_CS_PIN 1 - -// [USART_SL_SPIDRV_ST7789]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ST7789_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_usart_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_usart_config.h rename to driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_config.h index 163bd377..cdabca02 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ST7789 SPI settings -// ST7789 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ST7789_SPI_BITRATE 40000000 +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ST7789_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ST7789_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ST7789_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_ST7789]$ -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 6 -// [GPIO_ST7789_SPI_DC]$ +// ADAFRUIT_ST7789_DC +// $[GPIO_ADAFRUIT_ST7789_DC] +#define ADAFRUIT_ST7789_DC_PORT gpioPortC +#define ADAFRUIT_ST7789_DC_PIN 6 +// [GPIO_ADAFRUIT_ST7789_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_dma_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_dma_config.h deleted file mode 100644 index a9d475da..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_st7789_spi_dma_config.h - * @brief Configuration file for Adafruit TFT Display Driver. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ST7789_CONFIG_H_ -#define ADAFRUIT_ST7789_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 6 -// [GPIO_ST7789_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ST7789_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd4108a/sl_spidrv_st7789_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd4108a/sl_spidrv_st7789_config.h deleted file mode 100644 index d343ff17..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd4108a/sl_spidrv_st7789_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file sl_spidrv_st7789_config.h - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ST7789_CONFIG_H -#define SL_SPIDRV_ST7789_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ST7789_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ST7789_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ST7789_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ST7789_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ST7789_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ST7789_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ST7789_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ST7789 -// $[USART_SL_SPIDRV_ST7789] -#define SL_SPIDRV_ST7789_PERIPHERAL USART0 -#define SL_SPIDRV_ST7789_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ST7789_TX_PORT gpioPortC -#define SL_SPIDRV_ST7789_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_ST7789_RX_PORT gpioPortC -#define SL_SPIDRV_ST7789_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ST7789_CLK_PORT gpioPortC -#define SL_SPIDRV_ST7789_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_ST7789_CS_PORT gpioPortC -#define SL_SPIDRV_ST7789_CS_PIN 3 - -// [USART_SL_SPIDRV_ST7789]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ST7789_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_usart_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_config.h similarity index 75% rename from driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_usart_config.h rename to driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_config.h index 163bd377..cdabca02 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/brd4108a/adafruit_st7789_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_config.h @@ -44,9 +44,21 @@ extern "C" // <<< Use Configuration Wizard in Context Menu >>> // ST7789 SPI settings -// ST7789 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ST7789_SPI_BITRATE 40000000 +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ST7789_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ST7789_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ST7789_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> @@ -75,11 +87,11 @@ extern "C" // [USART_ADAFRUIT_ST7789]$ -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 6 -// [GPIO_ST7789_SPI_DC]$ +// ADAFRUIT_ST7789_DC +// $[GPIO_ADAFRUIT_ST7789_DC] +#define ADAFRUIT_ST7789_DC_PORT gpioPortC +#define ADAFRUIT_ST7789_DC_PIN 6 +// [GPIO_ADAFRUIT_ST7789_DC]$ // <<< sl:end pin_tool >>> diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_dma_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_dma_config.h deleted file mode 100644 index a9d475da..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd4314a/adafruit_st7789_spi_dma_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************//** - * @file adafruit_st7789_spi_dma_config.h - * @brief Configuration file for Adafruit TFT Display Driver. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ -#ifndef ADAFRUIT_ST7789_CONFIG_H_ -#define ADAFRUIT_ST7789_CONFIG_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -// <<< sl:start pin_tool >>> - -// ST7789_SPI_DC -// $[GPIO_ST7789_SPI_DC] -#define ST7789_SPI_DC_PORT gpioPortC -#define ST7789_SPI_DC_PIN 6 -// [GPIO_ST7789_SPI_DC]$ - -// <<< sl:end pin_tool >>> - -#ifdef __cplusplus -extern "C" -} -#endif - -#endif /* ADAFRUIT_ST7789_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd4314a/sl_spidrv_st7789_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd4314a/sl_spidrv_st7789_config.h deleted file mode 100644 index d343ff17..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/brd4314a/sl_spidrv_st7789_config.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************//** - * @file sl_spidrv_st7789_config.h - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ST7789_CONFIG_H -#define SL_SPIDRV_ST7789_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ST7789_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ST7789_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ST7789_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ST7789_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ST7789_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ST7789_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ST7789_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ST7789 -// $[USART_SL_SPIDRV_ST7789] -#define SL_SPIDRV_ST7789_PERIPHERAL USART0 -#define SL_SPIDRV_ST7789_PERIPHERAL_NO 0 - -// USART0 TX on PC00 -#define SL_SPIDRV_ST7789_TX_PORT gpioPortC -#define SL_SPIDRV_ST7789_TX_PIN 0 - -// USART0 RX on PC01 -#define SL_SPIDRV_ST7789_RX_PORT gpioPortC -#define SL_SPIDRV_ST7789_RX_PIN 1 - -// USART0 CLK on PC02 -#define SL_SPIDRV_ST7789_CLK_PORT gpioPortC -#define SL_SPIDRV_ST7789_CLK_PIN 2 - -// USART0 CS on PC03 -#define SL_SPIDRV_ST7789_CS_PORT gpioPortC -#define SL_SPIDRV_ST7789_CS_PIN 3 - -// [USART_SL_SPIDRV_ST7789]$ -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ST7789_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_st7789/config/brd4338a/adafruit_st7789_spi_config.h b/driver/public/silabs/tft_lcd_st7789/config/brd4338a/adafruit_st7789_spi_config.h new file mode 100644 index 00000000..28a04df6 --- /dev/null +++ b/driver/public/silabs/tft_lcd_st7789/config/brd4338a/adafruit_st7789_spi_config.h @@ -0,0 +1,82 @@ +/***************************************************************************//** + * @file adafruit_st7789_spi_usart_config.h + * @brief Configuration file for Adafruit TFT Display Driver. + * @version 1.0.0 + ******************************************************************************* + * # License + * Copyright 2022 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * # Evaluation Quality + * This code has been minimally tested to ensure that it builds and is suitable + * as a demonstration for evaluation purposes only. This code will be maintained + * at the sole discretion of Silicon Labs. + ******************************************************************************/ +#ifndef ADAFRUIT_ST7789_CONFIG_H_ +#define ADAFRUIT_ST7789_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu >>> +// ST7789 SPI settings + +// ST7789 SPI bitrate +// Default: 20000000 +#define ADAFRUIT_ST7789_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ST7789_CLOCK_MODE SL_GSPI_MODE_0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ST7789_CS_CONTROL SL_GSPI_MASTER_HW_OUTPUT +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// ADAFRUIT_ST7789_DC +// $[GPIO_ADAFRUIT_ST7789_DC] +#ifndef ADAFRUIT_ST7789_DC_PORT +#define ADAFRUIT_ST7789_DC_PORT HP +#endif +#ifndef ADAFRUIT_ST7789_DC_PIN +#define ADAFRUIT_ST7789_DC_PIN 47 +#endif +// [GPIO_ADAFRUIT_ST7789_DC]$ + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +extern "C" +} +#endif + +#endif /* ADAFRUIT_ST7789_CONFIG_H_ */ diff --git a/driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_usart_config.h b/driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_config.h similarity index 79% rename from driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_usart_config.h rename to driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_config.h index 435ed84e..90efdf10 100644 --- a/driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_usart_config.h +++ b/driver/public/silabs/tft_lcd_st7789/config/other/adafruit_st7789_spi_config.h @@ -45,8 +45,20 @@ extern "C" // ST7789 SPI settings // ST7789 SPI bitrate -// Default: 40000000 -#define ADAFRUIT_ST7789_SPI_BITRATE 40000000 +// Default: 20000000 +#define ADAFRUIT_ST7789_BITRATE 20000000 + +// SPI clock mode +// SPI mode 0: CLKPOL=0, CLKPHA=0 +// SPI mode 1: CLKPOL=0, CLKPHA=1 +// SPI mode 2: CLKPOL=1, CLKPHA=0 +// SPI mode 3: CLKPOL=1, CLKPHA=1 +#define ADAFRUIT_ST7789_CLOCK_MODE spidrvClockMode0 + +// SPI master chip select (CS) control scheme. +// CS controlled by the SPI driver +// CS controlled by the application +#define ADAFRUIT_ST7789_CS_CONTROL spidrvCsControlAuto // // <<< end of configuration section >>> diff --git a/driver/public/silabs/tft_lcd_st7789/config/other/sl_spidrv_st7789_config.h b/driver/public/silabs/tft_lcd_st7789/config/other/sl_spidrv_st7789_config.h deleted file mode 100644 index 6a0dbbd2..00000000 --- a/driver/public/silabs/tft_lcd_st7789/config/other/sl_spidrv_st7789_config.h +++ /dev/null @@ -1,85 +0,0 @@ -/***************************************************************************//** - * @file sl_spidrv_st7789_config.h - * @brief SPIDRV Config - ******************************************************************************* - * # License - * Copyright 2019 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -#ifndef SL_SPIDRV_ST7789_CONFIG_H -#define SL_SPIDRV_ST7789_CONFIG_H - -#include "spidrv.h" - -// <<< Use Configuration Wizard in Context Menu >>> -// SPIDRV settings - -// SPI bitrate -// Default: 1000000 -#define SL_SPIDRV_ST7789_BITRATE 40000000 - -// SPI frame length <4-16> -// Default: 8 -#define SL_SPIDRV_ST7789_FRAME_LENGTH 8 - -// SPI mode -// Master -// Slave -#define SL_SPIDRV_ST7789_TYPE spidrvMaster - -// Bit order on the SPI bus -// LSB transmitted first -// MSB transmitted first -#define SL_SPIDRV_ST7789_BIT_ORDER spidrvBitOrderMsbFirst - -// SPI clock mode -// SPI mode 0: CLKPOL=0, CLKPHA=0 -// SPI mode 1: CLKPOL=0, CLKPHA=1 -// SPI mode 2: CLKPOL=1, CLKPHA=0 -// SPI mode 3: CLKPOL=1, CLKPHA=1 -#define SL_SPIDRV_ST7789_CLOCK_MODE spidrvClockMode0 - -// SPI master chip select (CS) control scheme. -// CS controlled by the SPI driver -// CS controlled by the application -#define SL_SPIDRV_ST7789_CS_CONTROL spidrvCsControlApplication - -// SPI slave transfer start scheme -// Transfer starts immediately -// Transfer starts when the bus is idle (CS deasserted) -// Only applies if instance type is spidrvSlave -#define SL_SPIDRV_ST7789_SLAVE_START_MODE spidrvSlaveStartImmediate -// -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> -// SL_SPIDRV_ST7789 -// $[USART_SL_SPIDRV_ST7789] -#warning "ST7789 SPI Peripheral not configured" -// [USART_SL_SPIDRV_ST7789]$ - -// <<< sl:end pin_tool >>> - -#endif // SL_SPIDRV_ST7789_CONFIG_H diff --git a/driver/public/silabs/tft_lcd_st7789/inc/adafruit_st7789.h b/driver/public/silabs/tft_lcd_st7789/inc/adafruit_st7789.h index eb619676..09ee8aca 100644 --- a/driver/public/silabs/tft_lcd_st7789/inc/adafruit_st7789.h +++ b/driver/public/silabs/tft_lcd_st7789/inc/adafruit_st7789.h @@ -46,6 +46,8 @@ #include #include "sl_status.h" #include "sl_component_catalog.h" +#include "mipi_dbi.h" +#include "mipi_dbi_spi.h" #ifdef __cplusplus extern "C" { @@ -106,15 +108,14 @@ extern "C" { #define ST7789_YELLOW 0xFFE0 #define ST7789_ORANGE 0xFC00 -typedef void (*adafruit_st7789_dma_complete_callback_t)(sl_status_t status); - typedef enum { adafruit_st7789_rotation_none = 0, adafruit_st7789_rotation_90, adafruit_st7789_rotation_180, adafruit_st7789_rotation_270, -}adafruit_st7789_rotation_e; +} adafruit_st7789_rotation_e; + // ----------------------------------------------------------------------------- // Public Function // ----------------------------------------------------------------------------- @@ -131,16 +132,10 @@ typedef enum * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -#if defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ST7789_PRESENT) -sl_status_t adafruit_st7789_spi_usart_init(void); +sl_status_t adafruit_st7789_spi_init(const struct mipi_dbi_config *config); -#define adafruit_st7789_init adafruit_st7789_spi_usart_init -#elif defined(SL_CATALOG_ADAFRUIT_TFT_LCD_ST7789_DMA_PRESENT) -#include "spidrv.h" -sl_status_t adafruit_st7789_spi_dma_init(SPIDRV_Handle_t spidrv_handle); - -#define adafruit_st7789_init adafruit_st7789_spi_dma_init -#endif +#define adafruit_st7789_init(spi_handle) \ + adafruit_st7789_spi_init((const struct mipi_dbi_config *)spi_handle); /***************************************************************************//** * @brief diff --git a/driver/public/silabs/tft_lcd_st7789/src/adafruit_st7789.c b/driver/public/silabs/tft_lcd_st7789/src/adafruit_st7789.c index 5dd415f2..132b431a 100644 --- a/driver/public/silabs/tft_lcd_st7789/src/adafruit_st7789.c +++ b/driver/public/silabs/tft_lcd_st7789/src/adafruit_st7789.c @@ -1,5 +1,5 @@ /***************************************************************************//** - * @file adafruit_st7789.c + * @file adafruit_st7789_dma.c * @brief Adafruit ST7789 Color TFT Display Driver source file. * @version 1.0.0 ******************************************************************************* @@ -39,166 +39,136 @@ // ----------------------------------------------------------------------------- // Includes // ----------------------------------------------------------------------------- -#include "em_cmu.h" -#include "em_gpio.h" #include "sl_status.h" #include "sl_sleeptimer.h" #include "sl_component_catalog.h" -#include "em_usart.h" -#include "adafruit_st7789_spi_usart_config.h" #include "adafruit_st7789.h" // ----------------------------------------------------------------------------- // Macros // ----------------------------------------------------------------------------- #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) +#define BYTE_PER_PIXEL (2) /* 2 Bytes color data per pixel */ +#define MAX_XFER_PIXEL_COUNT (MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX \ + / BYTE_PER_PIXEL) -#define SPI_CS_LOW() \ - GPIO_PinOutClear(ADAFRUIT_ST7789_CS_PORT, ADAFRUIT_ST7789_CS_PIN); -#define SPI_CS_HIGH() \ - GPIO_PinOutSet(ADAFRUIT_ST7789_CS_PORT, ADAFRUIT_ST7789_CS_PIN); - -#define SPI_DC_LOW() \ - GPIO_PinOutClear(ST7789_SPI_DC_PORT, ST7789_SPI_DC_PIN); -#define SPI_DC_HIGH() \ - GPIO_PinOutSet(ST7789_SPI_DC_PORT, ST7789_SPI_DC_PIN); - +// ----------------------------------------------------------------------------- +// Local Variables +// ----------------------------------------------------------------------------- static uint16_t _colstart = 0, _colstart2 = 0; static uint16_t _rowstart = 0, _rowstart2 = 0; static uint16_t _xstart = 0, _ystart = 0; static uint16_t _width = ST7789_TFTWIDTH, _height = ST7789_TFTHEIGHT; +static bool color_swap_enabled = false; +static uint32_t gtotal_pixel = 0; +static uint32_t gpixel_transmit = 0; +static uint32_t gpixel_transmit_counter = 0; +static uint8_t *pColorBuffer = NULL; +static void (*flush_area_callback)(void *arg) = NULL; +static void *flush_area_callback_arg = NULL; +static uint8_t *pColorSwap = NULL; + +static uint16_t dma_buffer[MIPI_DBI_SPI_4WIRE_DMA_BUFFER_SIZE_MAX / 2]; + +static struct mipi_dbi_device mipi_dbi_device; + +static sl_status_t send_command(uint8_t command, + const uint8_t *data, + uint8_t len); +static sl_status_t write_color(uint16_t color, uint32_t len); +static sl_status_t write_pixels(uint16_t *colors, uint32_t len); +static sl_status_t write_fill_rect_preclipped(int16_t x, + int16_t y, + int16_t w, + int16_t h, + uint16_t color); +static sl_status_t fill_rect(int16_t x, + int16_t y, + int16_t w, + int16_t h, + uint16_t color); + +static sl_status_t command_write_b32(uint8_t cmd, uint32_t data) +{ + uint8_t bytes[4]; -static sl_status_t adafruit_st7789_spi_send_command(uint8_t command, - uint8_t *data, - uint8_t len); -static sl_status_t adafruit_st7789_spi_write_command(uint8_t cmd); -static sl_status_t adafruit_st7789_spi_write16(uint16_t data); -static sl_status_t adafruit_st7789_spi_write32(uint32_t data); -static sl_status_t adafruit_st7789_write_color(uint16_t color, uint32_t len); -static sl_status_t adafruit_st7789_write_pixels(uint16_t *colors, uint32_t len); -static sl_status_t adafruit_st7789_write_fill_rect_preclipped(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color); -static sl_status_t adafruit_st7789_fill_rect(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color); + bytes[0] = (data >> 24); + bytes[1] = (data >> 16) & 0x00FF; + bytes[2] = (data >> 8) & 0x0000FF; + bytes[3] = data & 0x000000FF; -/***************************************************************************//** - * @brief - * Adafruit_SPI TFT Send Command handles complete sending of commands and - * data. - * - * @param[in] command - * The Command Byte. - * @param[in] data - * A pointer to the Data bytes to send. - * @param[in] len - * The number of bytes we should send. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL or SL_STATUS_INVALID_PARAMETER if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_send_command(uint8_t command, - uint8_t *data, - uint8_t len) -{ - sl_status_t stt = SL_STATUS_OK; - - SPI_CS_LOW(); - SPI_DC_LOW(); - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, command); - SPI_DC_HIGH(); - - if (len != 0) { - if (NULL != data) { - while (len--) { - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, *data); - data++; - } - } else { - stt = SL_STATUS_INVALID_PARAMETER; - } - } - SPI_CS_HIGH(); + return mipi_dbi_device.api->command_write( + &mipi_dbi_device, + cmd, + bytes, 4); +} - return stt; +static sl_status_t command_write(uint8_t cmd) +{ + return mipi_dbi_device.api->command_write( + &mipi_dbi_device, + cmd, + NULL, 0); } -/***************************************************************************//** - * @brief - * Write a single command byte to the display. - * - * @param[in] cmd - * 8-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_write_command(uint8_t cmd) +static sl_status_t write_display(const void *framebuf, + size_t framebuf_len, + mipi_dbi_transfer_complete_callback_t callback) { - SPI_DC_LOW(); - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, cmd); - SPI_DC_HIGH(); + struct mipi_dbi_display_buffer_descriptor desc; - return SL_STATUS_OK; + desc.buf_size = framebuf_len; + + return mipi_dbi_device.api->write_display( + &mipi_dbi_device, + (const uint8_t *)framebuf, + &desc, + PIXEL_FORMAT_RGB_565, + callback); } -/***************************************************************************//** - * @brief - * Write a single command word to the display. - * - * @param[in] cmd - * 16-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_write16(uint16_t data) +static sl_status_t write_display16(uint16_t data) { + struct mipi_dbi_display_buffer_descriptor desc; uint8_t bytes[2]; bytes[0] = data >> 8; bytes[1] = data & 0x00FF; - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, bytes[0]); - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, bytes[1]); + desc.buf_size = 2; - return SL_STATUS_OK; + return mipi_dbi_device.api->write_display( + &mipi_dbi_device, + bytes, + &desc, + PIXEL_FORMAT_RGB_565, + NULL); } /***************************************************************************//** * @brief - * Write a double command word to the display. + * Adafruit_SPITFT Send Command handles complete sending of commands and + * data. * - * @param[in] cmd - * 32-bit command to write. + * @param[in] command + * The Command Byte. + * @param[in] data + * A pointer to the Data bytes to send. + * @param[in] len + * The number of bytes we should send. * * @return * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. + * SL_STATUS_IO or SL_STATUS_INVALID_PARAMETER if the process is failed. ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_write32(uint32_t data) +static sl_status_t send_command(uint8_t command, + const uint8_t *data, + uint8_t len) { - uint8_t bytes[4]; - - bytes[0] = (data >> 24); - bytes[1] = (data >> 16) & 0x00FF; - bytes[2] = (data >> 8) & 0x0000FF; - bytes[3] = data & 0x000000FF; - - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, bytes[0]); - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, bytes[1]); - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, bytes[2]); - USART_SpiTransfer(ADAFRUIT_ST7789_PERIPHERAL, bytes[3]); - - return SL_STATUS_OK; + return mipi_dbi_device.api->command_write( + &mipi_dbi_device, + command, + data, len); } /***************************************************************************//** @@ -212,15 +182,38 @@ static sl_status_t adafruit_st7789_spi_write32(uint32_t data) * * @return * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. + * SL_STATUS_IO if the process is failed. + * SL_STATUS_INVALID_PARAMETER if (len = 0) ******************************************************************************/ -static sl_status_t adafruit_st7789_write_color(uint16_t color, uint32_t len) +static sl_status_t write_color(uint16_t color, uint32_t len) { - while (len--) { - adafruit_st7789_spi_write16(color); + uint32_t i, n, size; + sl_status_t status; + + if (!len) { + return SL_STATUS_INVALID_PARAMETER; + } + for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { + if (n + MAX_XFER_PIXEL_COUNT <= len) { + size = MAX_XFER_PIXEL_COUNT; + } else { + size = len - n; + } + + for (i = 0; i < size; i++) { + dma_buffer[i] = color >> 8 | ((uint16_t)(color & 0xff) << 8); + } + status = write_display(dma_buffer, + size * 2, + NULL); + if (SL_STATUS_OK != status) { + goto error; + } } return SL_STATUS_OK; + error: + return SL_STATUS_IO; } /***************************************************************************//** @@ -234,24 +227,45 @@ static sl_status_t adafruit_st7789_write_color(uint16_t color, uint32_t len) * * @return * SL_STATUS_OK if there are no errors. + * SL_STATUS_IO if the process is failed. * SL_STATUS_INVALID_PARAMETER if (len = 0) or (colors == NULL) ******************************************************************************/ -static sl_status_t adafruit_st7789_write_pixels(uint16_t *colors, uint32_t len) +static sl_status_t write_pixels(uint16_t *colors, uint32_t len) { + uint32_t i, n, size; + sl_status_t status; + if ((!len) || (colors == NULL)) { return SL_STATUS_INVALID_PARAMETER; } - while (len--) { - adafruit_st7789_spi_write16(*colors); - colors++; + for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { + if (n + MAX_XFER_PIXEL_COUNT <= len) { + size = MAX_XFER_PIXEL_COUNT; + } else { + size = len - n; + } + + for (i = 0; i < size; i++) { + dma_buffer[i] = *colors >> 8 | ((uint16_t)(*colors & 0xff) << 8); + colors++; + } + status = write_display(dma_buffer, + size * 2, + NULL); + if (SL_STATUS_OK != status) { + goto error; + } } + return SL_STATUS_OK; + error: + return SL_STATUS_IO; } /***************************************************************************//** * @brief - * A lower-level version of ADAFRUIT_ST7789_fill_rect(). This version + * A lower-level version of adafruit_st7789_fill_rect(). This version * requires all inputs are in-bounds, that width and height are positive, * and no part extends offscreen. NO EDGE CLIPPING OR REJECTION IS PERFORMED. * If higher-level graphics primitives are written to handle their own @@ -274,14 +288,14 @@ static sl_status_t adafruit_st7789_write_pixels(uint16_t *colors, uint32_t len) * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -static sl_status_t adafruit_st7789_write_fill_rect_preclipped(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) +static sl_status_t write_fill_rect_preclipped(int16_t x, + int16_t y, + int16_t w, + int16_t h, + uint16_t color) { adafruit_st7789_set_addr_window(x, y, w, h); - adafruit_st7789_write_color(color, (uint32_t)w * h); + write_color(color, (uint32_t)w * h); return SL_STATUS_OK; } @@ -307,11 +321,11 @@ static sl_status_t adafruit_st7789_write_fill_rect_preclipped(int16_t x, * SL_STATUS_OK if there are no errors. * SL_STATUS_FAIL if the process is failed. ******************************************************************************/ -static sl_status_t adafruit_st7789_fill_rect(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) +static sl_status_t fill_rect(int16_t x, + int16_t y, + int16_t w, + int16_t h, + uint16_t color) { if (w && h) { if (w < 0) { @@ -342,9 +356,9 @@ static sl_status_t adafruit_st7789_fill_rect(int16_t x, if (y2 >= _height) { h = _height - y; } - SPI_CS_LOW(); - adafruit_st7789_write_fill_rect_preclipped(x, y, w, h, color); - SPI_CS_HIGH(); +// mipi_dbi_device.api->select(&mipi_dbi_device); + write_fill_rect_preclipped(x, y, w, h, color); +// mipi_dbi_device.api->deselect(&mipi_dbi_device); } } } @@ -354,82 +368,6 @@ static sl_status_t adafruit_st7789_fill_rect(int16_t x, return SL_STATUS_OK; } -static void spi_usart_init(void) -{ - USART_InitSync_TypeDef usartInit = USART_INITSYNC_DEFAULT; - - usartInit.msbf = true; - usartInit.clockMode = usartClockMode0; - usartInit.master = true; - usartInit.baudrate = ADAFRUIT_ST7789_SPI_BITRATE; - -#if defined(_CMU_HFPERCLKEN0_MASK) - CMU_ClockEnable(cmuClock_HFPER, true); -#endif - CMU_ClockEnable(cmuClock_GPIO, true); -#if ADAFRUIT_ST7789_PERIPHERAL_NO == 0 - CMU_ClockEnable(cmuClock_USART0, true); -#elif ADAFRUIT_ST7789_PERIPHERAL_NO == 1 - CMU_ClockEnable(cmuClock_USART1, true); -#elif ADAFRUIT_ST7789_PERIPHERAL_NO == 2 - CMU_ClockEnable(cmuClock_USART2, true); -#endif - - usartInit.databits = usartDatabits8; - USART_InitSync(ADAFRUIT_ST7789_PERIPHERAL, &usartInit); - -#if defined(USART_ROUTEPEN_TXPEN) - ADAFRUIT_ST7789_PERIPHERAL->ROUTELOC0 = - (ADAFRUIT_ST7789_PERIPHERAL->ROUTELOC0 - & ~(_USART_ROUTELOC0_TXLOC_MASK - | _USART_ROUTELOC0_RXLOC_MASK - | _USART_ROUTELOC0_CLKLOC_MASK)) - | (ADAFRUIT_ST7789_TX_LOC << _USART_ROUTELOC0_TXLOC_SHIFT) - | (ADAFRUIT_ST7789_RX_LOC << _USART_ROUTELOC0_RXLOC_SHIFT) - | (ADAFRUIT_ST7789_CLK_LOC << _USART_ROUTELOC0_CLKLOC_SHIFT); - - ADAFRUIT_ST7789_PERIPHERAL->ROUTEPEN = USART_ROUTEPEN_TXPEN - | USART_ROUTEPEN_RXPEN - | USART_ROUTEPEN_CLKPEN - | USART_ROUTEPEN_CSPEN; -#else - GPIO->USARTROUTE[ADAFRUIT_ST7789_PERIPHERAL_NO].ROUTEEN = - GPIO_USART_ROUTEEN_TXPEN - | GPIO_USART_ROUTEEN_RXPEN - | GPIO_USART_ROUTEEN_CLKPEN; - GPIO->USARTROUTE[ADAFRUIT_ST7789_PERIPHERAL_NO].TXROUTE = - ((uint32_t)ADAFRUIT_ST7789_TX_PORT << _GPIO_USART_TXROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_ST7789_TX_PIN << _GPIO_USART_TXROUTE_PIN_SHIFT); - GPIO->USARTROUTE[ADAFRUIT_ST7789_PERIPHERAL_NO].RXROUTE = - ((uint32_t)ADAFRUIT_ST7789_RX_PORT << _GPIO_USART_RXROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_ST7789_RX_PIN << _GPIO_USART_RXROUTE_PIN_SHIFT); - GPIO->USARTROUTE[ADAFRUIT_ST7789_PERIPHERAL_NO].CLKROUTE = - ((uint32_t)ADAFRUIT_ST7789_CLK_PORT << _GPIO_USART_CLKROUTE_PORT_SHIFT) - | ((uint32_t)ADAFRUIT_ST7789_CLK_PIN << _GPIO_USART_CLKROUTE_PIN_SHIFT); -#endif - - GPIO_PinModeSet(ADAFRUIT_ST7789_TX_PORT, - ADAFRUIT_ST7789_TX_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ADAFRUIT_ST7789_RX_PORT, - ADAFRUIT_ST7789_RX_PIN, - gpioModeInput, - 0); - GPIO_PinModeSet(ADAFRUIT_ST7789_CLK_PORT, - ADAFRUIT_ST7789_CLK_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ADAFRUIT_ST7789_CS_PORT, - ADAFRUIT_ST7789_CS_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ST7789_SPI_DC_PORT, - ST7789_SPI_DC_PIN, - gpioModePushPull, - 0); -} - // ----------------------------------------------------------------------------- // Public Function // ----------------------------------------------------------------------------- @@ -437,30 +375,32 @@ static void spi_usart_init(void) /**************************************************************************//** * Initialize the Adafruit ST7789 Color TFT Display Driver. *****************************************************************************/ -sl_status_t adafruit_st7789_spi_usart_init(void) +sl_status_t adafruit_st7789_spi_init(const struct mipi_dbi_config *config) { + mipi_dbi_device_init(&mipi_dbi_device, config); + static uint8_t init_cmd[] = { 9, // 9 commands in list: ST7789_SWRESET, ST_CMD_DELAY, // 1: Software reset, no args, w/delay 150, // ~150 ms delay ST7789_SLPOUT, ST_CMD_DELAY, // 2: Out of sleep mode, no args, w/delay 10, // 10 ms delay - ST7789_COLMOD, 1 + ST_CMD_DELAY,// 3: Set color mode, 1 arg + delay: + ST7789_COLMOD, 1 + ST_CMD_DELAY, // 3: Set color mode, 1 arg + delay: 0x55, // 16-bit color 10, // 10 ms delay ST7789_MADCTL, 1, // 4: Mem access ctrl (directions), 1 arg: 0x08, // Row/col addr, bottom-top refresh ST7789_CASET, 4, // 5: Column addr set, 4 args, no delay: 0x00, - 0, // XSTART = 0 + 0, // XSTART = 0 (ST7789_TFTWIDTH >> 8), - (ST7789_TFTWIDTH & 0xFF), // XEND = ST7789_TFTWIDTH + (ST7789_TFTWIDTH & 0xFF), // XEND = ST7789_TFTWIDTH ST7789_RASET, 4, // 6: Row addr set, 4 args, no delay: 0x00, - 0, // YSTART = 0 + 0, // YSTART = 0 (ST7789_TFTHEIGHT >> 8), - (ST7789_TFTHEIGHT & 0xFF), // YEND = ST7789_TFTHEIGHT - ST7789_INVOFF, ST_CMD_DELAY, // 7: INVOFF + (ST7789_TFTHEIGHT & 0xFF), // YEND = ST7789_TFTHEIGHT + ST7789_INVOFF, ST_CMD_DELAY, // 7: INVOFF 10, ST7789_NORON, ST_CMD_DELAY, // 8: Normal display on, no args, w/delay 10, // 10 ms delay @@ -468,8 +408,6 @@ sl_status_t adafruit_st7789_spi_usart_init(void) 10 }; - spi_usart_init(); - uint8_t numCommands, cmd, numArgs; uint16_t ms; uint8_t *addr = init_cmd; @@ -480,7 +418,7 @@ sl_status_t adafruit_st7789_spi_usart_init(void) numArgs = pgm_read_byte(addr++); // Number of args to follow ms = numArgs & ST_CMD_DELAY; // If hibit set, delay follows args numArgs &= ~ST_CMD_DELAY; // Mask out delay bit - adafruit_st7789_spi_send_command(cmd, addr, numArgs); + send_command(cmd, addr, numArgs); addr += numArgs; if (ms) { @@ -524,7 +462,7 @@ uint16_t adafruit_st7789_get_display_height(void) *****************************************************************************/ sl_status_t adafruit_st7789_invert_display(bool invert) { - return adafruit_st7789_spi_send_command( + return send_command( invert ? ST7789_INVON : ST7789_INVOFF, NULL, 0); } @@ -533,7 +471,7 @@ sl_status_t adafruit_st7789_invert_display(bool invert) *****************************************************************************/ sl_status_t adafruit_st7789_enable_display(bool enable) { - return adafruit_st7789_spi_send_command( + return send_command( enable ? ST7789_DISPON : ST7789_DISPOFF, NULL, 0); } @@ -547,7 +485,7 @@ sl_status_t adafruit_st7789_enable_display(bool enable) /**************************************************************************/ sl_status_t adafruit_st7789_enable_tearing(bool enable) { - return adafruit_st7789_spi_send_command( + return send_command( enable ? ST7789_TEON : ST7789_TEOFF, NULL, 0); } @@ -561,7 +499,7 @@ sl_status_t adafruit_st7789_enable_tearing(bool enable) /**************************************************************************/ sl_status_t adafruit_st7789_enableSleep(bool enable) { - return adafruit_st7789_spi_send_command( + return send_command( enable ? ST7789_SLPIN : ST7789_SLPOUT, NULL, 0); } @@ -571,19 +509,23 @@ sl_status_t adafruit_st7789_enableSleep(bool enable) sl_status_t adafruit_st7789_set_addr_window(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { + sl_status_t status; x += _xstart; y += _ystart; uint32_t xa = ((uint32_t)x << 16) | (x + w - 1); uint32_t ya = ((uint32_t)y << 16) | (y + h - 1); - adafruit_st7789_spi_write_command(ST7789_CASET); // Column addr set - adafruit_st7789_spi_write32(xa); + status = command_write_b32(ST7789_CASET, + xa); + if (SL_STATUS_OK != status) { + return status; + } - adafruit_st7789_spi_write_command(ST7789_RASET); // Row addr set - adafruit_st7789_spi_write32(ya); + status = command_write_b32(ST7789_RASET, + ya); // Write to RAM - return adafruit_st7789_spi_write_command(ST7789_RAMWR); + return command_write(ST7789_RAMWR); } /**************************************************************************//** @@ -626,7 +568,7 @@ sl_status_t adafruit_st7789_set_rotation(adafruit_st7789_rotation_e rotation) break; } - return adafruit_st7789_spi_send_command(ST7789_MADCTL, &madctl, 1); + return send_command(ST7789_MADCTL, &madctl, 1); } /**************************************************************************//** @@ -634,16 +576,17 @@ sl_status_t adafruit_st7789_set_rotation(adafruit_st7789_rotation_e rotation) *****************************************************************************/ sl_status_t adafruit_st7789_draw_pixel(int16_t x, int16_t y, uint16_t color) { + sl_status_t status; if ((x >= 0) && (x < _width) && (y >= 0) && (y < _height)) { // THEN set up transaction (if needed) and draw... - SPI_CS_LOW(); - adafruit_st7789_set_addr_window(x, y, 1, 1); - adafruit_st7789_spi_write16(color); - SPI_CS_HIGH(); - - return SL_STATUS_OK; + status = adafruit_st7789_set_addr_window(x, y, 1, 1); + if (SL_STATUS_OK != status) { + return status; + } + return write_display16(color); } + return SL_STATUS_INVALID_PARAMETER; } @@ -652,11 +595,11 @@ sl_status_t adafruit_st7789_draw_pixel(int16_t x, int16_t y, uint16_t color) *****************************************************************************/ sl_status_t adafruit_st7789_fill_screen(uint16_t color) { - return adafruit_st7789_fill_rect(0, - 0, - _width, - _height, - color); + return fill_rect(0, + 0, + _width, + _height, + color); } /**************************************************************************//** @@ -668,6 +611,10 @@ sl_status_t adafruit_st7789_draw_rgb_bitmap(int16_t x, int16_t w, int16_t h) { + if (color == NULL) { + return SL_STATUS_INVALID_PARAMETER; + } + int16_t x2; int16_t y2; int16_t bx1 = 0; @@ -680,6 +627,7 @@ sl_status_t adafruit_st7789_draw_rgb_bitmap(int16_t x, || ((y2 = (y + h - 1)) < 0)) { return SL_STATUS_INVALID_PARAMETER; } + if (x < 0) { w += x; bx1 = -x; @@ -697,19 +645,19 @@ sl_status_t adafruit_st7789_draw_rgb_bitmap(int16_t x, h = _height - y; } color += by1 * save_w + bx1; - SPI_CS_LOW(); +// mipi_dbi_device.api->select(&mipi_dbi_device); adafruit_st7789_set_addr_window(x, y, w, h); while (h--) { - adafruit_st7789_write_pixels(color, w); + write_pixels(color, w); color += save_w; } - SPI_CS_HIGH(); +// mipi_dbi_device.api->deselect(&mipi_dbi_device); return SL_STATUS_OK; } /**************************************************************************//** - * Fill the screen area with color. After the process + * Fill the screen area with color using SPI transmit DMA. After the process * is complete call the user callback to notify the higher layer. *****************************************************************************/ sl_status_t adafruit_st7789_flush_area_rgb565(int16_t x1, int16_t y1, @@ -719,37 +667,73 @@ sl_status_t adafruit_st7789_flush_area_rgb565(int16_t x1, int16_t y1, void (*callback)(void *arg), void *callback_arg) { - sl_status_t sc = SL_STATUS_FAIL; + sl_status_t status; - if ((pcolor == NULL) || (callback == NULL)) { - return SL_STATUS_INVALID_PARAMETER; - } - - if ((x1 >= 0) && (x1 < _width) + if ((pcolor != NULL) && (callback != NULL) + && (x1 >= 0) && (x1 < _width) && (x2 >= 0) && (x2 < _width) && (y1 >= 0) && (y1 < _height) && (y2 >= 0) && (y2 < _height) && (x2 >= x1) && (y2 >= y1)) { - uint16_t *p_color = (uint16_t *)pcolor; + uint16_t width = x2 - x1 + 1; + uint16_t hight = y2 - y1 + 1; + +// mipi_dbi_device.api->select(&mipi_dbi_device); + adafruit_st7789_set_addr_window(x1, y1, width, hight); + + gtotal_pixel = width * hight; + gpixel_transmit = 0; + gpixel_transmit_counter = 0; + color_swap_enabled = color_swap; + flush_area_callback = callback; + flush_area_callback_arg = callback_arg; + + while (gpixel_transmit_counter < gtotal_pixel) { + uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; + gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT + ? MAX_XFER_PIXEL_COUNT : pixel_remaining; + + if (!color_swap_enabled) { + uint16_t i; + pColorSwap = pcolor; + uint8_t colorData_H; + uint8_t colorData_L; + + for (i = 0; i < gpixel_transmit; i++) { + colorData_H = + pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; + colorData_L = + pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; + + /* Swap 2 bytes color data before sending to TFT LCD */ + dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; + } - for (int16_t y = y1; y <= y2; y++) { - for (int16_t x = x1; x <= x2; x++) { - uint16_t color; + pColorBuffer = (uint8_t *)dma_buffer; + } else { + pColorBuffer = (uint8_t *)pcolor; + } - if (color_swap) { - color = *p_color >> 8 | ((uint16_t)(*p_color & 0xff) << 8); - } else { - color = *p_color; - } - sc = adafruit_st7789_draw_pixel(x, y, color); - if (SL_STATUS_OK != sc) { - goto end; - } - p_color++; + /* Start transmit data, the process is continued in + * adafruit_st7789_flush_area_transmit_callback function + */ + status = write_display((uint8_t *)pColorBuffer, + gpixel_transmit * BYTE_PER_PIXEL, + NULL); + if (SL_STATUS_OK != status) { + goto error; + } + if (color_swap_enabled) { + pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); } + + gpixel_transmit_counter += gpixel_transmit; } + callback(callback_arg); + return SL_STATUS_OK; } - end: + return SL_STATUS_INVALID_PARAMETER; + error: callback(callback_arg); - return sc; + return status; } diff --git a/driver/public/silabs/tft_lcd_st7789/src/adafruit_st7789_dma.c b/driver/public/silabs/tft_lcd_st7789/src/adafruit_st7789_dma.c deleted file mode 100644 index e4e905ad..00000000 --- a/driver/public/silabs/tft_lcd_st7789/src/adafruit_st7789_dma.c +++ /dev/null @@ -1,848 +0,0 @@ -/***************************************************************************//** - * @file adafruit_st7789_dma.c - * @brief Adafruit ST7789 Color TFT Display Driver source file. - * @version 1.0.0 - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * - * EVALUATION QUALITY - * This code has been minimally tested to ensure that it builds with the - * specified dependency versions and is suitable as a demonstration for - * evaluation purposes only. - * This code will be maintained at the sole discretion of Silicon Labs. - * - ******************************************************************************/ -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- -#include "em_cmu.h" -#include "em_gpio.h" -#include "sl_status.h" -#include "sl_sleeptimer.h" -#include "sl_component_catalog.h" -#include "spidrv.h" -#include "adafruit_st7789_spi_dma_config.h" -#include "sl_spidrv_st7789_config.h" -#include "adafruit_st7789.h" - -// ----------------------------------------------------------------------------- -// Macros -// ----------------------------------------------------------------------------- -#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) -#define BYTE_PER_PIXEL (2) /* 2 Bytes color data per pixel */ -#define MAX_XFER_PIXEL_COUNT ((DMADRV_MAX_XFER_COUNT) / BYTE_PER_PIXEL) - -#define SPI_CS_LOW(handle) \ - GPIO_PinOutClear(handle->portCs, handle->pinCs); -#define SPI_CS_HIGH(handle) \ - GPIO_PinOutSet(handle->portCs, handle->pinCs); - -#define SPI_DC_LOW() \ - GPIO_PinOutClear(ST7789_SPI_DC_PORT, ST7789_SPI_DC_PIN); -#define SPI_DC_HIGH() \ - GPIO_PinOutSet(ST7789_SPI_DC_PORT, ST7789_SPI_DC_PIN); - -// ----------------------------------------------------------------------------- -// Local Variables -// ----------------------------------------------------------------------------- -static SPIDRV_Handle_t gspi_handle = NULL; -static uint16_t _colstart = 0, _colstart2 = 0; -static uint16_t _rowstart = 0, _rowstart2 = 0; -static uint16_t _xstart = 0, _ystart = 0; -static uint16_t _width = ST7789_TFTWIDTH, _height = ST7789_TFTHEIGHT; -static bool color_swap_enabled = false; -static uint32_t gtotal_pixel = 0; -static uint32_t gpixel_transmit = 0; -static uint32_t gpixel_transmit_counter = 0; -static uint8_t *pColorBuffer = NULL; -static void (*flush_area_callback)(void *arg) = NULL; -static void *flush_area_callback_arg = NULL; - -static uint16_t dma_buffer[(DMADRV_MAX_XFER_COUNT + 1) / 2]; -static uint8_t *pColorSwap = NULL; - -static sl_status_t adafruit_st7789_spi_send_command(uint8_t command, - const uint8_t *data, - uint8_t len); -static sl_status_t adafruit_st7789_spi_write_command(uint8_t cmd); -static sl_status_t adafruit_st7789_spi_write16(uint16_t data); -static sl_status_t adafruit_st7789_spi_write32(uint32_t data); -static sl_status_t adafruit_st7789_write_color(uint16_t color, uint32_t len); -static sl_status_t adafruit_st7789_write_pixels(uint16_t *colors, uint32_t len); -static sl_status_t adafruit_st7789_write_fill_rect_preclipped(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color); -static sl_status_t adafruit_st7789_fill_rect(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color); -static void st7789_flush_area_transmit_callback( - struct SPIDRV_HandleData *handle, - Ecode_t transferStatus, - int itemsTransferred); - -/***************************************************************************//** - * @brief - * Adafruit_SPITFT Send Command handles complete sending of commands and - * data. - * - * @param[in] command - * The Command Byte. - * @param[in] data - * A pointer to the Data bytes to send. - * @param[in] len - * The number of bytes we should send. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO or SL_STATUS_INVALID_PARAMETER if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_send_command(uint8_t command, - const uint8_t *data, - uint8_t len) -{ - Ecode_t retVal; - sl_status_t stt = SL_STATUS_OK; - - SPI_CS_LOW(gspi_handle); - SPI_DC_LOW(); - - retVal = SPIDRV_MTransmitB(gspi_handle, &command, 1); - SPI_DC_HIGH(); - - if (ECODE_OK != retVal) { - stt = SL_STATUS_IO; - goto end; - } - - if (len != 0) { - if (NULL != data) { - retVal = SPIDRV_MTransmitB(gspi_handle, data, len); - if (ECODE_OK != retVal) { - stt = SL_STATUS_IO; - goto end; - } - } else { - stt = SL_STATUS_INVALID_PARAMETER; - goto end; - } - } - - end: - SPI_CS_HIGH(gspi_handle); - return stt; -} - -/***************************************************************************//** - * @brief - * Write a single command byte to the display. - * - * @param[in] cmd - * 8-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_write_command(uint8_t cmd) -{ - SPI_DC_LOW(); - Ecode_t retVal = SPIDRV_MTransmitB(gspi_handle, &cmd, 1); - SPI_DC_HIGH(); - - return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Write a single command word to the display. - * - * @param[in] cmd - * 16-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_write16(uint16_t data) -{ - uint8_t bytes[2]; - - bytes[0] = data >> 8; - bytes[1] = data & 0x00FF; - - Ecode_t retVal = SPIDRV_MTransmitB(gspi_handle, bytes, 2); - - return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Write a double command word to the display. - * - * @param[in] cmd - * 32-bit command to write. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_spi_write32(uint32_t data) -{ - uint8_t bytes[4]; - - bytes[0] = (data >> 24); - bytes[1] = (data >> 16) & 0x00FF; - bytes[2] = (data >> 8) & 0x0000FF; - bytes[3] = data & 0x000000FF; - - Ecode_t retVal = SPIDRV_MTransmitB(gspi_handle, bytes, 4); - - return ECODE_OK == retVal ? SL_STATUS_OK : SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Issue a series of pixels, all the same color. - * - * @param[in] color - * 16-bit pixel color in '565' RGB format. - * @param[in] len - * Number of pixels to draw. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - * SL_STATUS_INVALID_PARAMETER if (len = 0) - ******************************************************************************/ -static sl_status_t adafruit_st7789_write_color(uint16_t color, uint32_t len) -{ - uint32_t i, n, size; - Ecode_t retVal; - - if (!len) { - return SL_STATUS_INVALID_PARAMETER; - } - for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { - if (n + MAX_XFER_PIXEL_COUNT <= len) { - size = MAX_XFER_PIXEL_COUNT; - } else { - size = len - n; - } - - for (i = 0; i < size; i++) { - dma_buffer[i] = color >> 8 | ((uint16_t)(color & 0xff) << 8); - } - retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); - if (ECODE_OK != retVal) { - goto error; - } - } - - return SL_STATUS_OK; - error: - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * Issue a series of pixels from memory to the display. - * - * @param[in] colors - * Pointer to array of 16-bit pixel values in '565' RGB format. - * @param[in] len - * Number of elements in 'colors' array. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_IO if the process is failed. - * SL_STATUS_INVALID_PARAMETER if (len = 0) or (colors == NULL) - ******************************************************************************/ -static sl_status_t adafruit_st7789_write_pixels(uint16_t *colors, uint32_t len) -{ - uint32_t i, n, size; - Ecode_t retVal; - - if ((!len) || (colors == NULL)) { - return SL_STATUS_INVALID_PARAMETER; - } - - for (n = 0; n < len; n += MAX_XFER_PIXEL_COUNT) { - if (n + MAX_XFER_PIXEL_COUNT <= len) { - size = MAX_XFER_PIXEL_COUNT; - } else { - size = len - n; - } - - for (i = 0; i < size; i++) { - dma_buffer[i] = *colors >> 8 | ((uint16_t)(*colors & 0xff) << 8); - colors++; - } - retVal = SPIDRV_MTransmitB(gspi_handle, dma_buffer, size * 2); - if (ECODE_OK != retVal) { - goto error; - } - } - - return SL_STATUS_OK; - error: - return SL_STATUS_IO; -} - -/***************************************************************************//** - * @brief - * A lower-level version of adafruit_st7789_fill_rect(). This version - * requires all inputs are in-bounds, that width and height are positive, - * and no part extends offscreen. NO EDGE CLIPPING OR REJECTION IS PERFORMED. - * If higher-level graphics primitives are written to handle their own - * clipping earlier in the drawing process, this can avoid unnecessary - * function calls and repeated clipping operations in the lower-level - * functions. - * - * @param[in] x - * Horizontal position of first corner. MUST BE WITHIN SCREEN BOUNDS. - * @param[in] y - * Vertical position of first corner. MUST BE WITHIN SCREEN BOUNDS. - * @param[in] w - * Rectangle width in pixels. MUST BE POSITIVE AND NOT EXTEND OFF SCREEN. - * @param[in] h - * Rectangle height in pixels. MUST BE POSITIVE AND NOT EXTEND OFF SCREEN. - * @param[in] color - * 16-bit fill color in '565' RGB format. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_write_fill_rect_preclipped(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) -{ - adafruit_st7789_set_addr_window(x, y, w, h); - adafruit_st7789_write_color(color, (uint32_t)w * h); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Draw a filled rectangle to the display. - * - * @param[in] x - * Horizontal position of first corner. - * @param[in] y - * Vertical position of first corner. - * @param[in] w - * Rectangle width in pixels (positive = right of first corner, - * negative = left of first corner). - * @param[in] h - * Rectangle height in pixels (positive = below first corner, - * negative = above first corner) - * @param[in] color - * 16-bit fill color in '565' RGB format. - * - * @return - * SL_STATUS_OK if there are no errors. - * SL_STATUS_FAIL if the process is failed. - ******************************************************************************/ -static sl_status_t adafruit_st7789_fill_rect(int16_t x, - int16_t y, - int16_t w, - int16_t h, - uint16_t color) -{ - if (w && h) { - if (w < 0) { - x += w + 1; - w = -w; - } - if (x < _width) { - if (h < 0) { - y += h + 1; - h = -h; - } - if (y < _height) { - int16_t x2 = x + w - 1; - if (x2 >= 0) { - int16_t y2 = y + h - 1; - if (y2 >= 0) { - if (x < 0) { - x = 0; - w = x2 + 1; - } - if (y < 0) { - y = 0; - h = y2 + 1; - } - if (x2 >= _width) { - w = _width - x; - } - if (y2 >= _height) { - h = _height - y; - } - SPI_CS_LOW(gspi_handle); - adafruit_st7789_write_fill_rect_preclipped(x, y, w, h, color); - SPI_CS_HIGH(gspi_handle); - } - } - } - } - } - - return SL_STATUS_OK; -} - -// ----------------------------------------------------------------------------- -// Public Function -// ----------------------------------------------------------------------------- - -/**************************************************************************//** - * Initialize the Adafruit ST7789 Color TFT Display Driver. - *****************************************************************************/ -sl_status_t adafruit_st7789_spi_dma_init(SPIDRV_Handle_t spidrv_handle) -{ - gspi_handle = spidrv_handle; - - GPIO_PinModeSet(SL_SPIDRV_ST7789_CS_PORT, - SL_SPIDRV_ST7789_CS_PIN, - gpioModePushPull, - 0); - GPIO_PinModeSet(ST7789_SPI_DC_PORT, - ST7789_SPI_DC_PIN, - gpioModePushPull, - 0); - - static uint8_t init_cmd[] = { - 9, // 9 commands in list: - ST7789_SWRESET, ST_CMD_DELAY, // 1: Software reset, no args, w/delay - 150, // ~150 ms delay - ST7789_SLPOUT, ST_CMD_DELAY, // 2: Out of sleep mode, no args, w/delay - 10, // 10 ms delay - ST7789_COLMOD, 1 + ST_CMD_DELAY, // 3: Set color mode, 1 arg + delay: - 0x55, // 16-bit color - 10, // 10 ms delay - ST7789_MADCTL, 1, // 4: Mem access ctrl (directions), 1 arg: - 0x08, // Row/col addr, bottom-top refresh - ST7789_CASET, 4, // 5: Column addr set, 4 args, no delay: - 0x00, - 0, // XSTART = 0 - (ST7789_TFTWIDTH >> 8), - (ST7789_TFTWIDTH & 0xFF), // XEND = ST7789_TFTWIDTH - ST7789_RASET, 4, // 6: Row addr set, 4 args, no delay: - 0x00, - 0, // YSTART = 0 - (ST7789_TFTHEIGHT >> 8), - (ST7789_TFTHEIGHT & 0xFF), // YEND = ST7789_TFTHEIGHT - ST7789_INVOFF, ST_CMD_DELAY, // 7: INVOFF - 10, - ST7789_NORON, ST_CMD_DELAY, // 8: Normal display on, no args, w/delay - 10, // 10 ms delay - ST7789_DISPON, ST_CMD_DELAY, // 9: Main screen turn on, no args, delay - 10 - }; - - uint8_t numCommands, cmd, numArgs; - uint16_t ms; - uint8_t *addr = init_cmd; - - numCommands = pgm_read_byte(addr++); // Number of commands to follow - while (numCommands--) { // For each command... - cmd = pgm_read_byte(addr++); // Read command - numArgs = pgm_read_byte(addr++); // Number of args to follow - ms = numArgs & ST_CMD_DELAY; // If hibit set, delay follows args - numArgs &= ~ST_CMD_DELAY; // Mask out delay bit - adafruit_st7789_spi_send_command(cmd, addr, numArgs); - addr += numArgs; - - if (ms) { - ms = pgm_read_byte(addr++); // Read post-command delay time (ms) - if (ms == 255) { - ms = 500; // If 255, delay for 500 ms - } - sl_sleeptimer_delay_millisecond(ms); - } - } - - _rowstart = _rowstart2 = (int)((320 - ST7789_TFTHEIGHT) / 2); - _colstart = (int)((240 - ST7789_TFTWIDTH + 1) / 2); - _colstart2 = (int)((240 - ST7789_TFTWIDTH) / 2); - - adafruit_st7789_set_rotation(adafruit_st7789_rotation_none); - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * Get the current display width. This value will be changed when the screen is - * rotated. - *****************************************************************************/ -uint16_t adafruit_st7789_get_display_width(void) -{ - return _width; -} - -/**************************************************************************//** - * Get the current display height. This value will be changed when the screen is - * rotated. - *****************************************************************************/ -uint16_t adafruit_st7789_get_display_height(void) -{ - return _height; -} - -/**************************************************************************//** - * Enable/Disable display color inversion. - *****************************************************************************/ -sl_status_t adafruit_st7789_invert_display(bool invert) -{ - return adafruit_st7789_spi_send_command( - invert ? ST7789_INVON : ST7789_INVOFF, NULL, 0); -} - -/**************************************************************************//** - * Enable/Disable display on or off - *****************************************************************************/ -sl_status_t adafruit_st7789_enable_display(bool enable) -{ - return adafruit_st7789_spi_send_command( - enable ? ST7789_DISPON : ST7789_DISPOFF, NULL, 0); -} - -/**************************************************************************/ - -/*! - * @brief Change whether TE pin output is on or off - * @param enable True if you want the TE pin ON, false OFF - */ - -/**************************************************************************/ -sl_status_t adafruit_st7789_enable_tearing(bool enable) -{ - return adafruit_st7789_spi_send_command( - enable ? ST7789_TEON : ST7789_TEOFF, NULL, 0); -} - -/**************************************************************************/ - -/*! - * @brief Change whether sleep mode is on or off - * @param enable True if you want sleep mode ON, false OFF - */ - -/**************************************************************************/ -sl_status_t adafruit_st7789_enableSleep(bool enable) -{ - return adafruit_st7789_spi_send_command( - enable ? ST7789_SLPIN : ST7789_SLPOUT, NULL, 0); -} - -/**************************************************************************//** - * Set the "address window" - the rectangle we will write to RAM. - *****************************************************************************/ -sl_status_t adafruit_st7789_set_addr_window(uint16_t x, uint16_t y, - uint16_t w, uint16_t h) -{ - x += _xstart; - y += _ystart; - uint32_t xa = ((uint32_t)x << 16) | (x + w - 1); - uint32_t ya = ((uint32_t)y << 16) | (y + h - 1); - - adafruit_st7789_spi_write_command(ST7789_CASET); // Column addr set - adafruit_st7789_spi_write32(xa); - - adafruit_st7789_spi_write_command(ST7789_RASET); // Row addr set - adafruit_st7789_spi_write32(ya); - - // Write to RAM - return adafruit_st7789_spi_write_command(ST7789_RAMWR); -} - -/**************************************************************************//** - * Set the rotation of TFT - *****************************************************************************/ -sl_status_t adafruit_st7789_set_rotation(adafruit_st7789_rotation_e rotation) -{ - uint8_t madctl = 0; - - uint8_t _rotation = rotation % 4; // can't be higher than 3 - - switch (_rotation) { - case adafruit_st7789_rotation_none: - madctl = ST7789_MADCTL_MX | ST7789_MADCTL_MY | ST7789_MADCTL_RGB; - _xstart = _colstart; - _ystart = _rowstart; - _width = ST7789_TFTWIDTH; - _height = ST7789_TFTHEIGHT; - break; - case adafruit_st7789_rotation_90: - madctl = ST7789_MADCTL_MY | ST7789_MADCTL_MV | ST7789_MADCTL_RGB; - _xstart = _rowstart; - _ystart = _colstart2; - _width = ST7789_TFTHEIGHT; - _height = ST7789_TFTWIDTH; - break; - case adafruit_st7789_rotation_180: - madctl = ST7789_MADCTL_RGB; - _xstart = _colstart2; - _ystart = _rowstart2; - _width = ST7789_TFTWIDTH; - _height = ST7789_TFTHEIGHT; - break; - case adafruit_st7789_rotation_270: - madctl = ST7789_MADCTL_MX | ST7789_MADCTL_MV | ST7789_MADCTL_RGB; - _xstart = _rowstart2; - _ystart = _colstart; - _width = ST7789_TFTHEIGHT; - _height = ST7789_TFTWIDTH; - break; - } - - return adafruit_st7789_spi_send_command(ST7789_MADCTL, &madctl, 1); -} - -/**************************************************************************//** - * Draw a single pixel to the display at requested coordinates. - *****************************************************************************/ -sl_status_t adafruit_st7789_draw_pixel(int16_t x, int16_t y, uint16_t color) -{ - if ((x >= 0) && (x < _width) && (y >= 0) - && (y < _height)) { - // THEN set up transaction (if needed) and draw... - SPI_CS_LOW(gspi_handle); - adafruit_st7789_set_addr_window(x, y, 1, 1); - adafruit_st7789_spi_write16(color); - SPI_CS_HIGH(gspi_handle); - - return SL_STATUS_OK; - } - - return SL_STATUS_INVALID_PARAMETER; -} - -/**************************************************************************//** - * Fill the screen completely with one color. - *****************************************************************************/ -sl_status_t adafruit_st7789_fill_screen(uint16_t color) -{ - return adafruit_st7789_fill_rect(0, - 0, - _width, - _height, - color); -} - -/**************************************************************************//** - * Draw a 16-bit image (565 RGB) at the specified (x,y) position. - *****************************************************************************/ -sl_status_t adafruit_st7789_draw_rgb_bitmap(int16_t x, - int16_t y, - uint16_t *color, - int16_t w, - int16_t h) -{ - if (color == NULL) { - return SL_STATUS_INVALID_PARAMETER; - } - - int16_t x2; - int16_t y2; - int16_t bx1 = 0; - int16_t by1 = 0; - int16_t save_w = w; - - if ((x >= _width) - || (y >= _height) - || ((x2 = (x + w - 1)) < 0) - || ((y2 = (y + h - 1)) < 0)) { - return SL_STATUS_INVALID_PARAMETER; - } - - if (x < 0) { - w += x; - bx1 = -x; - x = 0; - } - if (y < 0) { - h += y; - by1 = -y; - y = 0; - } - if (x2 >= _width) { - w = _width - x; - } - if (y2 >= _height) { - h = _height - y; - } - color += by1 * save_w + bx1; - SPI_CS_LOW(gspi_handle); - adafruit_st7789_set_addr_window(x, y, w, h); - while (h--) { - adafruit_st7789_write_pixels(color, w); - color += save_w; - } - SPI_CS_HIGH(gspi_handle); - - return SL_STATUS_OK; -} - -/**************************************************************************//** - * Fill the screen area with color using SPI transmit DMA. After the process - * is complete call the user callback to notify the higher layer. - *****************************************************************************/ -sl_status_t adafruit_st7789_flush_area_rgb565(int16_t x1, int16_t y1, - int16_t x2, int16_t y2, - uint8_t *pcolor, - bool color_swap, - void (*callback)(void *arg), - void *callback_arg) -{ - if ((pcolor != NULL) && (callback != NULL) - && (x1 >= 0) && (x1 < _width) - && (x2 >= 0) && (x2 < _width) - && (y1 >= 0) && (y1 < _height) - && (y2 >= 0) && (y2 < _height) - && (x2 >= x1) && (y2 >= y1)) { - uint16_t width = x2 - x1 + 1; - uint16_t hight = y2 - y1 + 1; - - SPI_CS_LOW(gspi_handle); - adafruit_st7789_set_addr_window(x1, y1, width, hight); - - gtotal_pixel = width * hight; - gpixel_transmit = 0; - gpixel_transmit_counter = 0; - color_swap_enabled = color_swap; - flush_area_callback = callback; - flush_area_callback_arg = callback_arg; - - if (gpixel_transmit_counter < gtotal_pixel) { - uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; - gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT - ? MAX_XFER_PIXEL_COUNT : pixel_remaining; - - if (!color_swap_enabled) { - uint16_t i; - pColorSwap = pcolor; - uint8_t colorData_H; - uint8_t colorData_L; - - for (i = 0; i < gpixel_transmit; i++) { - colorData_H = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; - colorData_L = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; - - /* Swap 2 bytes color data before sending to TFT LCD */ - dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; - } - - pColorBuffer = (uint8_t *)dma_buffer; - } else { - pColorBuffer = (uint8_t *)pcolor; - } - - /* Start transmit data, the process is continued in - * adafruit_st7789_flush_area_transmit_callback function - */ - - SPIDRV_MTransmit(gspi_handle, - (uint8_t *)pColorBuffer, - gpixel_transmit * BYTE_PER_PIXEL, - st7789_flush_area_transmit_callback); - - if (color_swap_enabled) { - pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); - } - - gpixel_transmit_counter += gpixel_transmit; - } - - return SL_STATUS_OK; - } - return SL_STATUS_INVALID_PARAMETER; -} - -static void st7789_flush_area_transmit_callback( - struct SPIDRV_HandleData *handle, - Ecode_t transferStatus, - int itemsTransferred) -{ - (void)itemsTransferred; - - if (handle == gspi_handle) { - if (transferStatus == ECODE_OK) { - if (gpixel_transmit_counter < gtotal_pixel) { - /* Continue transmit the data */ - uint32_t pixel_remaining = gtotal_pixel - gpixel_transmit_counter; - gpixel_transmit = pixel_remaining > MAX_XFER_PIXEL_COUNT - ? MAX_XFER_PIXEL_COUNT : pixel_remaining; - - if (!color_swap_enabled) { - uint16_t i; - uint8_t colorData_H; - uint8_t colorData_L; - - for (i = 0; i < gpixel_transmit; i++) { - colorData_H = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL) + 1]; - colorData_L = - pColorSwap[((gpixel_transmit_counter + i) * BYTE_PER_PIXEL)]; - - /* Swap 2 bytes color data before sending to TFT LCD */ - dma_buffer[i] = colorData_H | (uint16_t)colorData_L << 8; - } - - pColorBuffer = (uint8_t *)dma_buffer; - } - SPIDRV_MTransmit(gspi_handle, - (uint8_t *)pColorBuffer, - gpixel_transmit * BYTE_PER_PIXEL, - st7789_flush_area_transmit_callback); - - if (color_swap_enabled) { - pColorBuffer += (gpixel_transmit * BYTE_PER_PIXEL); - } - - gpixel_transmit_counter += gpixel_transmit; - } else { - /* After the process is complete call the user callback to - * notify the higher layer. - */ - SPI_CS_HIGH(gspi_handle); - - if (flush_area_callback != NULL) { - flush_area_callback(flush_area_callback_arg); - } - } - } - } -} diff --git a/driver/public/silabs/touchscreen_tsc2007/inc/adafruit_tsc2007.h b/driver/public/silabs/touchscreen_tsc2007/inc/adafruit_tsc2007.h index 4a904409..13fd2729 100644 --- a/driver/public/silabs/touchscreen_tsc2007/inc/adafruit_tsc2007.h +++ b/driver/public/silabs/touchscreen_tsc2007/inc/adafruit_tsc2007.h @@ -2,7 +2,6 @@ #define _ADAFRUIT_TSC2007_H #include "sl_status.h" -#include "sl_i2cspm.h" /*! * @brief Different function commands @@ -38,6 +37,10 @@ typedef enum { TSC2007_ADC_8BIT = 1, } adafruit_tsc2007_resolution_t; +struct adafruit_tsc2007_config { + void *mikroe_drv_i2c_handle; +}; + /***************************************************************************//** * @brief * TSC2007 Initialization. @@ -46,7 +49,7 @@ typedef enum { * @return * Returns SL_STATUS_OK on success, or else error code ******************************************************************************/ -sl_status_t adafruit_tsc2007_init(sl_i2cspm_t *i2cspm_instance); +sl_status_t adafruit_tsc2007_init(const struct adafruit_tsc2007_config *config); /***************************************************************************//** * @brief diff --git a/driver/public/silabs/touchscreen_tsc2007/src/adafruit_tsc2007.c b/driver/public/silabs/touchscreen_tsc2007/src/adafruit_tsc2007.c index 915b64f8..a7a89b22 100644 --- a/driver/public/silabs/touchscreen_tsc2007/src/adafruit_tsc2007.c +++ b/driver/public/silabs/touchscreen_tsc2007/src/adafruit_tsc2007.c @@ -1,40 +1,30 @@ #include #include -#include "gpiointerrupt.h" +#include "drv_i2c_master.h" #include "adafruit_tsc2007_config.h" #include "adafruit_tsc2007.h" -static sl_i2cspm_t *tsc2007_i2cspm_instance = NULL; -static uint16_t t_x, t_y, t_z1, t_z2; -static void (*touch_detect_callback)(void) = NULL; - static sl_status_t tsc2007_command(adafruit_tsc2007_function_t func, adafruit_tsc2007_power_t pwr, adafruit_tsc2007_resolution_t res, uint16_t *out); -static void tsc2007_touch_detect_callback(uint8_t pin); -sl_status_t adafruit_tsc2007_init(sl_i2cspm_t *i2cspm_instance) +static i2c_master_t mikroe_i2c = { + .handle = NULL +}; +static i2c_master_config_t mikroe_i2c_config; +static uint16_t t_x, t_y, t_z1, t_z2; + +sl_status_t adafruit_tsc2007_init(const struct adafruit_tsc2007_config *config) { - tsc2007_i2cspm_instance = i2cspm_instance; - -#if defined(ADAFRUIT_TSC2007_INT_PORT) && defined(ADAFRUIT_TSC2007_INT_PIN) - GPIOINT_Init(); - GPIO_PinModeSet(ADAFRUIT_TSC2007_INT_PORT, - ADAFRUIT_TSC2007_INT_PIN, - gpioModeInputPullFilter, - 1); - GPIO_ExtIntConfig(ADAFRUIT_TSC2007_INT_PORT, - ADAFRUIT_TSC2007_INT_PIN, - ADAFRUIT_TSC2007_INT_PIN, - true, - false, - true); - GPIOINT_CallbackRegister(ADAFRUIT_TSC2007_INT_PIN, - tsc2007_touch_detect_callback); -#endif + mikroe_i2c.handle = config->mikroe_drv_i2c_handle; + i2c_master_configure_default(&mikroe_i2c_config); + mikroe_i2c_config.addr = ADAFRUIT_TSC2007_I2CADDR; +// mikroe_i2c_config.addr = I2C_MASTER_SPEED_FAST; + + i2c_master_open(&mikroe_i2c, &mikroe_i2c_config); return tsc2007_command(TSC2007_MEASURE_TEMP0, TSC2007_POWERDOWN_IRQON, @@ -171,41 +161,25 @@ sl_status_t adafruit_tsc2007_get_touch_point(int32_t *pt_x, return SL_STATUS_OK; } -void adafruit_tsc2007_register_touch_detect_isr_callback( - void (*callback)(void)) -{ - touch_detect_callback = callback; -} - static sl_status_t tsc2007_command(adafruit_tsc2007_function_t func, adafruit_tsc2007_power_t pwr, adafruit_tsc2007_resolution_t res, uint16_t *out) { - I2C_TransferSeq_TypeDef seq; uint8_t cmd; uint8_t reply[2]; - if (tsc2007_i2cspm_instance == NULL) { + if (!mikroe_i2c.handle) { return SL_STATUS_NOT_INITIALIZED; } - seq.addr = ADAFRUIT_TSC2007_I2CADDR << 1; - seq.flags = I2C_FLAG_WRITE_READ; - cmd = (uint8_t)func << 4; cmd |= (uint8_t)pwr << 2; cmd |= (uint8_t)res << 1; - // Write buffer - seq.buf[0].data = &cmd; - seq.buf[0].len = 1; - - // Read buffer - seq.buf[1].data = reply; - seq.buf[1].len = 2; - - if (I2CSPM_Transfer(tsc2007_i2cspm_instance, &seq) != i2cTransferDone) { + if (i2c_master_write_then_read(&mikroe_i2c, + &cmd, 1, + reply, 2) != I2C_MASTER_SUCCESS) { return SL_STATUS_TRANSMIT; } @@ -214,12 +188,3 @@ static sl_status_t tsc2007_command(adafruit_tsc2007_function_t func, } return SL_STATUS_OK; } - -static void tsc2007_touch_detect_callback(uint8_t pin) -{ - (void)pin; - - if (touch_detect_callback) { - touch_detect_callback(); - } -} diff --git a/driver/public/silabs/touchscreen_tsc2007/src/lvgl_input.c b/driver/public/silabs/touchscreen_tsc2007/src/lvgl_input.c index 2284be2a..6a4099ca 100644 --- a/driver/public/silabs/touchscreen_tsc2007/src/lvgl_input.c +++ b/driver/public/silabs/touchscreen_tsc2007/src/lvgl_input.c @@ -34,7 +34,6 @@ ******************************************************************************/ #include "sl_status.h" #include "lvgl_input.h" -#include "sl_i2cspm_instances.h" // ----------------------------------------------------------------------------- // Local Function // ----------------------------------------------------------------------------- @@ -80,8 +79,7 @@ lvgl_input_t *lvgl_input_get(void) static sl_status_t lvgl_input_driver_init(void) { - sl_status_t stt = adafruit_tsc2007_init(sl_i2cspm_qwiic); - return stt; + return SL_STATUS_OK; } static sl_status_t lvgl_input_driver_read_data(void) diff --git a/driver/public/silabs/triac/config/triacdrv_config.h b/driver/public/silabs/triac/config/triacdrv_config.h deleted file mode 100644 index 8c587b26..00000000 --- a/driver/public/silabs/triac/config/triacdrv_config.h +++ /dev/null @@ -1,138 +0,0 @@ -/***************************************************************************//** -* @file triac_config.h -* @brief TRIAC Driver Configuration -******************************************************************************** -* # License -* Copyright 2022 Silicon Laboratories Inc. www.silabs.com -******************************************************************************** -* -* SPDX-License-Identifier: Zlib -* -* The licensor of this software is Silicon Laboratories Inc. -* -* This software is provided \'as-is\', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -* -******************************************************************************* -* # Evaluation Quality -* This code has been minimally tested to ensure that it builds and is suitable -* as a demonstration for evaluation purposes only. This code will be maintained -* at the sole discretion of Silicon Labs. -*******************************************************************************/ -#ifndef TRIAC_CONFIG_H_ -#define TRIAC_CONFIG_H_ - -// <<< Use Configuration Wizard in Context Menu >>> - -// Debug settings - -// Enable ACMP output pin for observation -// Default: 0 -#define TRIACDRV_DEBUG_ACMPOUT 0 - -// Enable PRSACMP output pin for observation -// Default: 0 -#define TRIACDRV_DEBUG_PRSACMP 0 - -// Enable CC1 output to debug pin -// Default: 0 -#define TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT 0 - -// Enable CC2 output to debug pin -// Default: 0 -#define TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT 0 - -// Enable CC1 PRS output to debug pin -// Default: 0 -#define TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT 0 - -// Enable CC2 PRS output to debug pin -// Default: 0 -#define TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT 0 - -// end Debug settings - -// Location settings - -// acmpout loc -// Default: 2 -#define TRIACDRV_DEBUG_ACMPOUT_LOC 2 - -// prsacmp loc -// Default: 0 -#define TRIACDRV_DEBUG_PRSACMP_LOC 0 - -// pulse rise timer out loc -// Default: 4 -#define TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT_LOC 4 - -// pulse fall timer out loc -// Default: 4 -#define TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT_LOC 4 - -// pulse rise prs out loc -// Default: 0 -#define TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT_LOC 0 - -// pulse fall prs out loc -// Default: 2 -#define TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT_LOC 2 - -// end Location settings - -// <<< end of configuration section >>> - -// <<< sl:start pin_tool >>> - -// TRIACDRV_DEBUG_ACMPOUT -// $[GPIO_TRIACDRV_DEBUG_ACMPOUT] -#define TRIACDRV_DEBUG_ACMPOUT_PORT gpioPortD -#define TRIACDRV_DEBUG_ACMPOUT_PIN 6 -// [GPIO_TRIACDRV_DEBUG_ACMPOUT]$ - -// TRIACDRV_DEBUG_PRSACMP -// $[GPIO_TRIACDRV_DEBUG_PRSACMP] -#define TRIACDRV_DEBUG_PRSACMP_PORT gpioPortC -#define TRIACDRV_DEBUG_PRSACMP_PIN 1 -// [GPIO_TRIACDRV_DEBUG_PRSACMP]$ - -// TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT -// $[GPIO_TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT] -#define TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT_PORT gpioPortD -#define TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT_PIN 7 -// [GPIO_TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT]$ - -// TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT -// $[GPIO_TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT] -#define TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT_PORT gpioPortC -#define TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT_PIN 13 -// [GPIO_TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT]$ - -// TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT -// $[GPIO_TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT] -#define TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT_PORT gpioPortC -#define TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT_PIN 8 -// [GPIO_TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT]$ - -// TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT -// $[GPIO_TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT] -#define TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT_PORT gpioPortD -#define TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT_PIN 6 -// [GPIO_TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT]$ - -// <<< sl:end pin_tool >>> - -#endif /* TRIAC_CONFIG_H_ */ diff --git a/driver/public/silabs/triac/inc/triacdrv.h b/driver/public/silabs/triac/inc/triacdrv.h deleted file mode 100644 index 86b40363..00000000 --- a/driver/public/silabs/triac/inc/triacdrv.h +++ /dev/null @@ -1,295 +0,0 @@ -/***************************************************************************//** - * @file triacdrv.h - * @brief ACMP/PRS/TIMER-driven automated triac driver - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ - -#ifndef TRIACDRV_H -#define TRIACDRV_H - -#include -#include - -// Device header -#include "em_device.h" - -// emlib -#include "em_acmp.h" -#include "em_cmu.h" -#include "em_prs.h" -#include "em_timer.h" - -// Platform status -#include "sl_status.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************************************************************//** - * @addtogroup triac Triac Driver - * @brief Triac Driver - * - * ## Overview - * - * TRIACDRV is a hardware device driver for Series 1 EFM32 and EFR32 - * devices that uses an appropriate voltage level representation of - * the AC line voltage in order to fire a timed pulse to drive the - * gate on a triac. - * - * By using the PRS to connect one of the device's analog - * comparators (ACMP) with one of its timers (TIMERs), the triac - * gate enable pulse can be fired automatically and with zero CPU - * intervention. In addition to initializing the necessary hardware, - * the driver includes functions to get and set the duty cycle - * (between 0 and 100% in 1% increments) and to monitor the half-wave - * duty cycle periods as a kind of calibration to account for some - * level of potential variation in the incoming DC waveform due to - * poor line conditions. - * - * The driver is written for Gecko SDK v2.7.x. While it has not been - * tested, nothing in the driver or the example demonstration - * project should preclude it from being built against Gecko SDK - * v3.x. - * - * As mentioned above, the driver runs on Series 1 EFM32 and EFR32 - * devices. The analog comparator, peripheral reflex system (PRS), - * and timer on Series 2 devices have all of the necessary - * functionality to implement the technique used in this driver. - * However, substantial additions of conditionally compiled code - * would be required to handle the differences in analog and digital - * pin routing (ABUS and DBUS) and module initialization between - * Series 1 and 2 devices. - * - * ## Initialization - * - * TRIACDRV uses a structure of type TRIACDRV_Init_TypeDef for - * initialization. It holds all of the chip hardware resources - * needed for operation, as well as parameters that specify the - * characteristics of the AC line waveform input to the analog - * comparator and the output characteristics of the triac gate - * enable pulse. - * - * All initialization is performed by triacdrv_init() using this - * structure. No other hardware initialization is required. - * Furthermore, TRIACDRV prescales the TIMER clock based on the - * frequency of the HFPERCLK that is in effect when triacdrv_init() - * is called. Therefore, the HFPERCLK frequency cannot be changed - * (e.g. by changing the HFCLK frequency) once TRIACDRV is - * initialized. - * - * ## Hardware Configuration - * - * As noted above, triacdrv_init() performs all hardware - * setup with the data passed in the structure of type - * TRIACDRV_Init_TypeDef. - * - * On the hardware front, TRIACDRV requires: - * - * - One analog comparator and one analog input pin - * - * - One 16-bit TIMER, of which 3 channels are used. Unused - * channels cannot be used elsewhere in the end user - * application. - * - * - Three PRS channels, allocated as follows: - * - * + One channel that connects the ACMP output to the TIMER input - * - * + Two adjacent channels for the gate enable output pulse. In - * this sense, adjacent means the channels are numbered N and - * N + 1, such that N + 1 < PRS_CHAN_COUNT (defined in the - * device-specific header file). Furthermore, neither of these - * can be the same PRS channel allocated to the ACMP output. - * - * - One digital output pin corresponding to the base PRS channel - * allocated to the chosen TIMER, e.g. for channels 8 and 9, the - * digital PRS_CH8 pin is needed and must be available. - * - * The default provided by the TRIAC_INIT_DEFAULT initializer does - * not apply to any specific EFM32 or EFR32 board but is useful to - * see how the individual parameters for any given implementation - * need to be configured - * - * ## Operation - * - * After calling triacdrv_init(), the driver is fully operational - * and running with either 0% or 100% duty cycle, depending on the - * setting of the initOn member of the initialization structure. - * - * While the output duty cycle can be changed immediately by calling - * triacdrv_set_duty_cycle() with an integer parameter between 0 and - * 100%, it is recommended to first call triacdrv_calibrate() for - * some number of 60 Hz cycles in order to tune the detected maximum - * and minimum half-wave lengths. - * - * ## Energy Modes - * - * Because the TIMER counter must run in order to output gate enable - * pulses in response to zero-crossing events, TRIACDRV is restricted - * to running in EM0 or EM1. To enter EM2 (or lower), application - * software should first set the output duty cycle to 0% by calling - * triacdrv_set_duty_cycle(). Upon returning to EM0, there is no - * need to re-initialize the driver; the output can be re-enabled - * simply by setting the duty cycle to a non-zero value. - * - * ## Usage - * - * See test/main.c for a simple example that shows how to use the - * driver. - * - * A working project is provided in the SimplicityStudio directory - * that can be imported, built, and downloaded to the EFM32TG11 - * Starter Kit. The LETIMER is initialized to provide a 60 Hz - * stimulus output on the PC14 pin (EXP header pin 12) that should - * be connected to the PC0 pin (EXP header pin 3) with a jumper - * wire. The triac gate enable pulse is driven on PC8 (EXP header - * pin 10) and can be observed along with the 60 Hz stimulus square - * wave on an oscilloscope. - * - * ## Additional Details - * - * See the README.md file for a comprehensive explanation of how - * the driver functions, input requirements, implementation notes, - * and porting guidance. - * - * @{ - ******************************************************************************/ - -// TRIAC drive input waveform type -typedef enum -{ - triacInputRectifiedSine, // Rectified sine wave (no negative half wave) input - triacInputOffsetSine, // Offset sine wave with zero-crossing at 50% -} TRIACDRV_InputWave_Typedef; - -// TRIACDRV initialization structure -typedef struct -{ - // ACMP used for zero crossing detection - ACMP_TypeDef *acmp; - - // APORT ACMP input channel - ACMP_Channel_TypeDef acmpInput; - - // PRS channel used to link ACMP and TIMER - uint32_t acmpPrsChannel; - - // TIMER used for half-wave measurement and output generation - TIMER_TypeDef *timer; - - /* - * Base PRS channel used for gate enable output pulse. Two - * adjacent channels (N and N + 1) are ANDed together to form - * the output pulse. - */ - uint32_t timerPrsBaseChannel; - - /* - * Output port, pin, and location for timerPrsBaseChannel. This - * must be one of the PRS_CH pin options for the PRS channel - * selected, e.g. if PRS channel 4 is selected as the - * timerPrsBaseChannel on EFM32TG11, then the pin options are PC8 - * and PF1. - */ - GPIO_Port_TypeDef timerPrsOutputPort; - uint32_t timerPrsOutputPin; - uint32_t timerPrsOutputLoc; - - // Input waveform type - TRIACDRV_InputWave_Typedef inputWave; - - // Threshold voltage for zero-crossing in mV - uint32_t zeroThreshold; - - // AVDD supply voltage in mV - uint32_t avdd; - - // Gate enable pulse width in microseconds - uint32_t pulseWidth; - - // Triac initially on? - bool initOn; -} TRIACDRV_Init_TypeDef; - -// Maximum allowable gate enable pulse width in microseconds -#define TRIACDRV_MAX_ENABLE_PULSE_WIDTH 200 - -// Minimum/maximum allowable zero-crossing threshold in millivolts -#define TRIACDRV_MIN_ZERO_THRESHOLD 5 -#define TRIACDRV_MAX_ZERO_THRESHOLD 500 - -// Minimum allowable TIMER clock frequency -#define TRIACDRV_MIN_TIMER_FREQUENCY 1000000 - -/* - * Minimum and maximum allowable AVDD voltages. AVDD can be as low as - * 1.8V on most Series 1 devices but is limited to 1.85V on EFM32xG1 - * and EFR32xG1. - */ -#define TRIACDRV_MIN_AVDD 1800 -#define TRIACDRV_MAX_AVDD 3800 - -// Default triac initialization structure -#define TRIAC_INIT_DEFAULT \ - { \ - ACMP0, /* ACMP0 for zero crossing detection */ \ - acmpInputAPORT2XCH27, /* ACMP0 input pin */ \ - 0, /* PRS channel 0 to link ACMP with TIMERn */ \ - TIMER1, /* TIMER1 for frequency input and gate enable output */ \ - 1, /* PRS channel 1/2 for output pulse generation */ \ - gpioPortF, /* PRS CH1 on port F */ \ - 7, /* PRS_CH1 on pin PF7 */ \ - 6, /* PRS_CH1 on PF7 is location 6 */ \ - triacInputRectifiedSine, /* Rectified sine wave input */ \ - 200, /* 200 mV zero crossing threshold */ \ - 3300, /* AVDD = 3.3V */ \ - 20, /* gate enable pulse width */ \ - false, /* Initially off (duty cycle = 0%) */ \ - } - -// Maximum number of half-waves that can be counted during calibration -#define TRIACDRV_MAX_CAL_COUNT 60 - -// Function prototypes (user API) -sl_status_t triacdrv_calibrate(uint32_t count); -uint32_t triacdrv_get_duty_cycle(void); -sl_status_t triacdrv_set_duty_cycle(uint32_t duty); -sl_status_t triacdrv_init(const TRIACDRV_Init_TypeDef *init); - -/** @} (end addtogroup triac) */ - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif /* TRIACDRV_H */ diff --git a/driver/public/silabs/triac/src/triacdrv.c b/driver/public/silabs/triac/src/triacdrv.c deleted file mode 100644 index f15ab334..00000000 --- a/driver/public/silabs/triac/src/triacdrv.c +++ /dev/null @@ -1,951 +0,0 @@ -/***************************************************************************//** - * @file triacdrv.c - * @brief ACMP/PRS/TIMER-driven automated triac driver - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided \'as-is\', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************* - * # Evaluation Quality - * This code has been minimally tested to ensure that it builds and is suitable - * as a demonstration for evaluation purposes only. This code will be maintained - * at the sole discretion of Silicon Labs. - ******************************************************************************/ - -#include "triacdrv.h" -#include "triacdrv_config.h" - -// Function prototypes (private API) -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING -sl_status_t triacdrv_initCheckValues(uint32_t avdd, - uint32_t threshold, - uint32_t width, - uint32_t acmp_ch, - uint32_t timer_ch); - -#else -sl_status_t triacdrv_initCheckValues(uint32_t avdd, - uint32_t threshold, - uint32_t width); - -#endif -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING -sl_status_t triacdrv_initCheckPrsGPIO(uint32_t channel, - GPIO_Port_TypeDef port, - uint32_t pin, - uint32_t location); - -#endif /* TRIACDRV_DISABLE_HW_RESOURCE_CHECKING */ -sl_status_t triacdrv_initPRS(ACMP_TypeDef *acmp, - uint32_t acmpChannel, - TIMER_TypeDef *tmr, - uint32_t tmrChannel); -void triacdrv_initTIMER(TIMER_TypeDef *tmr, - uint32_t prsChannel, - uint32_t pwidth, - bool initOn); -void triacdrv_initACMP(ACMP_TypeDef *acmp, - ACMP_Channel_TypeDef acmpInput, - TRIACDRV_InputWave_Typedef waveType, - uint32_t avdd, - uint32_t threshold); - -// Global variables -static bool triacdrvIsInitialized = false; -static uint32_t triacdrvTimerFreq; -static TIMER_TypeDef *triacdrvTimer; -static uint32_t triacdrvPulseWidthTicks; -static volatile uint32_t triacdrvDutyPercent = 0; -static volatile uint32_t triacdrvPulseRiseTime; -static volatile uint32_t triacdrvPulseFallTime; - -/* - * Tracking for the maximum and minimum measured half-cycle time. - * These are set to the maximum possible value. Because the initial - * duty cycle can only be 0% or 100%, this has no impact on how the - * system behaves. When the first call to triacdrv_set_duty_cycle() is - * made, these are sanity checked and adjusted. - */ -static volatile uint32_t triacdrvHalfWaveMax = _TIMER_CNT_MASK; -static volatile uint32_t triacdrvHalfWaveMin = _TIMER_CNT_MASK; - -/***************************************************************************//** - * @brief - * Measure a user-specified number of half-cycles to determine the - * minimum and maximum lengths. - * - * @details - * - * @note - * - * @param[in] count - * An integer cycle count less than 60. - ******************************************************************************/ -sl_status_t triacdrv_calibrate(uint32_t count) -{ - uint32_t length; - - if (triacdrvIsInitialized == false) { - return SL_STATUS_NOT_INITIALIZED; - } - - if (count > TRIACDRV_MAX_CAL_COUNT) { - return SL_STATUS_INVALID_RANGE; - } - - while (count > 0) { - // Wait for a half-cycle to be measured - while ((TIMER_IntGet(triacdrvTimer) & TIMER_IF_CC0) == 0) {} - - /* - * See if most recently captured half-cycle count is shorter than - * the last one saved. This code works on the premise that the - * gate enable is fired some amount of time AFTER the last - * zero-crossing, so it tries to keep the duty cycle adjusted - * relative to the smallest measured half-cycle time. - */ - length = TIMER_CaptureGet(triacdrvTimer, 0); - - if (length < triacdrvHalfWaveMin) { - triacdrvHalfWaveMin = length; - } - - if (length > triacdrvHalfWaveMax) { - triacdrvHalfWaveMax = length; - } - - count--; - } - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Set the triac gate enable duty cycle. - * - * @details - * - * @note - * - * @param[in] duty - * An integer duty cycle (PWM output duty cycle) between 0 and 100%. - ******************************************************************************/ -sl_status_t triacdrv_set_duty_cycle(uint32_t duty) -{ - uint32_t length; - - if (triacdrvIsInitialized == false) { - return SL_STATUS_NOT_INITIALIZED; - } - - // Make sure duty cycle is not more than 100% - if (duty > 100) { - return SL_STATUS_INVALID_RANGE; - } - - /* - * Make sure the half cycle times are sane values. If not, measure - * an incoming half-cycle. - */ - if (triacdrvHalfWaveMin == _TIMER_CNT_MASK) { - while ((TIMER_IntGet(triacdrvTimer) & TIMER_IF_CC0) == 0) {} - - triacdrvHalfWaveMin = TIMER_CaptureGet(triacdrvTimer, 0); - triacdrvHalfWaveMax = triacdrvHalfWaveMin; - } - - /* - * Already have a measured half-cycle. See if most recently - * captured half-cycle count is shorter than the last one saved. - * This code works on the premise that the gate enable is fired some - * amount of time AFTER the last zero-crossing, so it tries to - * keep the duty cycle adjusted relative to the smallest measured - * half-cycle time. - */ - else { - length = TIMER_CaptureGet(triacdrvTimer, 0); - - if (length < triacdrvHalfWaveMin) { - triacdrvHalfWaveMin = length; - } - - if (length > triacdrvHalfWaveMax) { - triacdrvHalfWaveMax = length; - } - } - - // Calculate the new match times from the wavelength - if (duty > 0) { - triacdrvPulseRiseTime = (100 - duty) * (triacdrvHalfWaveMin / 100); - triacdrvPulseFallTime = triacdrvPulseRiseTime + triacdrvPulseWidthTicks; - } else { - triacdrvPulseRiseTime = triacdrvHalfWaveMax; - triacdrvPulseFallTime = triacdrvHalfWaveMax; - } - - // Set the new duty cycle and firing time - triacdrvDutyPercent = duty; - TIMER_CompareSet(triacdrvTimer, 1, triacdrvPulseRiseTime); - TIMER_CompareSet(triacdrvTimer, 2, triacdrvPulseFallTime); - - return SL_STATUS_OK; -} - -/***************************************************************************//** - * @brief - * Return the triac gate enable duty cycle. - * - * @details - * - * @note - * - * @param - * None. - ******************************************************************************/ -uint32_t triacdrv_get_duty_cycle(void) -{ - return triacdrvDutyPercent; -} - -/***************************************************************************//** - * @brief - * Initialize TRIACDRV. - * - * @details - * - * @note - * - * @param[in] init - * A pointer to the TRIACDRV initialization structure. - ******************************************************************************/ -sl_status_t triacdrv_init(const TRIACDRV_Init_TypeDef *init) -{ - sl_status_t rc = SL_STATUS_OK; - - // If already initialized, return OK - if (triacdrvIsInitialized == true) { - return rc; - } - - /* - * Check the user-specified integer values in the initialization - * structure to make sure they are valid (PRS channel numbers, - * zero-crossing threshold voltage, and gate enable pulse width). - */ -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING - rc = triacdrv_initCheckValues(init->avdd, - init->zeroThreshold, - init->pulseWidth, - init->acmpPrsChannel, - init->timerPrsBaseChannel); -#else - rc = triacdrv_initCheckValues(init->avdd, - init->zeroThreshold, - init->pulseWidth); -#endif - - if (rc != SL_STATUS_OK) { - return rc; - } - - // Verify that the PRS_CHn output port, pin, and location are valid. -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING - rc = triacdrv_initCheckPrsGPIO(init->timerPrsBaseChannel, - init->timerPrsOutputPort, - init->timerPrsOutputPin, - init->timerPrsOutputLoc); - - if (rc != SL_STATUS_OK) { - return rc; - } -#endif - - /* - * Initialize the PRS and clocks next. This function also verifies - * that the selected ACMP and TIMER are actually available on the - * chip, and, assuming they are, enables their clocks. - * - * The intent here is that if the selected ACMP and/or TIMER is/are - * not available, no hardware initialization is performed, and - * triacdrv_init() can return an error code to the main program. - * - * While a somewhat arbitrary value, the TIMER clock frequency is - * also checked to make sure it is at least 1 MHz so that the duty - * cycle calculations have sufficient resolution. In theory, a lower - * limit could be chosen, but this might require the prescaler - * calculation in triacdrv_initTIMER() to return an error, and the - * whole purpose of handling clock and PRS initialization together is - * to avoid having to undo any hardware configuration later. - */ - rc = triacdrv_initPRS(init->acmp, - init->acmpPrsChannel, - init->timer, - init->timerPrsBaseChannel); - - if (rc != SL_STATUS_OK) { - return rc; - } - - /* - * All resouces and values check out; proceed with initialization by - * setting up the PRS_CHn GPIO pin and assigning it to the specified - * channel. - */ - GPIO_PinModeSet(init->timerPrsOutputPort, - init->timerPrsOutputPin, - gpioModePushPull, - 0); - PRS_GpioOutputLocation(init->timerPrsBaseChannel, - init->timerPrsOutputLoc); - - // Initialize the selected ACMP with the specified input and threshold - triacdrv_initACMP(init->acmp, - init->acmpInput, - init->inputWave, - init->avdd, - init->zeroThreshold); - - // Initialize the specified TIMER - triacdrv_initTIMER(init->timer, - init->acmpPrsChannel, - init->pulseWidth, - init->initOn); - - // Change drive state to initialized - triacdrvIsInitialized = true; - - return rc; -} - -/***************************************************************************//** - * Private TIMER initialization function called by triacdrv_init(). - ******************************************************************************/ -void triacdrv_initTIMER(TIMER_TypeDef *tmr, - uint32_t prsChannel, - uint32_t pwidth, - bool initOn) -{ - uint32_t tmrpresc, inputCount; - bool prescFound = false; - uint64_t preclk, pwprod; - - /* - * Find the smallest possible TIMER prescaler that permits counting - * the 50/60 Hz input without overflowing. The selected TIMER - * frequency has previously been determined to be at least 1 MHz. - */ - tmrpresc = timerPrescale1; - - while (!prescFound) { - /* - * Divide the TIMER frequency by the prescaler, then divide this - * by 50 Hz (which requires more TIMER counts than does 60 Hz). - * This needs to be less than the maximum possible timer count - * (e.g. 0xFFFF for a 16-bit TIMER). - */ - inputCount = (triacdrvTimerFreq >> tmrpresc) / 50; - - if (inputCount < _TIMER_CNT_MASK) { - prescFound = true; - } else { - tmrpresc++; - } - } - - /* - * Determine if the gate enable pulse width is valid and convert it - * to a number of prescaled TIMER clock ticks per: - * - * (TIMER clock freq / TIMER prescaler) * (gate enable pulse width in us) - * ---------------------------------------------------------------------- - * 1,000,000 - * - * This is done using 64-bit math and cast to a 32-bit result in - * the end as the timer registers are 32 bits wide. - */ - // Calculate the prescaled TIMER clock - preclk = (uint64_t)triacdrvTimerFreq / (uint64_t)(1 << tmrpresc); - - // Calculate the top half of the tick equation: - pwprod = preclk * (uint64_t)pwidth; - - // Pulse width tick count - triacdrvPulseWidthTicks = (uint32_t)(pwprod / (uint64_t)1000000); - - /* - * Initialize timer but do not enable it yet. The counter will start - * COUNTING when CC0 is initialized and the first edge is detected, - * so this has to be done first. - */ - TIMER_Init_TypeDef timerinit = TIMER_INIT_DEFAULT; - timerinit.fallAction = timerInputActionReloadStart; - timerinit.riseAction = timerInputActionReloadStart; - timerinit.prescale = tmrpresc; - timerinit.enable = false; - timerinit.dmaClrAct = true; - - TIMER_Init(tmr, &timerinit); - - /* - * Note that counter reload-start is not an event like overflow - * and underflow. This means that (a) buffered register values - * (CCVB and TOPB) are not transfered to the working registers - * (CCV and TOP), and the TIMER_CC_CTRL_COIST bit does not take - * effect when the counter restarts. - * - * Because the zero-crossing event reloads and restarts the - * counter, the output pin that drives the triac gate enable must - * reset back to its inactive state. This is done by setting - * TIMER_CTRL_RSSCOIST, which must be done manually because the - * TIMER_Init_TypeDef does not include a setting for it. - */ - tmr->CTRL |= TIMER_CTRL_RSSCOIST; - - /* - * Each ACMP zero-crossing rising/falling edge detection results in - * a PRS pulse. Setup CC0 to detect the rising edge of this pulse - * only. These pulses are one HFCLK wide, so there is no need/reason - * to detect the falling edge, too. CC0 captures this edge (the - * count is the duration of the AC input high/low time) and causes a - * TIMER reload-start. - * - * However, initializing CC0 must be the last step in the TIMER setup - * process because the next zero-crossing, whenever it happens, - * starts the counter. That first zero-crossing occurs at CNT = 0 - * and must be ignored. Furthermore, the CC channel controlling the - * triac gate enable must also be setup so that the triac can be - * immediately placed in the on or off state depending on the setting - * of the initializer initOn member. - */ - TIMER_InitCC_TypeDef cc0init = TIMER_INITCC_DEFAULT; - cc0init.edge = timerEdgeRising; - cc0init.mode = timerCCModeCapture; - cc0init.prsInput = true; - cc0init.prsSel = prsChannel; - - /* - * CC1 output compare match is the rising edge of the gate enable - * pulse. The signal is initially low and goes high upon - * match. Because CC2, which determines the falling edge of the - * pulse, is initially high, the two signals are ANDed by the PRS - * logic to drive create the pulse. Except for the debug code - * below, CC1 is not actually driven to a pin. - */ - TIMER_InitCC_TypeDef cc1init = TIMER_INITCC_DEFAULT; - cc1init.mode = timerCCModeCompare; - cc1init.cmoa = timerOutputActionSet; - cc1init.prsOutput = timerPrsOutputLevel; - -#if TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT - GPIO_PinModeSet(TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT_PORT, - TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT_PIN, - gpioModePushPull, - 0); - - // Drive CC1 output to pin for observation - tmr->ROUTELOC0 |= (TRIACDRV_DEBUG_PULSE_RISE_TIMER_OUT_LOC - << _TIMER_ROUTELOC0_CC1LOC_SHIFT); - tmr->ROUTEPEN |= TIMER_ROUTEPEN_CC1PEN; -#endif - - /* - * This is the complementary part of the gate enable pulse code - * above. CC2 output compare match defines the pulse falling edge. - * The signal is initially high and goes low upon match, which is - * triacdrvPulseWidthTicks later. ANDing CC1 with CC2 (via the PRS) - * creates the gate enable pulse. - */ - TIMER_InitCC_TypeDef cc2init = TIMER_INITCC_DEFAULT; - cc2init.mode = timerCCModeCompare; - cc2init.cmoa = timerOutputActionClear; - cc2init.coist = true; - cc2init.prsOutput = timerPrsOutputLevel; - -#if TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT - GPIO_PinModeSet(TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT_PORT, - TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT_PIN, - gpioModePushPull, - 1); - - // Drive CC2 output to pin for observation - tmr->ROUTELOC0 |= (TRIACDRV_DEBUG_PULSE_FALL_TIMER_OUT_LOC - << _TIMER_ROUTELOC0_CC2LOC_SHIFT); - tmr->ROUTEPEN |= TIMER_ROUTEPEN_CC2PEN; -#endif - - /* - * Setup the CCV registers for the initial on or off state. If - * the triac is to initially be on, then the compare match needs - * to occur at CCV = 0, which is the default out of reset. - * - * If the triac should be off, then set the compare match at the - * maximum timer count. Because a zero-crossing at 50 or 60 Hz - * will restart the counter before the maximum count value is - * reached, a match will never occur, and the gate enable will - * remain low. - * - * Set the global duty cycle and firing time variables to align - * with the on/off determination. - */ - if (!initOn) { - triacdrvPulseRiseTime = _TIMER_CNT_MASK; - triacdrvPulseFallTime = _TIMER_CNT_MASK; - TIMER_CompareSet(tmr, 1, triacdrvPulseRiseTime); - TIMER_CompareSet(tmr, 2, triacdrvPulseFallTime); - triacdrvDutyPercent = 0; - } else { - triacdrvDutyPercent = 100; - triacdrvPulseRiseTime = 0; - triacdrvPulseFallTime = triacdrvPulseRiseTime + triacdrvPulseWidthTicks; - } - - // Enable CC1 and CC2 for gate enable rising and falling edges - TIMER_InitCC(tmr, 1, &cc1init); - TIMER_InitCC(tmr, 2, &cc2init); - - /* - * Initialize CC0 and wait for first capture, which occurs at - * CNT = 0. All subsequent CC0 captures will be the CNT value - * where the zero-crossing rising or falling edge occurs. - */ - TIMER_InitCC(tmr, 0, &cc0init); - - while ((TIMER_IntGet(tmr) & TIMER_IF_CC0) == 0) {} - - /* - * First edge detected CNT = 0; read CCV to throw it away, - * then clear the CC0 flag. - */ - (void)tmr->CC[0].CCV; - TIMER_IntClear(tmr, TIMER_IF_CC0); -} - -/***************************************************************************//** - * Private PRS initialization function called by triacdrv_init(). - ******************************************************************************/ -sl_status_t triacdrv_initPRS(ACMP_TypeDef *acmp, - uint32_t acmpChannel, - TIMER_TypeDef *tmr, - uint32_t tmrChannel) -{ - sl_status_t rc = SL_STATUS_OK; - uint32_t acmpProducer, tmrProducer, tmrSignalCC1, tmrSignalCC2, tmpFreq; - CMU_Clock_TypeDef acmpClock, timerClock; - - // Figure out which ACMP to use, but don't do anything right now. - if (false) { - } -#if defined(ACMP0) - else if (acmp == ACMP0) { - acmpProducer = PRS_CH_CTRL_SOURCESEL_ACMP0; - acmpClock = cmuClock_ACMP0; - } -#endif -#if defined(ACMP1) - else if (acmp == ACMP1) { - acmpProducer = PRS_CH_CTRL_SOURCESEL_ACMP1; - acmpClock = cmuClock_ACMP1; - } -#endif -#if defined(ACMP2) - else if (acmp == ACMP2) { - acmpProducer = PRS_CH_CTRL_SOURCESEL_ACMP2; - acmpClock = cmuClock_ACMP2; - } -#endif -#if defined(ACMP3) - else if (acmp == ACMP3) { - acmpProducer = PRS_CH_CTRL_SOURCESEL_ACMP3; - acmpClock = cmuClock_ACMP1; - } -#endif -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING - else { - return SL_STATUS_INVALID_CONFIGURATION; - } -#endif /* TRIACDRV_DISABLE_HW_RESOURCE_CHECKING */ - - // Figure out which TIMER to use, but don't do anything right now. - if (false) { - } -#if defined(TIMER0) - else if (tmr == TIMER0) { - tmrProducer = PRS_CH_CTRL_SOURCESEL_TIMER0; - tmrSignalCC1 = PRS_TIMER0_CC1; - tmrSignalCC2 = PRS_TIMER0_CC2; - timerClock = cmuClock_TIMER0; - } -#endif -#if defined(TIMER1) - else if (tmr == TIMER1) { - tmrProducer = PRS_CH_CTRL_SOURCESEL_TIMER1; - tmrSignalCC1 = PRS_TIMER1_CC1; - tmrSignalCC2 = PRS_TIMER1_CC2; - timerClock = cmuClock_TIMER1; - } -#endif -#if defined(TIMER2) - else if (tmr == TIMER2) { - tmrProducer = PRS_CH_CTRL_SOURCESEL_TIMER2; - tmrSignalCC1 = PRS_TIMER2_CC1; - tmrSignalCC2 = PRS_TIMER2_CC2; - timerClock = cmuClock_TIMER2; - } -#endif -#if defined(TIMER3) - else if (tmr == TIMER3) { - tmrProducer = PRS_CH_CTRL_SOURCESEL_TIMER3; - tmrSignalCC1 = PRS_TIMER3_CC1; - tmrSignalCC2 = PRS_TIMER3_CC2; - timerClock = cmuClock_TIMER3; - } -#endif -#if defined(TIMER4) - else if (tmr == TIMER4) { - tmrProducer = PRS_CH_CTRL_SOURCESEL_TIMER4; - tmrSignalCC1 = PRS_TIMER4_CC1; - tmrSignalCC2 = PRS_TIMER4_CC2; - timerClock = cmuClock_TIMER4; - } -#endif -#if defined(TIMER5) - else if (tmr == TIMER5) { - tmrProducer = PRS_CH_CTRL_SOURCESEL_TIMER5; - tmrSignalCC1 = PRS_TIMER5_CC1; - tmrSignalCC2 = PRS_TIMER5_CC2; - timerClock = cmuClock_TIMER5; - } -#endif -#if defined(TIMER6) - else if (tmr == TIMER6) { - tmrProducer = PRS_CH_CTRL_SOURCESEL_TIMER6; - tmrSignalCC1 = PRS_TIMER6_CC1; - tmrSignalCC2 = PRS_TIMER6_CC2; - timerClock = cmuClock_TIMER6; - } -#endif -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING - else { - return SL_STATUS_INVALID_CONFIGURATION; - } -#endif /* TRIACDRV_DISABLE_HW_RESOURCE_CHECKING */ - - /* - * Make sure the selected TIMER clock is at least 1 MHz. Assuming - * it is, save this frequency and the timer for use elsewhere. - */ - tmpFreq = CMU_ClockFreqGet(timerClock); - if (tmpFreq >= TRIACDRV_MIN_TIMER_FREQUENCY) { - triacdrvTimerFreq = tmpFreq; - triacdrvTimer = tmr; - } else { - return SL_STATUS_INVALID_RANGE; - } - - /* - * ACMP and TIMER selections are valid. Rnable their respective - * clocks, as well as the GPIO and PRS clocks. - */ - CMU_ClockEnable(cmuClock_PRS, true); - CMU_ClockEnable(cmuClock_GPIO, true); - CMU_ClockEnable(acmpClock, true); - CMU_ClockEnable(timerClock, true); - - // Make ACMP output available on PRS channel for TIMER - PRS_SourceSignalSet(acmpChannel, - acmpProducer, - PRS_CH_CTRL_SIGSEL_ACMP0OUT, - prsEdgeBoth); - -#if TRIACDRV_DEBUG_PRSACMP - GPIO_PinModeSet(TRIACDRV_DEBUG_PRSACMP_PORT, - TRIACDRV_DEBUG_PRSACMP_PIN, - gpioModePushPull, - 0); - - // Route ACMP PRS output to debug pin - PRS_GpioOutputLocation(acmpChannel, TRIACDRV_DEBUG_PRSACMP_LOC); -#endif - - // Assign TIMER CC1 to the selected PRS channel - PRS_SourceSignalSet(tmrChannel, tmrProducer, tmrSignalCC1, prsEdgeOff); - -#if TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT - GPIO_PinModeSet(TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT_PORT, - TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT_PIN, - gpioModePushPull, - 0); - - // Route CC1 PRS output to debug pin - PRS_GpioOutputLocation(tmrChannel, TRIACDRV_DEBUG_PULSE_RISE_PRS_OUT_LOC); -#endif - - // Assign TIMER CC2 to the paired PRS channel - PRS_SourceSignalSet(tmrChannel + 1, tmrProducer, tmrSignalCC2, prsEdgeOff); - -#if TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT - GPIO_PinModeSet(TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT_PORT, - TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT_PIN, - gpioModePushPull, - 1); - - // Route CC2 PRS output to debug pin - PRS_GpioOutputLocation(tmrChannel + 1, - TRIACDRV_DEBUG_PULSE_FALL_PRS_OUT_LOC); -#endif - - // AND the PRS channel for CC1 with the channel for CC2 - PRS->CH[tmrChannel].CTRL |= PRS_CH_CTRL_ANDNEXT; - - return rc; -} - -/***************************************************************************//** - * Private ACMP initialization function called by triacdrv_init(). - ******************************************************************************/ -void triacdrv_initACMP(ACMP_TypeDef *acmp, - ACMP_Channel_TypeDef acmpInput, - TRIACDRV_InputWave_Typedef waveType, - uint32_t avdd, - uint32_t threshold) -{ - uint32_t divvb; - - /* - * Initialize the selected ACMP but do not enable. Operate in high - * accuracy mode with increased bias currents to properly detect - * zero-crossings when the input is an offset sine wave. - */ - ACMP_Init_TypeDef acmpinit = ACMP_INIT_DEFAULT; - acmpinit.accuracy = acmpAccuracyHigh; - acmpinit.fullBias = true; - acmpinit.biasProg = 0x10; - acmpinit.enable = false; - - ACMP_Init(acmp, &acmpinit); - - // Use the 2.5V source for the VB divider - ACMP_VBConfig_TypeDef vb_config = ACMP_VBCONFIG_DEFAULT; - vb_config.input = acmpVBInput2V5; - - // Is the input waveform a rectified sine wave? - if (waveType == triacInputRectifiedSine) { - /* - * Calculate the divider needed to derive the requested zero-crossing - * threshold voltage. - * - * The VBDIV divided voltage is calculated using: - * - * VBDIV = VB � ((DIVVB + 1) / 64) - * - * The divider, then, for VBDIV in mV is... - * - * DIVVB = ((VBDIV � 64) / (VB � 1000) - 1 - * - * ...where VB = 2.55V (ACMP VB 2V5 input) - */ - divvb = ((threshold << 6) / 2500) - 1; - - vb_config.div0 = divvb; - vb_config.div1 = divvb; - } - - /* - * Calculate the threshold voltages for when the input is falling - * (will be less than the AVDD midpoint so the comparator output goes - * to 0) or rising (will be greater than the AVDD midpoint so the - * comparator output goes to 1). The user-specified zeroThreshold - * is here treated as a hysteresis value. - */ - else { - // Input is less than the AVDD midpoint voltage plus the threshold - vb_config.div0 = ((((avdd / 2) + threshold) << 6) / 2500) - 1; - - // Input is more than the AVDD midpoint voltage minus the threshold - vb_config.div1 = ((((avdd / 2) - threshold) << 6) / 2500) - 1; - } - ACMP_VBSetup(acmp, &vb_config); - -#if TRIACDRV_DEBUG_ACMPOUT - GPIO_PinModeSet(TRIACDRV_DEBUG_ACMPOUT_PORT, - TRIACDRV_DEBUG_ACMPOUT_PIN, - gpioModePushPull, - 0); - - // Drive ACMP output state to a pin for debug - ACMP_GPIOSetup(acmp, TRIACDRV_DEBUG_ACMPOUT_LOC, true, false); -#endif - - // Compare the threshold voltage (NEG) against the input (POS) - ACMP_ChannelSet(acmp, acmpInputVBDIV, acmpInput); - - // Everything is setup, so now enable - ACMP_Enable(acmp); - - // Wait for warm-up - while (!(acmp->STATUS & _ACMP_STATUS_ACMPACT_MASK)) {} -} - -/***************************************************************************//** - * Private GPIO checking functions called by triacdrv_init(). - * - * Note that this function only determines if the PRS_CHn GPIO location - * is out of range for the CHnLOC bit field. Not all CHnLOC bit field - * values are encoded, e.g. a given PRS_CHn might only encode locations - * 0 and 2, and the mask value for that bit field would be 3. The user - * could specify a location of 1 or 3, and this function cannot determine - * that they are invalid. - ******************************************************************************/ -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING -sl_status_t triacdrv_initCheckValues(uint32_t avdd, - uint32_t threshold, - uint32_t width, - uint32_t acmp_ch, - uint32_t timer_ch) -#else -sl_status_t triacdrv_initCheckValues(uint32_t avdd, - uint32_t threshold, - uint32_t width) -#endif /* TRIACDRV_DISABLE_HW_RESOURCE_CHECKING */ -{ - sl_status_t rc = SL_STATUS_OK; - - /* - * Before doing any hardware initialization, make sure that the - * specified AVDD supply voltage, zero-crossing threshold voltage - * and the gate enable pulse width are within the allowable ranges - * for the driver. - */ - if ((avdd > TRIACDRV_MAX_AVDD) || (avdd < TRIACDRV_MIN_AVDD)) { - return SL_STATUS_INVALID_RANGE; - } - - if ((threshold < TRIACDRV_MIN_ZERO_THRESHOLD) - || (threshold > TRIACDRV_MAX_ZERO_THRESHOLD)) { - return SL_STATUS_INVALID_RANGE; - } - - if ((width == 0) || (width > TRIACDRV_MAX_ENABLE_PULSE_WIDTH)) { - return SL_STATUS_INVALID_RANGE; - } - -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING - - /* - * Make sure the same PRS channels are not selected for the ACMP and - * TIMER (actually two channels, N and N + 1). - */ - if ((acmp_ch == timer_ch) || (acmp_ch == (timer_ch + 1))) { - return SL_STATUS_INVALID_PARAMETER; - } - - // Check if selected PRS channel for the ACMP is valid - if (acmp_ch >= PRS_CHAN_COUNT) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - /* - * Check if selected TIMER base PRS channel is valid. It must be - * one less then PRS_CHAN_COUNT because channels N and N + 1 are - * used. - */ - if (timer_ch >= (PRS_CHAN_COUNT - 1)) { - return SL_STATUS_INVALID_CONFIGURATION; - } -#endif /* TRIACDRV_DISABLE_HW_RESOURCE_CHECKING */ - - return rc; -} - -#ifndef TRIACDRV_DISABLE_HW_RESOURCE_CHECKING -sl_status_t triacdrv_initCheckPrsGPIO(uint32_t channel, - GPIO_Port_TypeDef port, - uint32_t pin, - uint32_t location) -{ - sl_status_t rc = SL_STATUS_OK; - uint32_t shift, mask, group; - - // If selected GPIO port and pin are not valid... - if (!(GPIO_PORT_PIN_VALID(port, pin))) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - // Find the PRS_ROUTELOCn shift offset for the selected PRS channel - shift = (channel % 4) * 8; - - /* - * All ROUTELOCn registers are in consecutive memory locations, so - * they can be treated as an array starting at ROUTELOC0. Find the - * index into this array to determine which _PRS_ROUTELOCn_MASK - * value to use. - */ - group = channel / 4; - - switch (group) - { - case 0: - mask = _PRS_ROUTELOC0_MASK; - break; - case 1: - mask = _PRS_ROUTELOC1_MASK; - break; -#ifdef _PRS_ROUTELOC2_MASK - case 2: - mask = _PRS_ROUTELOC2_MASK; - break; -#endif -#ifdef _PRS_ROUTELOC3_MASK - case 3: - mask = _PRS_ROUTELOC3_MASK; - break; -#endif -#ifdef _PRS_ROUTELOC4_MASK - case 4: - mask = _PRS_ROUTELOC4_MASK; - break; -#endif -#ifdef _PRS_ROUTELOC5_MASK - case 5: - mask = _PRS_ROUTELOC5_MASK; - break; -#endif - // Should never get here as the PRS channel has already been validated - default: - return SL_STATUS_INVALID_CONFIGURATION; - break; - } - - // Shift the CHnLOC mask value to the lower 8 bits - mask = ((mask >> shift) & 0x000000ff); - - // Check if the specified PRS_CHn location is valid - if (location > mask) { - return SL_STATUS_INVALID_CONFIGURATION; - } - - return rc; -} - -#endif /* TRIACDRV_DISABLE_HW_RESOURCE_CHECKING */ diff --git a/driver/public/silabs/uwb2_dwm3000/config/brd2703a/uwb2_dwm3000_config.h b/driver/public/silabs/uwb2_dwm3000/config/brd2703a/uwb2_dwm3000_config.h index 437d743d..a0d438b2 100644 --- a/driver/public/silabs/uwb2_dwm3000/config/brd2703a/uwb2_dwm3000_config.h +++ b/driver/public/silabs/uwb2_dwm3000/config/brd2703a/uwb2_dwm3000_config.h @@ -47,17 +47,6 @@ extern "C" // <<< Use Configuration Wizard in Context Menu // SPI Driver settings -// HAL SPI TYPE -// USART -// EUSART -#define DWM3000_SPI_TYPE EUSART - -// HAL SPI NUMBER -// <0=> 0 -// <1=> 1 -// <2=> 2 -#define DWM3000_SPI_NUMBER 1 - // SPI FREQUENCY MIN (Hz) // 2000000 #define DWM3000_FREQ_MIN 2000000 @@ -91,8 +80,8 @@ extern "C" // DWM3000_ON // $[GPIO_DWM3000_ON] -#define DWM3000_ON_PORT gpioPortA -#define DWM3000_ON_PIN 0 +// #define DWM3000_ON_PORT gpioPortA +// #define DWM3000_ON_PIN 0 // [GPIO_DWM3000_ON]$ // DWM3000_CS @@ -101,24 +90,6 @@ extern "C" #define DWM3000_CS_PIN 0 // [GPIO_DWM3000_CS]$ -// DWM3000_CLK -// $[GPIO_DWM3000_CLK] -#define DWM3000_CLK_PORT gpioPortC -#define DWM3000_CLK_PIN 1 -// [GPIO_DWM3000_CLK]$ - -// DWM3000_MISO -// $[GPIO_DWM3000_MISO] -#define DWM3000_MISO_PORT gpioPortC -#define DWM3000_MISO_PIN 2 -// [GPIO_DWM3000_MISO]$ - -// DWM3000_MOSI -// $[GPIO_DWM3000_MOSI] -#define DWM3000_MOSI_PORT gpioPortC -#define DWM3000_MOSI_PIN 3 -// [GPIO_DWM3000_MOSI]$ - // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/silabs/uwb2_dwm3000/config/brd4108a/uwb2_dwm3000_config.h b/driver/public/silabs/uwb2_dwm3000/config/brd4108a/uwb2_dwm3000_config.h index 2ccd61a5..1de29da7 100644 --- a/driver/public/silabs/uwb2_dwm3000/config/brd4108a/uwb2_dwm3000_config.h +++ b/driver/public/silabs/uwb2_dwm3000/config/brd4108a/uwb2_dwm3000_config.h @@ -47,17 +47,6 @@ extern "C" // <<< Use Configuration Wizard in Context Menu // SPI Driver settings -// HAL SPI TYPE -// USART -// EUSART -#define DWM3000_SPI_TYPE USART - -// HAL SPI NUMBER -// <0=> 0 -// <1=> 1 -// <2=> 2 -#define DWM3000_SPI_NUMBER 0 - // SPI FREQUENCY MIN (Hz) // 2000000 #define DWM3000_FREQ_MIN 2000000 @@ -103,12 +92,12 @@ extern "C" // DWM3000_ON // $[GPIO_DWM3000_ON] -#ifndef DWM3000_ON_PORT -#define DWM3000_ON_PORT gpioPortB -#endif -#ifndef DWM3000_ON_PIN -#define DWM3000_ON_PIN 4 -#endif +// #ifndef DWM3000_ON_PORT +// #define DWM3000_ON_PORT gpioPortB +// #endif +// #ifndef DWM3000_ON_PIN +// #define DWM3000_ON_PIN 4 +// #endif // [GPIO_DWM3000_ON]$ // DWM3000_CS @@ -121,36 +110,6 @@ extern "C" #endif // [GPIO_DWM3000_CS]$ -// DWM3000_CLK -// $[GPIO_DWM3000_CLK] -#ifndef DWM3000_CLK_PORT -#define DWM3000_CLK_PORT gpioPortC -#endif -#ifndef DWM3000_CLK_PIN -#define DWM3000_CLK_PIN 2 -#endif -// [GPIO_DWM3000_CLK]$ - -// DWM3000_MISO -// $[GPIO_DWM3000_MISO] -#ifndef DWM3000_MISO_PORT -#define DWM3000_MISO_PORT gpioPortC -#endif -#ifndef DWM3000_MISO_PIN -#define DWM3000_MISO_PIN 1 -#endif -// [GPIO_DWM3000_MISO]$ - -// DWM3000_MOSI -// $[GPIO_DWM3000_MOSI] -#ifndef DWM3000_MOSI_PORT -#define DWM3000_MOSI_PORT gpioPortC -#endif -#ifndef DWM3000_MOSI_PIN -#define DWM3000_MOSI_PIN 0 -#endif -// [GPIO_DWM3000_MOSI]$ - // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/silabs/uwb2_dwm3000/config/brd4314a/uwb2_dwm3000_config.h b/driver/public/silabs/uwb2_dwm3000/config/brd4314a/uwb2_dwm3000_config.h index 2ccd61a5..1de29da7 100644 --- a/driver/public/silabs/uwb2_dwm3000/config/brd4314a/uwb2_dwm3000_config.h +++ b/driver/public/silabs/uwb2_dwm3000/config/brd4314a/uwb2_dwm3000_config.h @@ -47,17 +47,6 @@ extern "C" // <<< Use Configuration Wizard in Context Menu // SPI Driver settings -// HAL SPI TYPE -// USART -// EUSART -#define DWM3000_SPI_TYPE USART - -// HAL SPI NUMBER -// <0=> 0 -// <1=> 1 -// <2=> 2 -#define DWM3000_SPI_NUMBER 0 - // SPI FREQUENCY MIN (Hz) // 2000000 #define DWM3000_FREQ_MIN 2000000 @@ -103,12 +92,12 @@ extern "C" // DWM3000_ON // $[GPIO_DWM3000_ON] -#ifndef DWM3000_ON_PORT -#define DWM3000_ON_PORT gpioPortB -#endif -#ifndef DWM3000_ON_PIN -#define DWM3000_ON_PIN 4 -#endif +// #ifndef DWM3000_ON_PORT +// #define DWM3000_ON_PORT gpioPortB +// #endif +// #ifndef DWM3000_ON_PIN +// #define DWM3000_ON_PIN 4 +// #endif // [GPIO_DWM3000_ON]$ // DWM3000_CS @@ -121,36 +110,6 @@ extern "C" #endif // [GPIO_DWM3000_CS]$ -// DWM3000_CLK -// $[GPIO_DWM3000_CLK] -#ifndef DWM3000_CLK_PORT -#define DWM3000_CLK_PORT gpioPortC -#endif -#ifndef DWM3000_CLK_PIN -#define DWM3000_CLK_PIN 2 -#endif -// [GPIO_DWM3000_CLK]$ - -// DWM3000_MISO -// $[GPIO_DWM3000_MISO] -#ifndef DWM3000_MISO_PORT -#define DWM3000_MISO_PORT gpioPortC -#endif -#ifndef DWM3000_MISO_PIN -#define DWM3000_MISO_PIN 1 -#endif -// [GPIO_DWM3000_MISO]$ - -// DWM3000_MOSI -// $[GPIO_DWM3000_MOSI] -#ifndef DWM3000_MOSI_PORT -#define DWM3000_MOSI_PORT gpioPortC -#endif -#ifndef DWM3000_MOSI_PIN -#define DWM3000_MOSI_PIN 0 -#endif -// [GPIO_DWM3000_MOSI]$ - // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/silabs/uwb2_dwm3000/config/brd4338a/uwb2_dwm3000_config.h b/driver/public/silabs/uwb2_dwm3000/config/brd4338a/uwb2_dwm3000_config.h new file mode 100644 index 00000000..cc2d2fb0 --- /dev/null +++ b/driver/public/silabs/uwb2_dwm3000/config/brd4338a/uwb2_dwm3000_config.h @@ -0,0 +1,119 @@ +/***************************************************************************//** + * @file mikroe_uwb2_dwm3000_config.h + * @brief DWM3000 UWB config. + * @version 0.0.1 + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided \'as-is\', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************* + * + * EVALUATION QUALITY + * This code has been minimally tested to ensure that it builds with the + * specified dependency versions and is suitable as a demonstration for + * evaluation purposes only. + * This code will be maintained at the sole discretion of Silicon Labs. + * + ******************************************************************************/ +#ifndef DWM3000_CONFIG_H_ +#define DWM3000_CONFIG_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// <<< Use Configuration Wizard in Context Menu +// SPI Driver settings + +// SPI FREQUENCY MIN (Hz) +// 2000000 +#define DWM3000_FREQ_MIN 2000000 + +// SPI FREQUENCY MAX (Hz) +// 19500000 +#define DWM3000_FREQ_MAX 19500000 + +// +// <<< end of configuration section >>> + +// <<< sl:start pin_tool >>> + +// DWM3000_RESET +// $[GPIO_DWM3000_RESET] +#ifndef DWM3000_RESET_PORT +#define DWM3000_RESET_PORT HP +#endif +#ifndef DWM3000_RESET_PIN +#define DWM3000_RESET_PIN 47 +#endif +// [GPIO_DWM3000_RESET]$ + +// DWM3000_INT +// $[GPIO_DWM3000_INT] +#ifndef DWM3000_INT_PORT +#define DWM3000_INT_PORT HP +#endif +#ifndef DWM3000_INT_PIN +#define DWM3000_INT_PIN 46 +#endif +// [GPIO_DWM3000_INT]$ + +// DWM3000_WAKE +// $[GPIO_DWM3000_WAKE] +// #ifndef DWM3000_WAKE_PORT +// #define DWM3000_WAKE_PORT 0 +// #endif +// #ifndef DWM3000_WAKE_PIN +// #define DWM3000_WAKE_PIN 0 +// #endif +// [GPIO_DWM3000_WAKE]$ + +// DWM3000_ON +// $[GPIO_DWM3000_ON] +// #ifndef DWM3000_ON_PORT +// #define DWM3000_ON_PORT 0 +// #endif +// #ifndef DWM3000_ON_PIN +// #define DWM3000_ON_PIN 0 +// #endif +// [GPIO_DWM3000_ON]$ + +// DWM3000_CS +// $[GPIO_DWM3000_CS] +// #ifndef DWM3000_CS_PORT +// #define DWM3000_CS_PORT 0 +// #endif +// #ifndef DWM3000_CS_PIN +// #define DWM3000_CS_PIN 0 +// #endif +// [GPIO_DWM3000_CS]$ + + +// <<< sl:end pin_tool >>> + +#ifdef __cplusplus +} +#endif +#endif /* DWM3000_CONFIG_H_ */ diff --git a/driver/public/silabs/uwb2_dwm3000/config/other/uwb2_dwm3000_config.h b/driver/public/silabs/uwb2_dwm3000/config/other/uwb2_dwm3000_config.h index 734a3eed..cf4ca87c 100644 --- a/driver/public/silabs/uwb2_dwm3000/config/other/uwb2_dwm3000_config.h +++ b/driver/public/silabs/uwb2_dwm3000/config/other/uwb2_dwm3000_config.h @@ -47,17 +47,6 @@ extern "C" // <<< Use Configuration Wizard in Context Menu // SPI Driver settings -// HAL SPI TYPE -// USART -// EUSART -#define DWM3000_SPI_TYPE EUSART - -// HAL SPI NUMBER -// <0=> 0 -// <1=> 1 -// <2=> 2 -#define DWM3000_SPI_NUMBER 1 - // SPI FREQUENCY MIN (Hz) // 2000000 #define DWM3000_FREQ_MIN 2000000 @@ -126,39 +115,6 @@ extern "C" // #endif // [GPIO_DWM3000_CS]$ -// DWM3000_CLK -// $[GPIO_DWM3000_CLK] -#warning "DWM3000_CLK is not configured" -// #ifndef DWM3000_CLK_PORT -// #define DWM3000_CLK_PORT gpioPortC -// #endif -// #ifndef DWM3000_CLK_PIN -// #define DWM3000_CLK_PIN 1 -// #endif -// [GPIO_DWM3000_CLK]$ - -// DWM3000_MISO -// $[GPIO_DWM3000_MISO] -#warning "DWM3000_MISO is not configured" -// #ifndef DWM3000_MISO_PORT -// #define DWM3000_MISO_PORT gpioPortC -// #endif -// #ifndef DWM3000_MISO_PIN -// #define DWM3000_MISO_PIN 2 -// #endif -// [GPIO_DWM3000_MISO]$ - -// DWM3000_MOSI -// $[GPIO_DWM3000_MOSI] -#warning "DWM3000_MOSI is not configured" -// #ifndef DWM3000_MOSI_PORT -// #define DWM3000_MOSI_PORT gpioPortC -// #endif -// #ifndef DWM3000_MOSI_PIN -// #define DWM3000_MOSI_PIN 3 -// #endif -// [GPIO_DWM3000_MOSI]$ - // <<< sl:end pin_tool >>> #ifdef __cplusplus diff --git a/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.c b/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.c index 69b88157..1470f656 100644 --- a/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.c +++ b/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.c @@ -12,8 +12,7 @@ */ #include "deca_probe_interface.h" #include "deca_interface.h" -#include "deca_spi.h" -#include "port.h" +#include "port_dw3000.h" static const struct dwt_spi_s dw3000_spi_fct = { .readfromspi = readfromspi, diff --git a/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.h b/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.h index 95cceca0..74c5b428 100644 --- a/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.h +++ b/driver/public/silabs/uwb2_dwm3000/platform/deca_probe/deca_probe_interface.h @@ -12,8 +12,17 @@ */ #ifndef DECA_PROBE_INTERFACE_H #define DECA_PROBE_INTERFACE_H + +#ifdef __cplusplus +extern "C" { +#endif + #include "deca_device_api.h" extern const struct dwt_probe_s dw3000_probe_interf; +#ifdef __cplusplus +} +#endif + #endif diff --git a/driver/public/silabs/uwb2_dwm3000/platform/deca_sleep/deca_sleep.c b/driver/public/silabs/uwb2_dwm3000/platform/deca_sleep/deca_sleep.c deleted file mode 100644 index a1a72262..00000000 --- a/driver/public/silabs/uwb2_dwm3000/platform/deca_sleep/deca_sleep.c +++ /dev/null @@ -1,28 +0,0 @@ -/**- - * @file deca_sleep.c - * - * @brief platform dependent sleep implementation - * - * @attention - * - * Copyright 2015 (c) Decawave Ltd, Dublin, Ireland. - * - * All rights reserved. - * - * @author Decawave - */ - -#include "port.h" -#include "sl_udelay.h" - -/* Wrapper function to be used by decadriver. Declared in deca_device_api.h */ -void deca_sleep(unsigned int time_ms) -{ - sl_udelay_wait(time_ms * 1000); -} - -/* Wrapper function to be used by decadriver. Declared in deca_device_api.h */ -void deca_usleep(unsigned long time_us) -{ - sl_udelay_wait(time_us); -} diff --git a/driver/public/silabs/uwb2_dwm3000/platform/deca_spi/deca_spi.c b/driver/public/silabs/uwb2_dwm3000/platform/deca_spi/deca_spi.c deleted file mode 100644 index eaf1176d..00000000 --- a/driver/public/silabs/uwb2_dwm3000/platform/deca_spi/deca_spi.c +++ /dev/null @@ -1,227 +0,0 @@ -/** - * @file deca_spi.c - * - * @brief SPI functions to interface to DW3000 chip's from EFR32. - * - * @author Decawave - * - * @attention Copyright 2017-2019 (c) Decawave Ltd, Dublin, Ireland. - * All rights reserved. - * - */ - -#include "port.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_eusart.h" -#include "em_usart.h" -#include "spidrv.h" -#if defined (SL_CATALOG_POWER_MANAGER_PRESENT) -#include "sl_power_manager.h" -#endif -#include "deca_spi.h" -#include - -#ifndef SPI_USE_SPIDRV_API -#define SPI_USE_SPIDRV_API 0 -#endif -#define SPI_GPIO_SLOW_SLEWRATE 5 -#define SPI_GPIO_FAST_SLEWRATE 7 -#define SPI_DUMMY_TX_VALUE 0xFF - -#define EUSART_SpiTransfer EUSART_Spi_TxRx -#define spi_tx_rx(data) HAL_CAT2(HAL_SPI_TYPE, _SpiTransfer)(HAL_SPI_PERIPHERAL, \ - data) - -static SPIDRV_HandleData_t spi_driver_handle; -static volatile bool spi_lock; - -/*! - * - * ----------------------------------------------------------------------------- - * Function: openspi() - * - * Low level abstract function to open and initialise access to the SPI device. - * returns 0 for success, or -1 for error - */ -int openspi(void) -{ - SPIDRV_Init_t spi_init = { - .port = HAL_SPI_PERIPHERAL, - .portTx = HAL_SPI_MOSI_PORT, - .portRx = HAL_SPI_MISO_PORT, - .portClk = HAL_SPI_CLK_PORT, - .portCs = HAL_SPI_CS_PORT, - .pinTx = HAL_SPI_MOSI_PIN, - .pinRx = HAL_SPI_MISO_PIN, - .pinClk = HAL_SPI_CLK_PIN, - .pinCs = HAL_SPI_CS_PIN, - .bitRate = HAL_SPI_FREQ_MIN, - .frameLength = 8, - .dummyTxValue = SPI_DUMMY_TX_VALUE, - .type = spidrvMaster, - .bitOrder = spidrvBitOrderMsbFirst, - .clockMode = spidrvClockMode0, - .csControl = spidrvCsControlApplication, - }; - - CMU_ClockEnable(cmuClock_GPIO, true); - GPIO_SlewrateSet(spi_init.portClk, - SPI_GPIO_SLOW_SLEWRATE, - SPI_GPIO_SLOW_SLEWRATE); - GPIO_SlewrateSet(spi_init.portTx, - SPI_GPIO_SLOW_SLEWRATE, - SPI_GPIO_SLOW_SLEWRATE); - GPIO_PinModeSet(spi_init.portCs, spi_init.pinCs, gpioModePushPull, 1); - return SPIDRV_Init(&spi_driver_handle, &spi_init); -} - -/*! - * - * ----------------------------------------------------------------------------- - * Function: closespi() - * - * Low level abstract function to close the the SPI device. - * returns 0 for success, or -1 for error - */ -int closespi(void) -{ - return SPIDRV_DeInit(&spi_driver_handle); -} - -static void port_spi_set_bitrate(uint32_t goal_bitrate) -{ - uint32_t required_slewrate = - (goal_bitrate - >= 10000000) ? SPI_GPIO_FAST_SLEWRATE : SPI_GPIO_SLOW_SLEWRATE; - GPIO_SlewrateSet(spi_driver_handle.initData.portClk, - required_slewrate, - required_slewrate); - GPIO_SlewrateSet(spi_driver_handle.initData.portTx, - required_slewrate, - required_slewrate); - SPIDRV_SetBitrate(&spi_driver_handle, goal_bitrate); -} - -/* @fn set_dw_spi_slow_rate - * @brief sets slow SPI clock speed for the DW chip - * left for compatibility. - * */ -void set_dw_spi_slow_rate(void) -{ - port_spi_set_bitrate(HAL_SPI_FREQ_MIN); -} - -/* @fn set_dw_spi_fast_rate - * @brief sets High SPI clock speed for the DW chip - * */ -void set_dw_spi_fast_rate(void) -{ - port_spi_set_bitrate(HAL_SPI_FREQ_MAX); -} - -static inline void spi_transfer_open(void) -{ - // TODO: not thread safe at all... (but same as other Vendors' implementation) - while (spi_lock) {} - spi_lock = true; - -#if (!SPI_USE_SPIDRV_API) && defined (SL_CATALOG_POWER_MANAGER_PRESENT) - sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); -#endif - GPIO_PinOutClear(spi_driver_handle.initData.portCs, - spi_driver_handle.initData.pinCs); -} - -static inline void spi_transfer_close(void) -{ - GPIO_PinOutSet(spi_driver_handle.initData.portCs, - spi_driver_handle.initData.pinCs); -#if (!SPI_USE_SPIDRV_API) && defined (SL_CATALOG_POWER_MANAGER_PRESENT) - sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); -#endif - spi_lock = false; -} - -static inline Ecode_t spi_blocking_transmit(const uint8_t *buffer, int count) -{ -#if SPI_USE_SPIDRV_API - return SPIDRV_MTransmitB(&spi_driver_handle, buffer, count); -#else - for (int i = 0; i < count; i++) { - spi_tx_rx(buffer[i]); - } - return ECODE_OK; -#endif -} - -static inline Ecode_t spi_blocking_receive(uint8_t *buffer, int count) -{ -#if SPI_USE_SPIDRV_API - return SPIDRV_MReceiveB(&spi_driver_handle, buffer, count); -#else - for (int i = 0; i < count; i++) { - buffer[i] = spi_tx_rx(SPI_DUMMY_TX_VALUE); - } - return ECODE_OK; -#endif -} - -int readfromspi(uint16_t headerLength, - uint8_t *headerBuffer, - uint16_t readLength, - uint8_t *readBuffer) -{ - Ecode_t sc = 0; - - spi_transfer_open(); - if (headerBuffer && headerLength) { - sc |= spi_blocking_transmit(headerBuffer, headerLength); - } - if (!sc && readBuffer && readLength) { - sc |= spi_blocking_receive(readBuffer, readLength); - } - spi_transfer_close(); - - return sc; -} - -static int spi_write(uint16_t headerLength, - const uint8_t *headerBuffer, - uint16_t bodyLength, - const uint8_t *bodyBuffer, - uint8_t *crc8) -{ - Ecode_t sc = 0; - - spi_transfer_open(); - if (headerBuffer && headerLength) { - sc |= spi_blocking_transmit(headerBuffer, headerLength); - } - if (!sc && bodyBuffer && bodyLength) { - sc |= spi_blocking_transmit(bodyBuffer, bodyLength); - } - if (crc8) { - sc |= spi_blocking_transmit(crc8, sizeof(*crc8)); - } - spi_transfer_close(); - - return sc; -} - -int writetospi(uint16_t headerLength, - const uint8_t *headerBuffer, - uint16_t bodyLength, - const uint8_t *bodyBuffer) -{ - return spi_write(headerLength, headerBuffer, bodyLength, bodyBuffer, NULL); -} - -int writetospiwithcrc(uint16_t headerLength, - const uint8_t *headerBuffer, - uint16_t bodyLength, - const uint8_t *bodyBuffer, - uint8_t crc8) -{ - return spi_write(headerLength, headerBuffer, bodyLength, bodyBuffer, &crc8); -} diff --git a/driver/public/silabs/uwb2_dwm3000/platform/port/port.h b/driver/public/silabs/uwb2_dwm3000/platform/port/port.h deleted file mode 100644 index e31e2ab7..00000000 --- a/driver/public/silabs/uwb2_dwm3000/platform/port/port.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file port.h - * - * @brief port headers file to EFR32BG22 - * - * @author Decawave - * - * @attention Copyright 2017-2019 (c) Decawave Ltd, Dublin, Ireland. - * All rights reserved. - * - */ - -#ifndef PORT__H_ -#define PORT__H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "error.h" -#include "port_hal.h" -#include "deca_spi.h" -#include "deca_device_api.h" - -/* port functions prototypes */ -error_e port_init_dw_chip(void); -error_e port_wakeup_dw3000_fast(void); -error_e port_wakeup_dw3000(void); -void wakeup_device_with_io(void); - -void dw_irq_init(void); -void init_dw3000_irq(void); -void enable_dw3000_irq(void); -void disable_dw3000_irq(void); -void reset_DW3000(void); - -void port_stop_all_UWB(void); - -error_e port_disable_dw_irq_and_reset(int reset); - -#ifdef __cplusplus -} -#endif - -#endif /* PORT__H__ */ diff --git a/driver/public/silabs/uwb2_dwm3000/platform/port/port_dw3000.c b/driver/public/silabs/uwb2_dwm3000/platform/port/port_dw3000.c index c63cdc81..6838ce7e 100644 --- a/driver/public/silabs/uwb2_dwm3000/platform/port/port_dw3000.c +++ b/driver/public/silabs/uwb2_dwm3000/platform/port/port_dw3000.c @@ -11,45 +11,291 @@ * @author */ -#include "port.h" -#include "em_gpio.h" -#include "sl_udelay.h" +#include "port_dw3000.h" +#include "sl_sleeptimer.h" +#include "drv_spi_master.h" +#include "drv_digital_in.h" +#include "drv_digital_out.h" +#include "uwb2_dwm3000_config.h" +#include "deca_device_api.h" + +#if (defined(SLI_SI917)) +#include "sl_driver_gpio.h" +#define GPIO_M4_INTR 7 // M4 Pin interrupt number +#define AVL_INTR_NO 0 // available interrupt number +#define DWM3000_INT_CH_AND_FLAG ((GPIO_M4_INTR << \ + 16) | SL_GPIO_INTERRUPT_RISE_EDGE) +#else #include "gpiointerrupt.h" +#endif + +typedef struct port_dw3000 +{ + spi_master_t spi; + +#if defined (DWM3000_RESET_PORT) + digital_out_t gpio_reset; +#endif + +#if defined (DWM3000_WAKE_PORT) + digital_out_t gpio_wake; +#endif + +#if defined (DWM3000_ON_PORT) + digital_in_t gpio_on; +#endif + +#if defined (DWM3000_CS_PORT) + digital_out_t gpio_cs; +#endif + +#if defined (DWM3000_INT_PORT) + digital_in_t gpio_int; +#endif +}uwb2_dwm300_t; + +static uwb2_dwm300_t uwb2_dwm3000; + +static void process_deca_irq(uint8_t interrupt_number); #if defined(HAL_UWB_WAKEUP_PORT) && defined(HAL_UWB_WAKEUP_PIN) -#define port_wakeup_start() GPIO_PinModeSet(HAL_UWB_WAKEUP_PORT, \ - HAL_UWB_WAKEUP_PIN, \ - gpioModePushPull, \ - 1); -#define port_wakeup_end() GPIO_PinModeSet(HAL_UWB_WAKEUP_PORT, \ - HAL_UWB_WAKEUP_PIN, \ - gpioModePushPull, \ - 0); +#define port_wakeup_start() digital_out_high(&uwb2_dwm3000.gpio_wake); +#define port_wakeup_end() digital_out_low(&uwb2_dwm3000.gpio_wake); #else -#define port_wakeup_start() GPIO_PinModeSet(HAL_SPI_CS_PORT, \ - HAL_SPI_CS_PIN, \ - gpioModePushPull, \ - 0); -#define port_wakeup_end() GPIO_PinModeSet(HAL_SPI_CS_PORT, \ - HAL_SPI_CS_PIN, \ - gpioModePushPull, \ - 1); +#if defined(DWM3000_CS_PORT) && defined(DWM3000_CS_PIN) +#define port_wakeup_start() digital_out_low(&uwb2_dwm3000.gpio_cs); +#define port_wakeup_end() digital_out_high(&uwb2_dwm3000.gpio_cs); +#else +#define port_wakeup_start() +#define port_wakeup_end() +#endif #endif -/* @brief manually configuring of EXTI priority - * */ -void init_dw3000_irq(void) +int uwb2_dwm3000_spi_init(mikroe_spi_handle_t spidrv) +{ + if (NULL == spidrv) { + return _ERR; + } + + spi_master_config_t spi_cfg; + spi_master_configure_default(&spi_cfg); + spi_cfg.mode = SPI_MASTER_MODE_0; + spi_cfg.speed = DWM3000_FREQ_MIN; + + uwb2_dwm3000.spi.handle = spidrv; + + if (spi_master_open(&uwb2_dwm3000.spi, &spi_cfg) == SPI_MASTER_ERROR) { + return _ERR; + } + +#if defined (DWM3000_RESET_PORT) + pin_name_t gpio_reset_pin = hal_gpio_pin_name(DWM3000_RESET_PORT, + DWM3000_RESET_PIN); + digital_out_init(&uwb2_dwm3000.gpio_reset, gpio_reset_pin); +#endif + +#if defined (DWM3000_WAKE_PORT) + pin_name_t gpio_wake_pin = hal_gpio_pin_name(DWM3000_WAKE_PORT, + DWM3000_WAKE_PIN); + digital_out_init(&uwb2_dwm3000.gpio_wake, gpio_wake_pin); +#endif + +#if defined (DWM3000_ON_PORT) + pin_name_t gpio_on_pin = hal_gpio_pin_name(DWM3000_ON_PORT, + DWM3000_ON_PIN); + digital_in_init(&uwb2_dwm3000.gpio_on, gpio_on_pin); +#endif + +#if defined (DWM3000_CS_PORT) + pin_name_t gpio_cs_pin = hal_gpio_pin_name(DWM3000_CS_PORT, + DWM3000_CS_PIN); + digital_out_init(&uwb2_dwm3000.gpio_cs, gpio_cs_pin); +#endif + +#if defined DWM3000_INT_PORT + pin_name_t gpio_int_pin = hal_gpio_pin_name(DWM3000_INT_PORT, + DWM3000_INT_PIN); + digital_in_init(&uwb2_dwm3000.gpio_int, gpio_int_pin); + +#if (defined(SLI_SI917)) + sl_gpio_t gpio_port_pin = { DWM3000_INT_PIN / 16, + DWM3000_INT_PIN % 16 }; + sl_gpio_driver_configure_interrupt(&gpio_port_pin, + GPIO_M4_INTR, + SL_GPIO_INTERRUPT_RISING_EDGE, + (void *)process_deca_irq, + AVL_INTR_NO); + + sl_gpio_driver_disable_interrupts(DWM3000_INT_CH_AND_FLAG); + +#else /* None Si91x device */ + GPIOINT_CallbackRegister(DWM3000_INT_PIN, + process_deca_irq); + GPIO_ExtIntConfig(DWM3000_INT_PORT, + DWM3000_INT_PIN, + DWM3000_INT_PIN, + true, + false, + false); +#endif +#endif + + return _NO_ERR; +} + +int uwb2_dwm3000_spi_close(void) +{ + spi_master_close(&uwb2_dwm3000.spi); + return _NO_ERR; +} + +static void port_spi_set_bitrate(uint32_t goal_bitrate) +{ + spi_master_set_speed(&uwb2_dwm3000.spi, goal_bitrate); +} + +void set_dw_spi_slow_rate(void) { + port_spi_set_bitrate(DWM3000_FREQ_MIN); +} + +void set_dw_spi_fast_rate(void) +{ + port_spi_set_bitrate(DWM3000_FREQ_MAX); +} + +static inline void spi_transfer_open(void) +{ +#if (!SPI_USE_SPIDRV_API) && defined (SL_CATALOG_POWER_MANAGER_PRESENT) + sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); +#endif + +#if defined (DWM3000_CS_PORT) + digital_out_low(&uwb2_dwm3000.gpio_cs); +#endif +} + +static inline void spi_transfer_close(void) +{ +#if defined (DWM3000_CS_PORT) + digital_out_high(&uwb2_dwm3000.gpio_cs); +#endif + +#if (!SPI_USE_SPIDRV_API) && defined (SL_CATALOG_POWER_MANAGER_PRESENT) + sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); +#endif +} + +int readfromspi(uint16_t headerLength, + uint8_t *headerBuffer, + uint16_t readLength, + uint8_t *readBuffer) +{ + dwt_error_e sc = DWT_SUCCESS; + + spi_transfer_open(); + + if ((headerBuffer) && (headerLength) && (readBuffer) && (readLength)) { + if (spi_master_write_then_read(&uwb2_dwm3000.spi, headerBuffer, + headerLength, + readBuffer, + readLength) != SPI_MASTER_SUCCESS) { + sc = DWT_ERROR; + } + } + spi_transfer_close(); + + return sc; +} + +static int spi_write(uint16_t headerLength, + const uint8_t *headerBuffer, + uint16_t bodyLength, + const uint8_t *bodyBuffer, + uint8_t *crc8) +{ + dwt_error_e sc = DWT_SUCCESS; + uint32_t total_length = 0; + + spi_transfer_open(); + + if (headerBuffer && headerLength) { + total_length += headerLength; + } + + if (bodyBuffer && bodyLength) { + total_length += bodyLength; + } + + if (crc8) { + total_length += 1; + } + + uint8_t tx_buff[total_length]; + uint16_t tx_idx = 0; + + if (headerBuffer && headerLength) { + for (uint16_t i = 0; i < headerLength; i++) + { + tx_buff[tx_idx] = headerBuffer[i]; + tx_idx++; + } + } + + if (bodyBuffer && bodyLength) { + for (uint16_t i = 0; i < bodyLength; i++) + { + tx_buff[tx_idx] = bodyBuffer[i]; + tx_idx++; + } + } + + if (crc8) { + tx_buff[tx_idx] = *crc8; + } + + if (spi_master_write(&uwb2_dwm3000.spi, tx_buff, + total_length) != SPI_MASTER_SUCCESS) { + sc = DWT_ERROR; + } + spi_transfer_close(); + + return sc; +} + +int writetospi(uint16_t headerLength, + const uint8_t *headerBuffer, + uint16_t bodyLength, + const uint8_t *bodyBuffer) +{ + return spi_write(headerLength, headerBuffer, bodyLength, bodyBuffer, NULL); +} + +int writetospiwithcrc(uint16_t headerLength, + const uint8_t *headerBuffer, + uint16_t bodyLength, + const uint8_t *bodyBuffer, + uint8_t crc8) +{ + return spi_write(headerLength, headerBuffer, bodyLength, bodyBuffer, &crc8); } void disable_dw3000_irq(void) { - GPIO_IntDisable(1 << HAL_UWB_IRQ_IT_NBR); +#if (defined(SLI_SI917)) + sl_gpio_driver_disable_interrupts(DWM3000_INT_CH_AND_FLAG); +#else + GPIO_IntDisable(1 << DWM3000_INT_PIN); +#endif } void enable_dw3000_irq(void) { - GPIO_IntEnable(1 << HAL_UWB_IRQ_IT_NBR); +#if (defined(SLI_SI917)) + sl_gpio_driver_enable_interrupts(DWM3000_INT_CH_AND_FLAG); +#else + GPIO_IntEnable(1 << DWM3000_INT_PIN); +#endif } /* @fn reset_DW1000 @@ -60,10 +306,17 @@ void enable_dw3000_irq(void) * */ void reset_DW3000(void) { - GPIO_PinModeSet(HAL_UWB_RST_PORT, HAL_UWB_RST_PIN, gpioModePushPull, 0); - sl_udelay_wait(2000); - GPIO_PinModeSet(HAL_UWB_RST_PORT, HAL_UWB_RST_PIN, gpioModeInputPull, 1); - sl_udelay_wait(2000); +#if defined (DWM3000_RESET_PORT) + digital_out_low(&uwb2_dwm3000.gpio_reset); +#endif + + deca_sleep(2); + +#if defined (DWM3000_RESET_PORT) + digital_out_high(&uwb2_dwm3000.gpio_reset); +#endif + + deca_sleep(2); } __attribute__((weak)) void wakeup_device_with_io(void) @@ -82,7 +335,7 @@ __attribute__((weak)) void wakeup_device_with_io(void) error_e port_wakeup_dw3000_fast(void) { port_wakeup_start(); - sl_udelay_wait(500); + deca_usleep(500); port_wakeup_end(); return _NO_ERR; @@ -157,11 +410,11 @@ error_e port_disable_wake_init_dw(void) return _NO_ERR; } -error_e port_init_dw_chip(void) +error_e port_init_dw_chip(mikroe_spi_handle_t spidrv) { dwt_setlocaldataptr(0); - int sc = openspi(); + int sc = uwb2_dwm3000_spi_init(spidrv); if (0 != sc) { return _ERR_SPI; } @@ -192,11 +445,16 @@ void port_stop_all_UWB(void) */ decaIrqStatus_t decamutexon(void) { +#if (defined(SLI_SI917)) + sl_gpio_driver_disable_interrupts(DWM3000_INT_CH_AND_FLAG); + return 0; +#else uint32_t s = GPIO_EnabledIntGet(); - if (s & (1 << HAL_UWB_IRQ_IT_NBR)) { - GPIO_IntDisable(1 << HAL_UWB_IRQ_IT_NBR); + if (s & (1 << DWM3000_INT_PIN)) { + GPIO_IntDisable(1 << DWM3000_INT_PIN); } return s; +#endif } /*! ---------------------------------------------------------------------------- @@ -215,9 +473,14 @@ decaIrqStatus_t decamutexon(void) */ void decamutexoff(decaIrqStatus_t s) { - if (s & (1 << HAL_UWB_IRQ_IT_NBR)) { - GPIO_IntEnable(1 << HAL_UWB_IRQ_IT_NBR); +#if (defined(SLI_SI917)) + (void)s; + sl_gpio_driver_enable_interrupts(DWM3000_INT_CH_AND_FLAG); +#else + if (s & (1 << DWM3000_INT_PIN)) { + GPIO_IntEnable(1 << DWM3000_INT_PIN); } +#endif } /* @fn process_deca_irq @@ -229,21 +492,12 @@ static void process_deca_irq(uint8_t interrupt_number) { (void)interrupt_number; - while (GPIO_PinInGet(HAL_UWB_IRQ_PORT, HAL_UWB_IRQ_PIN) != 0) + while (digital_in_read(&uwb2_dwm3000.gpio_int) != 0) { dwt_isr(); } // while DW3000 IRQ line active } -void dw_irq_init(void) -{ - GPIO_PinModeSet(HAL_UWB_IRQ_PORT, HAL_UWB_IRQ_PIN, gpioModeInputPull, 0); - - GPIOINT_CallbackRegister(HAL_UWB_IRQ_IT_NBR, process_deca_irq); - GPIO_ExtIntConfig(HAL_UWB_IRQ_PORT, HAL_UWB_IRQ_PIN, - HAL_UWB_IRQ_IT_NBR, true, false, false); -} - /* * @brief disable DW_IRQ, reset DW3000 * and set @@ -261,3 +515,15 @@ error_e port_disable_dw_irq_and_reset(int reset) return _NO_ERR; } + +/* Wrapper function to be used by decadriver. Declared in deca_device_api.h */ +void deca_sleep(unsigned int time_ms) +{ + sl_sleeptimer_delay_millisecond(time_ms); +} + +/* Wrapper function to be used by decadriver. Declared in deca_device_api.h */ +void deca_usleep(unsigned long time_us) +{ + sl_udelay_wait(time_us); +} diff --git a/driver/public/silabs/uwb2_dwm3000/platform/deca_spi/deca_spi.h b/driver/public/silabs/uwb2_dwm3000/platform/port/port_dw3000.h similarity index 53% rename from driver/public/silabs/uwb2_dwm3000/platform/deca_spi/deca_spi.h rename to driver/public/silabs/uwb2_dwm3000/platform/port/port_dw3000.h index 412afe24..39f6deed 100644 --- a/driver/public/silabs/uwb2_dwm3000/platform/deca_spi/deca_spi.h +++ b/driver/public/silabs/uwb2_dwm3000/platform/port/port_dw3000.h @@ -1,37 +1,31 @@ /** - * @file deca_spi.h + * @file port.h * - * @brief SPI interface access function protypes + * @brief port headers file to EFR32BG22 * * @author Decawave * * @attention Copyright 2017-2019 (c) Decawave Ltd, Dublin, Ireland. * All rights reserved. + * */ -#ifndef _DECA_SPI_H_ -#define _DECA_SPI_H_ +#ifndef PORT__H_ +#define PORT__H_ #ifdef __cplusplus extern "C" { #endif -/**--------------------------------------- - * Function: openspi() - * - * Low level abstract function to open and initialise access to the SPI device. - * returns 0 for success, or -1 for error - */ -int openspi(void); - -/**--------------------------------------- - * Function: closespi() - * - * Low level abstract function to close the the SPI device. - * returns 0 for success, or -1 for error - */ -int closespi(void); +#include +#include +#include "error.h" +#include "deca_device_api.h" +#include "drv_spi_master.h" +/* spi functions prototypes */ +int uwb2_dwm3000_spi_init(mikroe_spi_handle_t spidrv); +int uwb2_dwm3000_spi_close(void); int writetospi(uint16_t headerLength, const uint8_t *headerBuffer, uint16_t bodyLength, @@ -48,8 +42,22 @@ int readfromspi(uint16_t headerLength, void set_dw_spi_fast_rate(void); void set_dw_spi_slow_rate(void); +/* port functions prototypes */ +error_e port_init_dw_chip(mikroe_spi_handle_t spidrv); +error_e port_wakeup_dw3000_fast(void); +error_e port_wakeup_dw3000(void); +void wakeup_device_with_io(void); + +void enable_dw3000_irq(void); +void disable_dw3000_irq(void); +void reset_DW3000(void); + +void port_stop_all_UWB(void); + +error_e port_disable_dw_irq_and_reset(int reset); + #ifdef __cplusplus } #endif -#endif /* _DECA_SPI_H_ */ +#endif /* PORT__H__ */ diff --git a/driver/public/silabs/uwb2_dwm3000/platform/port/port_hal.h b/driver/public/silabs/uwb2_dwm3000/platform/port/port_hal.h deleted file mode 100644 index ef27a131..00000000 --- a/driver/public/silabs/uwb2_dwm3000/platform/port/port_hal.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file port_hal.h - * - * @brief port Hardware Abstraction Layer headers file - * - * @author Decawave - * - * @attention Copyright 2017-2019 (c) Decawave Ltd, Dublin, Ireland. - * All rights reserved. - * - */ - -#include "uwb2_dwm3000_config.h" - -#define _HAL_CAT2EXP(a, b) a ## b -#define HAL_CAT2(a, b) _HAL_CAT2EXP(a, b) -#define _HAL_CAT3EXP(a, b, c) a ## b ## c -#define HAL_CAT3(a, b, c) _HAL_CAT3EXP(a, b, c) - -// UWB/DW3000 -#define HAL_UWB_IRQ_PORT DWM3000_INT_PORT -#define HAL_UWB_IRQ_PIN DWM3000_INT_PIN -#define HAL_UWB_IRQ_IT_NBR DWM3000_INT_PIN - -#define HAL_UWB_RST_PORT DWM3000_RESET_PORT -#define HAL_UWB_RST_PIN DWM3000_RESET_PIN -#define HAL_UWB_RST_IT_NBR DWM3000_RESET_PIN - -#if defined(DWM3000_WAKE_PORT) && defined(DWM3000_WAKE_PIN) -#define HAL_UWB_WAKEUP_PORT DWM3000_WAKE_PORT -#define HAL_UWB_WAKEUP_PIN DWM3000_WAKE_PIN -#define HAL_UWB_WAKEUP_IT_NBR DWM3000_WAKE_PIN -#endif - -#define HAL_UWB_EXTON_PORT DWM3000_ON_PORT -#define HAL_UWB_EXTON_PIN DWM3000_ON_PIN -#define HAL_UWB_EXTON_IT_NBR DWM3000_ON_PIN - -// SPI -#define HAL_SPI_TYPE DWM3000_SPI_TYPE -#define HAL_SPI_NUMBER DWM3000_SPI_NUMBER -#define HAL_SPI_PERIPHERAL HAL_CAT2(HAL_SPI_TYPE, HAL_SPI_NUMBER) - -#define HAL_SPI_CS_PORT DWM3000_CS_PORT -#define HAL_SPI_CS_PIN DWM3000_CS_PIN - -#define HAL_SPI_CLK_PORT DWM3000_CLK_PORT -#define HAL_SPI_CLK_PIN DWM3000_CLK_PIN - -#define HAL_SPI_MISO_PORT DWM3000_MISO_PORT -#define HAL_SPI_MISO_PIN DWM3000_MISO_PIN - -#define HAL_SPI_MOSI_PORT DWM3000_MOSI_PORT -#define HAL_SPI_MOSI_PIN DWM3000_MOSI_PIN - -#define HAL_SPI_FREQ_MIN DWM3000_FREQ_MIN -#define HAL_SPI_FREQ_MAX DWM3000_FREQ_MAX diff --git a/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/CHANGELOG.md b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/CHANGELOG.md new file mode 100644 index 00000000..400d5062 --- /dev/null +++ b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/CHANGELOG.md @@ -0,0 +1,4 @@ +## Changelog + +### Version 2.1.0.12 + - Initial release diff --git a/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/CMakeLists.txt b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/CMakeLists.txt new file mode 100644 index 00000000..efec3d34 --- /dev/null +++ b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_accurrent LANGUAGES MikroC) +else() + project(example_accurrent LANGUAGES C ASM) +endif() + +include(mikroeUtils) + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_accurrent + example/main.c + +) + + +############################ example_accurrent GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_accurrent PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_accurrent PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_accurrent PUBLIC MikroSDK.Log) +add_subdirectory(lib_accurrent) +target_link_libraries(example_accurrent PUBLIC Click.AcCurrent) +############################ example_accurrent GENERATED CODE END ########################### + +if(COMPILER_REVISION) + if(${COMPILER_REVISION} VERSION_GREATER_EQUAL "1.0") + if(${TOOLCHAIN_LANGUAGE} STREQUAL "GNU") + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.meproject) + fetch_startup_name(${CMAKE_CURRENT_SOURCE_DIR}/.meproject startupName) + if(startupName) + add_startup_all_targets(. ${CMAKE_CURRENT_SOURCE_DIR} ${startupName}) + endif() + fetch_linker_name(${CMAKE_CURRENT_SOURCE_DIR}/.meproject linkerName) + if(linkerName) + add_ld_all_targets(. ${CMAKE_CURRENT_SOURCE_DIR} ${linkerName}) + endif() + endif() + endif() + endif() +endif() diff --git a/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/DETAILS.md b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/DETAILS.md new file mode 100644 index 00000000..7097da7c --- /dev/null +++ b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/DETAILS.md @@ -0,0 +1,139 @@ + +--- +# AC Current click + +AC Current click is a device that is able to measure the alternating current (AC) running through the conductor, using the so-called non-invasive current sensor. The non-invasive sensor works by utilizing the electromagnetic induction phenomenon, similar to a transformer. The primary coil does not exist though, the electromagnetic field is generated by the AC Current running through the cable which is measured. The core of the sensing probe is split, allowing it to clamp on the current conducting cable. Since the sensor does not influence the measurement circuitry in any way while being galvanically isolated at the same time, it is an ideal solution to measure current running through mains, or similar high voltage installations. + +

+ +

+ +[click Product page](https://www.mikroe.com/ac-current-click) + +--- + + +#### Click library + +- **Author** : MikroE Team +- **Date** : Jan 2020. +- **Type** : SPI type + + +# Software Support + +We provide a library for the AcCurrent Click +as well as a demo application (example), developed using MikroElektronika +[compilers](https://shop.mikroe.com/compilers). +The demo can run on all the main MikroElektronika [development boards](https://shop.mikroe.com/development-boards). + +Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account. + +## Library Description + +> This library contains API for AcCurrent Click driver. + +#### Standard key functions : + +- `accurrent_cfg_setup` Config Object Initialization function. +```c +void accurrent_cfg_setup ( accurrent_cfg_t *cfg ); +``` + +- `accurrent_init` Initialization function. +```c +err_t accurrent_init ( accurrent_t *ctx, accurrent_cfg_t *cfg ); +``` + +#### Example key functions : + +- `accurrent_get_a` Gets current value of AC Current in A. +```c +float accurrent_get_a ( accurrent_t *ctx ); +``` + +- `accurrent_get_ma` Gets current value of AC Current in mA. +```c +float accurrent_get_ma ( accurrent_t *ctx ); +``` + +## Examples Description + +> This application measures AC current through a conductor. + +**The demo application is composed of two sections :** + +### Application Init + +> SPI driver and slick initialization. + +```c + +void application_init ( void ) +{ + log_cfg_t log_cfg; + accurrent_cfg_t cfg; + + /** + * Logger initialization. + * Default baud rate: 115200 + * Default log level: LOG_LEVEL_DEBUG + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. + * See @b LOG_MAP_USB_UART macro definition for detailed explanation. + */ + LOG_MAP_USB_UART( log_cfg ); + log_init( &logger, &log_cfg ); + log_info( &logger, "---- Application Init ----" ); + + // Click initialization. + + accurrent_cfg_setup( &cfg ); + ACCURRENT_MAP_MIKROBUS( cfg, MIKROBUS_1 ); + accurrent_init( &accurrent, &cfg ); +} + +``` + +### Application Task + +> Reads the value of AC current and displays it on the USB UART. + +```c + +void application_task ( void ) +{ + float ac_current = 0; + ac_current = accurrent_get_ma( &accurrent ); + log_printf( &logger, "Current value: %.3f mA\r\n", ac_current ); + Delay_ms ( 1000 ); +} + +``` + +## NOTE +> An appropriate AC Current sensor needs to be connected to the click board. + +The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt. + +**Other mikroE Libraries used in the example:** + +- MikroSDK.Board +- MikroSDK.Log +- Click.AcCurrent + +**Additional notes and informations** + +Depending on the development board you are using, you may need +[USB UART click](https://shop.mikroe.com/usb-uart-click), +[USB UART 2 Click](https://shop.mikroe.com/usb-uart-2-click) or +[RS232 Click](https://shop.mikroe.com/rs232-click) to connect to your PC, for +development systems with no UART to USB interface available on the board. The +terminal available in all Mikroelektronika +[compilers](https://shop.mikroe.com/compilers), or any other terminal application +of your choice, can be used to read the message. + + + +--- diff --git a/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/README.md b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/README.md new file mode 100644 index 00000000..6e8407a0 --- /dev/null +++ b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/README.md @@ -0,0 +1,140 @@ +\mainpage Main Page + +--- +# AC Current click + +AC Current click is a device that is able to measure the alternating current (AC) running through the conductor, using the so-called non-invasive current sensor. The non-invasive sensor works by utilizing the electromagnetic induction phenomenon, similar to a transformer. The primary coil does not exist though, the electromagnetic field is generated by the AC Current running through the cable which is measured. The core of the sensing probe is split, allowing it to clamp on the current conducting cable. Since the sensor does not influence the measurement circuitry in any way while being galvanically isolated at the same time, it is an ideal solution to measure current running through mains, or similar high voltage installations. + +

+ +

+ +[click Product page](https://www.mikroe.com/ac-current-click) + +--- + + +#### Click library + +- **Author** : MikroE Team +- **Date** : Jan 2020. +- **Type** : SPI type + + +# Software Support + +We provide a library for the AcCurrent Click +as well as a demo application (example), developed using MikroElektronika +[compilers](https://shop.mikroe.com/compilers). +The demo can run on all the main MikroElektronika [development boards](https://shop.mikroe.com/development-boards). + +Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account. + +## Library Description + +> This library contains API for AcCurrent Click driver. + +#### Standard key functions : + +- `accurrent_cfg_setup` Config Object Initialization function. +```c +void accurrent_cfg_setup ( accurrent_cfg_t *cfg ); +``` + +- `accurrent_init` Initialization function. +```c +err_t accurrent_init ( accurrent_t *ctx, accurrent_cfg_t *cfg ); +``` + +#### Example key functions : + +- `accurrent_get_a` Gets current value of AC Current in A. +```c +float accurrent_get_a ( accurrent_t *ctx ); +``` + +- `accurrent_get_ma` Gets current value of AC Current in mA. +```c +float accurrent_get_ma ( accurrent_t *ctx ); +``` + +## Examples Description + +> This application measures AC current through a conductor. + +**The demo application is composed of two sections :** + +### Application Init + +> SPI driver and slick initialization. + +```c + +void application_init ( void ) +{ + log_cfg_t log_cfg; + accurrent_cfg_t cfg; + + /** + * Logger initialization. + * Default baud rate: 115200 + * Default log level: LOG_LEVEL_DEBUG + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. + * See @b LOG_MAP_USB_UART macro definition for detailed explanation. + */ + LOG_MAP_USB_UART( log_cfg ); + log_init( &logger, &log_cfg ); + log_info( &logger, "---- Application Init ----" ); + + // Click initialization. + + accurrent_cfg_setup( &cfg ); + ACCURRENT_MAP_MIKROBUS( cfg, MIKROBUS_1 ); + accurrent_init( &accurrent, &cfg ); +} + +``` + +### Application Task + +> Reads the value of AC current and displays it on the USB UART. + +```c + +void application_task ( void ) +{ + float ac_current = 0; + ac_current = accurrent_get_ma( &accurrent ); + log_printf( &logger, "Current value: %.3f mA\r\n", ac_current ); + Delay_ms ( 1000 ); +} + +``` + +## NOTE +> An appropriate AC Current sensor needs to be connected to the click board. + +The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt. + +**Other mikroE Libraries used in the example:** + +- MikroSDK.Board +- MikroSDK.Log +- Click.AcCurrent + +**Additional notes and informations** + +Depending on the development board you are using, you may need +[USB UART click](https://shop.mikroe.com/usb-uart-click), +[USB UART 2 Click](https://shop.mikroe.com/usb-uart-2-click) or +[RS232 Click](https://shop.mikroe.com/rs232-click) to connect to your PC, for +development systems with no UART to USB interface available on the board. The +terminal available in all Mikroelektronika +[compilers](https://shop.mikroe.com/compilers), or any other terminal application +of your choice, can be used to read the message. + + + +--- diff --git a/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/doc/doxy/Doxyfile.doxy b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/doc/doxy/Doxyfile.doxy new file mode 100644 index 00000000..91ce48f8 --- /dev/null +++ b/driver/thirdparty/mikrosdk_click_v2/clicks/accurrent/doc/doxy/Doxyfile.doxy @@ -0,0 +1,2496 @@ +# Doxyfile 1.8.13 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = accurrent + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 2.0.0.0 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../cmake/accurrent/temp/Help/doc + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = YES + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../cmake/accurrent/example \ + ../cmake/accurrent/lib_accurrent/include \ + ../cmake/accurrent/README.md + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.odl \ + .md + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = ../cmake/accurrent/example + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = YES + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://DEVELOPER_NAME.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/DEVELOPER_NAME/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://DEVELOPER_NAME.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "MikroE Click boards" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = mikroe.com + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = mikroe.com + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = MikroElektronika + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = YES + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = ./temp/Help/doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /