Urbanite: Parking aid system
|
Header for the portable functions to interact with the HW of the display system. The functions must be implemented in the platform-specific code. More...
#include <stdint.h>
Data Structures | |
struct | rgb_color_t |
Structure to define an RGB color. More... | |
Macros | |
#define | PORT_REAR_PARKING_DISPLAY_ID 0 |
#define | PORT_DISPLAY_RGB_MAX_VALUE |
#define | COLOR_RED |
#define | COLOR_GREEN |
#define | COLOR_BLUE |
#define | COLOR_YELLOW |
#define | COLOR_TURQUOISE |
#define | COLOR_OFF (rgb_color_t){0, 0, 0} |
Functions | |
void | port_display_init (uint32_t display_id) |
Configure the HW specifications of a given display. More... | |
void | port_display_set_rgb (uint32_t display_id, rgb_color_t color) |
Set the Capture/Compare register values for each channel of the RGB LED given a color. More... | |
Header for the portable functions to interact with the HW of the display system. The functions must be implemented in the platform-specific code.
#define COLOR_BLUE |
Blue color
#define COLOR_GREEN |
Green color
#define COLOR_OFF (rgb_color_t){0, 0, 0} |
Off color
#define COLOR_RED |
Red color
#define COLOR_TURQUOISE |
Turquoise color
#define COLOR_YELLOW |
Yellow color
#define PORT_DISPLAY_RGB_MAX_VALUE |
Maximum value for the RGB LED
#define PORT_REAR_PARKING_DISPLAY_ID 0 |
Display system identifier for the rear parking sensor
void port_display_init | ( | uint32_t | display_id | ) |
Configure the HW specifications of a given display.
Assuming we are using an STM32F4-based platform, this function must call the following functions:
TODO alumnos:
✅ 1. Retrieve the display configuration struct calling
_stm32f4_display_get()
.
✅ 2. Call functionstm32f4_system_gpio_config()
with the right arguments to configure each RGB LED as in alternate mode and no pull up neither pull down connection.
✅ 3. Call functionstm32f4_system_gpio_config_alternate()
with the right arguments to configure the alternate function of the each RGB LED.
✅ 4. Call function_timer_pwm_config()
to configure the timer and the PWM signal of the display.
✅ 5. Call functionport_display_set_rgb()
to set the RGB LED to off.
display_id | Display ID. This index is used to select the element of the displays_arr[] array |
void port_display_set_rgb | ( | uint32_t | display_id, |
rgb_color_t | color | ||
) |
Set the Capture/Compare register values for each channel of the RGB LED given a color.
This function disables the timer associated to the RGB LEDs, sets the Capture/Compare register values for each channel of the RGB LED, and enables the timer.
TODO alumnos:
✅ 1. Retrieve the individual RGB values from the
color
parameter and follow the flowchart to set the RGB LED color by configuring the PWM signals appropriately:![]()
display_id | Display system identifier number. |
color | RGB color to set. |