Digital Input/Output Reusable Driver v1.1
This project implements a GPIO reusable driver that can be adapted to various microcontrollers.
Loading...
Searching...
No Matches
dio_cfg.c File Reference

This module contains the implementation for the digital input/output peripheral configuration. More...

#include "dio_cfg.h"
Include dependency graph for dio_cfg.c:

Functions

const DioConfig_t *const DIO_configGet (void)
 
size_t DIO_configSizeGet (void)
 

Variables

const DioConfig_t DioConfig []
 

Detailed Description

This module contains the implementation for the digital input/output peripheral configuration.

Author
Jose Luis Figueroa
Version
1.1
Date
2025-03-04

Function Documentation

◆ DIO_configGet()

const DioConfig_t *const DIO_configGet ( void )

Description: This function is used to initialize the DIO based on the configuration table defined in dio_cfg module.

PRE-CONDITION: configuration table needs to be populated (sizeof > 0)

POST-CONDITION: A constant pointer to the first member of the
configuration table will be returned.

Returns
A pointer to the configuration table.

Example:

const Dio_Config_t * const DioConfig = DIO_configGet();
size_t configSize = DIO_configSizeGet();
DIO_Init(DioConfig, configSize);
size_t DIO_configSizeGet(void)
Definition dio_cfg.c:139
const DioConfig_t DioConfig[]
Definition dio_cfg.c:41
const DioConfig_t *const DIO_configGet(void)
Definition dio_cfg.c:98
See also
DIO_configGet
DIO_configSizeGet
DIO_init
DIO_channelRead
DIO_channelWrite
DIO_channelToggle
DIO_registerWrite
DIO_registerRead

◆ DIO_configSizeGet()

size_t DIO_configSizeGet ( void )

Description: This function is used to get the size of the configuration table.

PRE-CONDITION: configuration table needs to be populated (sizeof > 0)

POST-CONDITION: The size of the configuration table will be returned.

Returns
The size of the configuration table.

Example:

const Dio_Config_t * const DioConfig = DIO_configGet();
size_t configSize = DIO_configSizeGet();
DIO_Init(DioConfig, configSize);
See also
DIO_configGet
DIO_configSizeGet
DIO_init
DIO_channelRead
DIO_channelWrite
DIO_channelToggle
DIO_registerWrite
DIO_registerRead

Variable Documentation

◆ DioConfig

const DioConfig_t DioConfig[]
Initial value:
=
{
}
@ DIO_NO_RESISTOR
Definition dio_cfg.h:156
@ DIO_PUSH_PULL
Definition dio_cfg.h:134
@ DIO_AF0
Definition dio_cfg.h:168
@ DIO_PB
Definition dio_cfg.h:49
@ DIO_PC
Definition dio_cfg.h:50
@ DIO_PA
Definition dio_cfg.h:48
@ DIO_LOW_SPEED
Definition dio_cfg.h:144
@ DIO_OUTPUT
Definition dio_cfg.h:123
@ DIO_INPUT
Definition dio_cfg.h:122
@ DIO_PA4
Definition dio_cfg.h:67
@ DIO_PB0
Definition dio_cfg.h:79
@ DIO_PC13
Definition dio_cfg.h:107
@ DIO_PA2
Definition dio_cfg.h:65
@ DIO_PA3
Definition dio_cfg.h:66
@ DIO_PA5
Definition dio_cfg.h:68
@ DIO_PA1
Definition dio_cfg.h:64
@ DIO_PA0
Definition dio_cfg.h:63

The following array contains the configuration data for each digital input/output peripheral channel (pin). Each row represent a single pin. Each column is representing a member of the DioConfig_t structure. This table is read in by Dio_Init, where each channel is then set up based on this table. The NUMBER_DIGITAL_PINS constant should be accorded with the number of rows.