|
|
|
@ -78,7 +78,7 @@ typedef enum
|
|
|
|
|
output, /*!< Set pin as **Output** */
|
|
|
|
|
analog, /*!< Set pin as **Analog** */
|
|
|
|
|
alternate /*!< Set pin as **Alternate** */
|
|
|
|
|
}mode_t;
|
|
|
|
|
}pinMode_t;
|
|
|
|
|
|
|
|
|
|
/*! Enum of possible Outpout Stages */
|
|
|
|
|
typedef enum
|
|
|
|
@ -87,7 +87,7 @@ typedef enum
|
|
|
|
|
floating, /*!< Set ouput stage to **Floating** */
|
|
|
|
|
pushPull, /*!< Set ouput stage to **Push Pull** */
|
|
|
|
|
openDrain /*!< Set ouput stage to **Open Drain** */
|
|
|
|
|
}stage_t;
|
|
|
|
|
}pinStage_t;
|
|
|
|
|
|
|
|
|
|
/*! Enum for the internal Pull-Up/Down resistors */
|
|
|
|
|
typedef enum
|
|
|
|
@ -96,7 +96,7 @@ typedef enum
|
|
|
|
|
none, /*!< **Disbales** internal resistance */
|
|
|
|
|
pullUp, /*!< Set internal resistance as **Pull-Up** */
|
|
|
|
|
pullDown /*!< Set internal resistance as **Pull-Down** */
|
|
|
|
|
}pullUpDown_t;
|
|
|
|
|
}pinPullUpDown_t;
|
|
|
|
|
|
|
|
|
|
/*! Enum to set the pin's speed*/
|
|
|
|
|
typedef enum
|
|
|
|
@ -106,22 +106,22 @@ typedef enum
|
|
|
|
|
normal, /*!< set pin's speed to **Normal** */
|
|
|
|
|
fast, /*!< set pin's speed to **Fast** */
|
|
|
|
|
veryFast /*!< set pin's speed to **Very Fast** */
|
|
|
|
|
}speed_t;
|
|
|
|
|
}pinSpeed_t;
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
disabled,
|
|
|
|
|
enabled
|
|
|
|
|
}interrupt_t;
|
|
|
|
|
}pinInterrupt_t;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
mode_t md;
|
|
|
|
|
stage_t st;
|
|
|
|
|
pullUpDown_t pud;
|
|
|
|
|
speed_t sp;
|
|
|
|
|
interrupt_t intr;
|
|
|
|
|
}configuration_t;
|
|
|
|
|
pinMode_t md;
|
|
|
|
|
pinStage_t st;
|
|
|
|
|
pinPullUpDown_t pud;
|
|
|
|
|
pinSpeed_t sp;
|
|
|
|
|
pinInterrupt_t intr;
|
|
|
|
|
}pinConfiguration_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
@ -138,34 +138,34 @@ typedef enum
|
|
|
|
|
Bocked,
|
|
|
|
|
AlreadyUsed,
|
|
|
|
|
NotGpio
|
|
|
|
|
}errors_t;
|
|
|
|
|
}pinErrors_t;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Configuration function that will call all the necessary function for an sucessfull pin initialisation
|
|
|
|
|
* @param pinNo_t mode_t
|
|
|
|
|
* @retval none
|
|
|
|
|
*/
|
|
|
|
|
void pinConfig(pinNo_t pinNo, mode_t mode, stage_t stage, pullUpDown_t resistance, speed_t speed);
|
|
|
|
|
void pinConfig(pinNo_t pinNo, pinMode_t mode, pinStage_t stage, pinPullUpDown_t resistance, pinSpeed_t speed);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Modes to set the direction or function of the pin
|
|
|
|
|
*/
|
|
|
|
|
void pinSetMode(pinNo_t pinNo, mode_t mode);
|
|
|
|
|
void pinSetMode(pinNo_t pinNo, pinMode_t mode);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Output Stage Push-Pull High-z ect...
|
|
|
|
|
*/
|
|
|
|
|
void pinSetOutputStage(pinNo_t pinNo, stage_t stage);
|
|
|
|
|
void pinSetOutputStage(pinNo_t pinNo, pinStage_t stage);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Depending of the hardare it is able to select the speed of given pins
|
|
|
|
|
*/
|
|
|
|
|
void pinSetSpeed(pinNo_t pinNo, speed_t speed);
|
|
|
|
|
void pinSetSpeed(pinNo_t pinNo, pinSpeed_t speed);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief If internal Pull-up or Pull-donws are wailable
|
|
|
|
|
*/
|
|
|
|
|
void pinSetPullUpDonw(pinNo_t pinNo, pullUpDown_t resistance);
|
|
|
|
|
void pinSetPullUpDonw(pinNo_t pinNo, pinPullUpDown_t resistance);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief If pin is set as alternate this function will modify the pins functionality
|
|
|
|
|