Data Structures | |
class | GPIORpi |
Raspberry Pi GPIO class. More... | |
class | SPICRpi |
Raspberry Pi SPIC class. More... | |
class | TimerRpi |
class GPIORpi |
Raspberry Pi GPIO class.
Public Types | |
Interrupt event | |
enum | IntEvent_t { INT_FALLING_EDGE = 0 , INT_RISING_EDGE = 1 } |
Voltage level | |
enum | VLevel_t { GPIO_LOW = 0 , GPIO_HIGH = 1 } |
Voltage logic | |
enum | VLogic_t { NEGATIVE = 1 , POSITIVE = 2 } |
Public Member Functions | |
GPIORpi () | |
Constructor of the Raspberry Pi GPIO class. More... | |
GPIORpi (uint8_t pin, uint8_t mode, VLogic_t logic) | |
Constructor of the Raspberry Pi GPIO class. More... | |
~GPIORpi () | |
Error_t | init () |
Initialize the GPIO. More... | |
Error_t | deinit () |
Deinitialize the GPIO. More... | |
VLevel_t | read () |
Read GPIO logic level. More... | |
Error_t | write (VLevel_t level) |
Set GPIO logic level. More... | |
Error_t | enable () |
Enable the GPIO. More... | |
Error_t | disable () |
Disable the GPIO. More... | |
Error_t | checkErrorStatus () |
|
inherited |
|
inherited |
|
inherited |
GPIORpi::GPIORpi | ( | ) |
Constructor of the Raspberry Pi GPIO class.
This function sets the basics for a GPIO.
GPIORpi::GPIORpi | ( | uint8_t | pin, |
uint8_t | mode, | ||
VLogic_t | logic | ||
) |
Constructor of the Raspberry Pi GPIO class.
This function sets the basics for a GPIO. It allows to set the pin number, mode of the pin and the logic level.
[in] | pin | Number of the desired pin |
[in] | mode | Defines the mode of the pin (INPUT, OUTPUT, etc.) |
[in] | logic | Defines the logic level of the pin |
|
inline |
|
virtual |
Initialize the GPIO.
This function initializes the chosen pin.
Implements tle94112::GPIOC.
|
virtual |
Deinitialize the GPIO.
This function deinitializes the chosen pin.
Implements tle94112::GPIOC.
|
virtual |
Read GPIO logic level.
This function reads the logic level of the chosen pin and returns the logic level value.
0 | = GPIO_LOW |
1 | = GPIO_HIGH |
Implements tle94112::GPIOC.
Set GPIO logic level.
This functions sets the logic level of the chosen pin.
[in] | level | Desired logic level of the pin |
Implements tle94112::GPIOC.
|
virtual |
Enable the GPIO.
This function enables the chosen pin. Depending on the chosen logic of the pin it sets the right logic level of the pin.
Implements tle94112::GPIOC.
|
virtual |
Disable the GPIO.
This function disables the chosen pin. Depending on the chosen logic of the pin it sets the right logic level of the pin.
Implements tle94112::GPIOC.
|
inherited |
class SPICRpi |
Raspberry Pi SPIC class.
Public Member Functions | |
SPICRpi () | |
Constructor of the Raspberry Pi SPIC class. More... | |
SPICRpi (uint8_t lsb, uint8_t mode, uint8_t clock) | |
Construct a new SPICRpi::SPICRpi object of the Raspberry Pi SPIC class. More... | |
SPICRpi (uint8_t csPin, uint8_t misoPin, uint8_t mosiPin, uint8_t sckPin) | |
Construct a new SPICRpi::SPICRpi object of the Raspberry Pi SPIC class. More... | |
~SPICRpi () | |
Error_t | init () |
Initialize the SPIC. More... | |
Error_t | deinit () |
Deinitialize the SPIC. More... | |
Error_t | transfer (uint8_t send, uint8_t &received) |
transfers a data package via the spi bus More... | |
Error_t | transfer16 (uint16_t send, uint16_t &received) |
transfers a data package via the spi bus with 16 bit length More... | |
Error_t | checkErrorStatus () |
SPICRpi::SPICRpi | ( | ) |
Constructor of the Raspberry Pi SPIC class.
This function sets the basics for a SPIC and the default SPI.
SPICRpi::SPICRpi | ( | uint8_t | lsb, |
uint8_t | mode, | ||
uint8_t | clock | ||
) |
Construct a new SPICRpi::SPICRpi object of the Raspberry Pi SPIC class.
This function sets some basic SPI modes for the default SPI port.
lsb | lowside (LSB) or highside (MSB) mode |
mode | SPI mode |
clock | SPI clock divider |
SPICRpi::SPICRpi | ( | uint8_t | csPin, |
uint8_t | misoPin, | ||
uint8_t | mosiPin, | ||
uint8_t | sckPin | ||
) |
Construct a new SPICRpi::SPICRpi object of the Raspberry Pi SPIC class.
This function sets all pins for a given SPI port, allowing a free setting of the SPI interface
csPin | chipselect pin for the SPI port |
misoPin | miso pin number |
mosiPin | mosi pin number |
sckPin | systemclock pin number |
|
inline |
|
virtual |
Initialize the SPIC.
This function initializes the chosen spi channel with the given values for lsb,clock and mode
Implements tle94112::SPIC.
|
virtual |
Deinitialize the SPIC.
This function deinitializes the chosen spi channel.
Implements tle94112::SPIC.
|
virtual |
transfers a data package via the spi bus
send | address and/or command to send |
received | received data from spi bus |
Implements tle94112::SPIC.
|
virtual |
transfers a data package via the spi bus with 16 bit length
send | address and/or command to send |
received | received data from spi bus |
Implements tle94112::SPIC.
|
inherited |
class TimerRpi |
Public Member Functions | |
TimerRpi () | |
Constructor of the Raspberry Pi Timer class. More... | |
~TimerRpi () | |
Destructor of the Raspberry Pi Timer class. More... | |
Error_t | init () |
Initialization of the Timer. More... | |
Error_t | deinit () |
Deinitialize the Timer. More... | |
Error_t | start () |
Start the timer. More... | |
Error_t | elapsed (uint32_t &elapsed) |
Calculate the elapsed time. More... | |
Error_t | stop () |
Stop the timer. More... | |
Error_t | delayMilli (uint32_t timeout) |
Time delay. More... | |
Error_t | delayMicro (uint32_t timeout) |
Time delay. More... | |
TimerRpi::TimerRpi | ( | ) |
Constructor of the Raspberry Pi Timer class.
TimerRpi::~TimerRpi | ( | ) |
Destructor of the Raspberry Pi Timer class.
|
virtual |
Initialization of the Timer.
This function initializes the Timer and sets the elapsed time to zero.
Implements tle94112::Timer.
|
virtual |
Deinitialize the Timer.
This function deinitializes the Timer and also resets the elapsed time to variable.
Implements tle94112::Timer.
|
virtual |
Start the timer.
This function starts the timer.
Implements tle94112::Timer.
|
virtual |
Calculate the elapsed time.
This function calculates the elapsed time since the start of the timer. The value stored in the given variable is in milliseconds.
[in] | &elapsed | Address of a value where the elapsed time should be stored |
Implements tle94112::Timer.
|
virtual |
Stop the timer.
This function stops the timer and resets the start time variable.
Implements tle94112::Timer.
|
virtual |
Time delay.
This function causes a desired delay of the application. The input value is given in milliseconds.
[in] | timeout | Desired timeout in ms |
Implements tle94112::Timer.
|
virtual |
Time delay.
This function causes a desired delay of the application. The input value is given in microseconds.
[in] | timeout | Desired timeout in us |
Implements tle94112::Timer.