28 #ifndef INC_DRIVERS_GPIO_OC_GPIO_H_ 29 #define INC_DRIVERS_GPIO_OC_GPIO_H_ 32 #define DRIVER_NAME GPIO 42 #define _________________________________________TYPES_SECTION______________________________________________________________________________ 128 oC_GPIO_OutputCircuit_Default = oC_GPIO_LLD_OutputCircuit_Default ,
214 #undef _________________________________________TYPES_SECTION______________________________________________________________________________ 221 #define _________________________________________PROTOTYPES_SECTION_________________________________________________________________________ 228 extern oC_ErrorCode_t oC_GPIO_Ioctl ( oC_GPIO_Context_t Context , oC_Ioctl_Command_t Command ,
void * Data );
229 extern oC_ErrorCode_t oC_GPIO_QuickOutput ( oC_Pins_t Pins );
230 extern oC_ErrorCode_t oC_GPIO_QuickInput ( oC_Pins_t Pins ,
oC_GPIO_Pull_t Pull );
231 extern oC_ErrorCode_t oC_GPIO_QuickUnconfigure ( oC_Pins_t Pins );
247 extern const char * oC_GPIO_GetModeNameFromEnum (
oC_GPIO_Mode_t Mode);
249 extern const char * oC_GPIO_GetPullNameFromEnum (
oC_GPIO_Pull_t Pull);
250 extern const char * oC_GPIO_GetSpeedNameFromEnum (
oC_GPIO_Speed_t Speed);
541 extern oC_ErrorCode_t
oC_GPIO_ReadData( oC_Pins_t Pins , oC_PinsMask_t * outData );
729 #undef _________________________________________PROTOTYPES_SECTION_________________________________________________________________________
oC_GPIO_Mode_t
select In/Out mode
oC_GPIO_Protection_t
unlocking special pins
bool oC_GPIO_IsSinglePin(oC_Pins_t Pins)
checks if there is only one pin in pins variable
void oC_GPIO_SetPinsState(oC_Pins_t Pins, oC_GPIO_PinsState_t PinsState)
sets pins to the selected state
oC_ErrorCode_t oC_GPIO_SetOutputCircuit(oC_Pins_t Pins, oC_GPIO_OutputCircuit_t OutputCircuit)
configures output circuit
oC_ErrorCode_t oC_GPIO_SetPull(oC_Pins_t Pins, oC_GPIO_Pull_t Pull)
configures pull for pin(s)
oC_PortIndex_t oC_GPIO_PortToPortIndex(oC_Port_t Port)
converts port to port index
oC_Pins_t * oC_GPIO_Context_t
The GPIO context structure.
all pins are set to low state
oC_ErrorCode_t oC_GPIO_ReadData(oC_Pins_t Pins, oC_PinsMask_t *outData)
reads data from port
bool oC_GPIO_IsPinsState(oC_Pins_t Pins, oC_GPIO_PinsState_t ExpectedPinsState)
checks if all pins are set to state
bool oC_GPIO_ArePinsCorrect(oC_Pins_t Pins)
checks if pins are correct
oC_ErrorCode_t oC_GPIO_ReadMode(oC_Pins_t Pins, oC_GPIO_Mode_t *outMode)
reads mode configuration
oC_ErrorCode_t oC_GPIO_CheckIsPinUsed(oC_Pins_t Pins, bool *outPinUsed)
checks if the pin is used
oC_Pins_t oC_GPIO_GetPinsFor(oC_Port_t Port, oC_PinsMask_t Pins)
connect port and pins to one variable
oC_ErrorCode_t oC_GPIO_ReadCurrent(oC_Pins_t Pins, oC_GPIO_Current_t *outCurrent)
reads configured current
The file with LLD interface for the GPIO driver.
oC_ErrorCode_t oC_GPIO_WriteData(oC_Pins_t Pins, oC_PinsMask_t Data)
write data in port
GPIO driver configuration structure.
oC_ErrorCode_t oC_GPIO_TurnOn(void)
turns on the module
oC_ErrorCode_t oC_GPIO_ReadPower(oC_Pins_t Pins, oC_Power_t *outPower)
reads power state in a port
bool oC_GPIO_IsTurnedOn(void)
checks if the driver is turned on
oC_GPIO_Current_t Current
oC_ErrorCode_t oC_GPIO_WaitForPins(oC_Pins_t Pins, oC_Time_t Timeout)
waits for interrupt in the pins
oC_GPIO_PinsState_t
type for storing state of pins
oC_ErrorCode_t oC_GPIO_ArePinsUnused(oC_Pins_t Pins, bool *outPinsUnused)
checks if all of pins are not used
The file with interface for driver creating.
oC_ErrorCode_t oC_GPIO_SetSpeed(oC_Pins_t Pins, oC_GPIO_Speed_t Speed)
configures speed of pin(s)
oC_Pins_t oC_GPIO_GetLowStatePins(oC_Pins_t Pins)
returns pins that are set to low state
oC_ErrorCode_t oC_GPIO_IsPortCorrect(oC_Port_t Port)
checks if the GPIO port is correct
oC_ErrorCode_t oC_GPIO_SetInterruptTrigger(oC_Pins_t Pins, oC_GPIO_IntTrigger_t InterruptTrigger)
configures interrupt for pin(s)
oC_GPIO_Speed_t
speed of pins
oC_GPIO_IntTrigger_t
interrupt trigger source
oC_GPIO_Ioctl_Command_t
ioctl commands for GPIO
const char * oC_GPIO_GetPortName(oC_Port_t Port)
returns name of the port
oC_ErrorCode_t oC_GPIO_ReadPull(oC_Pins_t Pins, oC_GPIO_Pull_t *outPull)
reads pull configuration
oC_ErrorCode_t oC_GPIO_Unconfigure(const oC_GPIO_Config_t *Config, oC_GPIO_Context_t *outContext)
Restores default state on pins.
oC_ErrorCode_t oC_GPIO_ReadInterruptTrigger(oC_Pins_t Pins, oC_GPIO_IntTrigger_t *outInterruptTrigger)
reads interrupt trigger
oC_ErrorCode_t oC_GPIO_SetMode(oC_Pins_t Pins, oC_GPIO_Mode_t Mode)
configures mode of pin(s)
bool oC_GPIO_IsPinDefined(oC_Pins_t Pin)
checks if the pin is defined (only one pin)
oC_ErrorCode_t oC_GPIO_SetCurrent(oC_Pins_t Pins, oC_GPIO_Current_t Current)
configures current of pin(s)
void oC_GPIO_TogglePinsState(oC_Pins_t Pins)
toggles pins state
oC_GPIO_OutputCircuit_t OutputCircuit
oC_ErrorCode_t oC_GPIO_ReadDataReference(oC_Pins_t Pins, oC_UInt_t **outDataReference)
reads reference to the GPIO data
all pins are set to high state
oC_ErrorCode_t oC_GPIO_TurnOff(void)
Turns off the GPIO driver.
oC_Pins_t oC_GPIO_GetHighStatePins(oC_Pins_t Pins)
returns pins that are set to high state
oC_GPIO_Current_t
output current
oC_GPIO_Protection_t Protection
oC_PinsMask_t oC_GPIO_GetPinsMaskOfPins(oC_Pins_t Pins)
returns pins mask of pins
bool oC_GPIO_ArePinsDefined(oC_Pins_t Pins)
checks if pins are defined
oC_Port_t oC_GPIO_PortIndexToPort(oC_PortIndex_t PortIndex)
converts port index to port
oC_GPIO_OutputCircuit_t
output circuit - open drain/push pull
oC_ErrorCode_t oC_GPIO_Configure(const oC_GPIO_Config_t *Config, oC_GPIO_Context_t *outContext)
configures GPIO pins to work
oC_ErrorCode_t oC_GPIO_FindPinByName(const char *Name, oC_Pin_t *outPin)
searching pin by its name
const char * oC_GPIO_GetPinName(oC_Pin_t Pin)
returns name of the pin
oC_ErrorCode_t oC_GPIO_ReadSpeed(oC_Pins_t Pins, oC_GPIO_Speed_t *outSpeed)
reads configured speed
oC_ErrorCode_t oC_GPIO_SetPower(oC_Pins_t Pins, oC_Power_t Power)
sets power for a port
oC_GPIO_Pull_t
pull-up/pull-down in input mode
oC_Port_t oC_GPIO_GetPortOfPins(oC_Pins_t Pins)
returns port of pins
oC_ErrorCode_t oC_GPIO_IsPortIndexCorrect(oC_PortIndex_t PortIndex)
checks if the GPIO port index is correct
oC_Power_t
stores registers power state
oC_ErrorCode_t oC_GPIO_ReadOutputCircuit(oC_Pins_t Pins, oC_GPIO_OutputCircuit_t *outOutputCircuit)
reads output circuit configuration
#define NULL
pointer to a zero
oC_GPIO_IntTrigger_t InterruptTrigger