ODeV framework  v2
Data Structures | Typedefs | Functions
NucleoDriver.h File Reference

<DESCRIPTIOM> More...

#include "IDriver.h"
#include "IDriverVtbl.h"
#include "FreeRTOS.h"
#include "semphr.h"
+ Include dependency graph for NucleoDriver.h:

Go to the source code of this file.

Data Structures

struct  _NucleoDriver
 
struct  _NucleoDriverParams
 

Typedefs

typedef struct _NucleoDriver NucleoDriver
 
typedef struct _NucleoDriverParams NucleoDriverParams
 

Functions

IDriverNucleoDriverAlloc ()
 
sys_error_code_t NucleoDriverSetLed (NucleoDriver *this, boolean_t bON)
 
sys_error_code_t NucleoDriverToggleLed (NucleoDriver *this)
 
boolean_t NucleoDriverIsButtonPressed (NucleoDriver *this)
 
sys_error_code_t NucleoDriverWaitForButtonEvent (NucleoDriver *this, boolean_t *pbButtonPressed)
 

Detailed Description

<DESCRIPTIOM>

Author
STMicroelectronics - ST-Korea - MCD Team
Version
1.0.0
Date
Nov 2, 2018
Attention

© COPYRIGHT 2018 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ NucleoDriver

typedef struct _NucleoDriver NucleoDriver

Create type name for _NucleoDriver.

◆ NucleoDriverParams

Initialization parameters for the driver.

Function Documentation

◆ NucleoDriverAlloc()

IDriver* NucleoDriverAlloc ( )

Allocate an instance of NucleoDriver. The driver is allocated in the FreeRTOS heap.

Returns
a pointer to the generic interface IDriver if success, or SYS_OUT_OF_MEMORY_ERROR_CODE otherwise.

◆ NucleoDriverIsButtonPressed()

SYS_DEFINE_INLINE boolean_t NucleoDriverIsButtonPressed ( NucleoDriver this)
inline

Get the status of the push button.

Parameters
this[IN] specifies a pointer to a driver object.
Returns
TRUE if the push button is pressed, FALSE otherwise

◆ NucleoDriverSetLed()

SYS_DEFINE_INLINE sys_error_code_t NucleoDriverSetLed ( NucleoDriver this,
boolean_t  bON 
)
inline

Turn the LED ON or OFF

Parameters
this[IN] specifies a pointer to a driver object.
bON[IN] specifies the status of the LED. TRUE to turn the LED ON, FALSE otherwise.
Returns
SYS_NO_ERROR_CODE

◆ NucleoDriverToggleLed()

SYS_DEFINE_INLINE sys_error_code_t NucleoDriverToggleLed ( NucleoDriver this)
inline

Toggle the LED.

Parameters
this[IN] specifies a pointer to a driver object.
Returns
SYS_NO_ERROR_CODE

◆ NucleoDriverWaitForButtonEvent()

sys_error_code_t NucleoDriverWaitForButtonEvent ( NucleoDriver this,
boolean_t *  pbButtonPressed 
)

Block the calling task until the push button is pressed or released.

Parameters
this[IN] specifies a pointer to a driver object.
pbButtonPressed[OUT] specify the status of the push button.
Returns
SYS_NO_ERROR_CODE if success, an error code otherwise.