Data Structures | |
class | GPIOMtb |
class | SPICMtb |
Mtb SPIC class. More... | |
class | TimerMtb |
class GPIOMtb |
Public Types | |
enum | Error_t { OK = 0 , INTF_ERROR = -1 , CONF_ERROR = -2 , READ_ERROR = -3 , WRITE_ERROR = -4 } |
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 | |
GPIOMtb () | |
GPIO MTB default constructor. More... | |
GPIOMtb (mtb_gpio_t pin, mtb_gpio_config_t config, VLogic_t logic) | |
GPIO MTB default constructor. More... | |
~GPIOMtb () | |
GPIO MTB destructor. More... | |
Error_t | init () |
Initializes the MTB GPIO. More... | |
Error_t | deinit () |
Initializes the MTB GPIO. More... | |
VLevel_t | read () |
Reads the MTB GPIO voltage level. More... | |
Error_t | write (VLevel_t level) |
Writes the MTB GPIO output voltage level. More... | |
Error_t | enable () |
Enables the MTB output according to the GPIO logic. More... | |
Error_t | disable () |
Disables the MTB output according to the GPIO logic. More... | |
virtual Error_t | changeMode (uint8_t mode)=0 |
Changes the IN/OUT mode. More... | |
Error_t | checkErrorStatus () |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
GPIOMtb::GPIOMtb | ( | ) |
GPIO MTB default constructor.
GPIOMtb::GPIOMtb | ( | mtb_gpio_t | pin, |
mtb_gpio_config_t | config, | ||
VLogic_t | logic | ||
) |
GPIO MTB default constructor.
GPIOMtb::~GPIOMtb | ( | ) |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
pure virtualinherited |
|
inherited |
class SPICMtb |
Mtb SPIC class.
Public Types | |
enum | Error_t { OK = 0 , INTF_ERROR = -1 , CONF_ERROR = -2 , READ_ERROR = -3 , WRITE_ERROR = -4 } |
Public Member Functions | |
SPICMtb () | |
Constructor of the MTB SPIC class. More... | |
SPICMtb (mtb_spi_t port, mtb_gpio_t csPin) | |
Construct a new SPICMtb::SPICMtb object. More... | |
SPICMtb (mtb_spi_t port, mtb_gpio_t csPin, uint8_t speed, uint8_t mode, uint8_t bits) | |
Construct a new SPICMtb::SPICMtb object. More... | |
~SPICMtb () | |
Destructor of the MTB SPIC class. More... | |
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 More... | |
virtual Error_t | triggerUpdate ()=0 |
Sends a trigger through out the SPI bus. More... | |
virtual Error_t | sendReceive (uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)=0 |
Function which allows 3wire SPI (SSC) by sending and receiving data in the same function. More... | |
Error_t | checkErrorStatus () |
|
inherited |
SPICMtb::SPICMtb | ( | ) |
SPICMtb::SPICMtb | ( | mtb_spi_t | port, |
mtb_gpio_t | csPin | ||
) |
Construct a new SPICMtb::SPICMtb object.
This function is setting the basics for a SPIC. It allows to set the SPI channel and the used GPIOs if they are different from the standard GPIOs.
port | SPI channel to be used |
csPin | Number of the desired ChipSelect pin |
SPICMtb::SPICMtb | ( | mtb_spi_t | port, |
mtb_gpio_t | csPin, | ||
uint8_t | speed, | ||
uint8_t | mode, | ||
uint8_t | bits | ||
) |
Construct a new SPICMtb::SPICMtb object.
This function allows to set all parameters of the SPI master.
port | SPI channel to be used |
csPin | Number of the desired ChipSelect pin |
speed | SPI baud setting |
mode | SPI mode setting |
bits | number of bits in one command |
SPICMtb::~SPICMtb | ( | ) |
|
virtual |
Initialize the SPIC.
This function is initializing the chosen spi channel with the given values for lsb,clock and mode
Implements SPIC.
|
virtual |
Deinitialize the SPIC.
This function is deinitializing the chosen spi channel.
Implements SPIC.
SPICMtb::Error_t SPICMtb::transfer | ( | uint8_t | send, |
uint8_t & | received | ||
) |
transfers a data package via the spi bus
send | address and/or command to send |
received | received data from spi bus |
SPICMtb::Error_t SPICMtb::transfer16 | ( | uint16_t | send, |
uint16_t & | received | ||
) |
transfers a data package via the spi bus
send | address and/or command to send as 16bit |
received | received data from spi bus as 16bit |
|
pure virtualinherited |
|
pure virtualinherited |
Function which allows 3wire SPI (SSC) by sending and receiving data in the same function.
sent_data | pointer two 2*unit16_t value for one command word and one data word if something should be written |
size_of_sent_data | the size of the command word default 1 = only command 2 = command and data word |
received_data | pointer to data structure buffer for the read data |
size_of_received_data | size of data words to be read |
OK | if success |
INIT_ERROR | if transfer fails |
|
inherited |
class TimerMtb |
Public Types | |
enum | Error_t { OK = 0 , ERROR = 1 } |
Public Member Functions | |
TimerMtb () | |
Constructor of the MTB Timer class. More... | |
~TimerMtb () | |
Destructor of the MTB 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 (mtb_time_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... | |
virtual Error_t | elapsed (uint32_t &elapsed)=0 |
Elapsed time since the timer was started. More... | |
|
inherited |
TimerMtb::TimerMtb | ( | ) |
Constructor of the MTB Timer class.
TimerMtb::~TimerMtb | ( | ) |
Destructor of the MTB Timer class.
|
virtual |
Initialization of the Timer.
This function is initializing the Timer and sets the elapsed time to zero.
Implements Timer.
|
virtual |
Deinitialize the Timer.
This function deinitialize the Timer and also resets the elapsed time variable.
Implements Timer.
|
virtual |
TimerMtb::Error_t TimerMtb::elapsed | ( | mtb_time_t & | elapsed | ) |
Calculate the elapsed time.
This function is calculating 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 |
|
virtual |
Stop the timer.
This function stops the timer and resets the start time variable.
Implements Timer.
|
virtual |
Time delay.
This function is causing a desired delay of the application. The input value is given in milliseconds.
[in] | timeout | Desired timeout in ms |
Implements Timer.
|
virtual |
Time delay.
This function is causing a desired delay of the application. The input value is given in microseconds.
[in] | timeout | Desired timeout in us |
Implements Timer.