now using BSP_GPIO

This commit is contained in:
2024-05-18 02:10:29 +02:00
parent 2d903dcf11
commit 467d7c4de9
4 changed files with 108 additions and 5 deletions

View File

@@ -0,0 +1,78 @@
#include "BSP_GPIO.h"
#include "main.h"
#include "gpio.h"
/**
* @brief Checks if the K15 pin is set.
* @return true if the K15 pin is set, false otherwise.
*/
bool BSP_GPIO_K15isSet() {
return HAL_GPIO_ReadPin(K15_Detect_GPIO_Port, K15_Detect_Pin) == GPIO_PIN_SET;
}
/**
* @brief Turns on the CLS power.
*/
void BSP_GPIO_ClsOn() {
HAL_GPIO_WritePin(CLS_POWER_GPIO_Port, CLS_POWER_Pin, GPIO_PIN_SET);
}
/**
* @brief Turns off the CLS power.
*/
void BSP_GPIO_ClsOff() {
HAL_GPIO_WritePin(CLS_POWER_GPIO_Port, CLS_POWER_Pin, GPIO_PIN_RESET);
}
/**
* @brief Turns on the peripheral power.
*/
void BSP_GPIO_PeriperalsOn() {
HAL_GPIO_WritePin(Periph_Power_GPIO_Port,Periph_Power_Pin,GPIO_PIN_RESET);
}
/**
* @brief Turns off the peripheral power.
*/
void BSP_GPIO_PeriperalsOff() {
HAL_GPIO_WritePin(Periph_Power_GPIO_Port,Periph_Power_Pin,GPIO_PIN_SET);
}
/**
* @brief Turns on the radio.
*
* This function sets the GPIO pin to high, turning on the radio.
*/
void BSP_GPIO_RadioOn() {
HAL_GPIO_WritePin(K15_OUT_GPIO_Port, K15_OUT_Pin, GPIO_PIN_SET);
}
/**
* @brief Turns off the radio.
*
* This function sets the GPIO pin to low, turning off the radio.
*/
void BSP_GPIO_RadioOff() {
HAL_GPIO_WritePin(K15_OUT_GPIO_Port, K15_OUT_Pin, GPIO_PIN_RESET);
}
/**
* @brief Turns on the write protection for the EEPROM.
*
* This function sets the write protect pin of the EEPROM to high,
* enabling write protection for the EEPROM.
*/
void BSP_GPIO_EE24WriteProtectOn() {
HAL_GPIO_WritePin(EEPROM_WC_GPIO_Port, EEPROM_WC_Pin, GPIO_PIN_SET);
}
/**
* @brief Turns off the write protection for the EEPROM.
*
* This function sets the write protect pin of the EEPROM to low,
* disabling write protection for the EEPROM.
*/
void BSP_GPIO_EE24WriteProtectOff() {
HAL_GPIO_WritePin(EEPROM_WC_GPIO_Port, EEPROM_WC_Pin, GPIO_PIN_RESET);
}