};
// Maps of port names to port descriptors
-static port_def_t port_definition[PORT_CNT] = {
+port_def_t port_definition[PORT_CNT] = {
{.name = PORT_NAME_GIOA, .desc = &port_desc_gioa},
{.name = PORT_NAME_GIOB, .desc = &port_desc_giob},
{.name = PORT_NAME_NHET1, .desc = &port_desc_nhet1},
{.name = PORT_NAME_ADC, .desc = &port_desc_adc}
};
-
-/**
- * Get port descriptor assigned to port name.
- * @param[in] port_name Pointer to string - the name of the port.
- * @param[in] len Length of the name, if terminated by '/0', then len=-1
- * @return Port descriptor or NULL if not found
- */
-port_desc_t *hal_port_get_dsc(const char *port_name, int len)
-{
- uint32_t i;
- const char *port_name_ptr;
- char port_name_term[32];
-
- if (len != -1) { // port name not terminated by '\0'
- strncpy(port_name_term, port_name, len);
- port_name_term[len] = '\0';
- port_name_ptr = port_name_term;
- }
- else port_name_ptr = port_name;
-
- for (i = 0; i < PORT_CNT; i++) {
- if (strcmp(port_name_ptr, port_definition[i].name) == 0)
- return port_definition[i].desc;
- }
- return NULL;
-}
-
-/**
- * Get port descriptor assigned to port name.
- * @param[in] port_name Pointer to string - the name of the port.
- * @param[in] len Length of the name, if terminated by '/0', then len=-1
- * @return Port descriptor or NULL if not found
- */
-const port_def_t *hal_port_get_definitions()
-{
- return (const port_def_t *)port_definition;
-}