Typedefs | |
typedef uint8_t | BusData_t |
Bus data type. | |
Functions | |
int | IO_Open (int Vendor, int Product, int HardIfaces) |
Opens and initilizes the hardware interface. | |
int | IO_Close (void) |
Close and release the hardware interface. | |
int | IO_SetBaudRate (int Baud) |
Change the hardware baudrate. | |
BusData_t | IO_DirMaskRead (void) |
Reads back the full port direction register. | |
int | IO_DirMaskWrite (BusData_t DirMask) |
Sets the full port direction register. | |
BusData_t | IO_DirMaskBitRead (uint16_t Bit) |
Reads back a single bit of direction register. | |
int | IO_DirMaskBitWrite (uint16_t Bit, BusData_t Dir) |
Writes a single bit of direction register. | |
BusData_t | IO_OutDataRead (void) |
Reads back the output data register. | |
BusData_t | IO_InDataRead (void) |
Reads the input data register. | |
void | IO_OutDataWrite (BusData_t Data) |
Writes a new value to the output data register. | |
BusData_t | IO_BitRead (uint16_t Bit) |
Reads a single input bit value. | |
void | IO_BitWrite (uint16_t Bit, BusData_t Value) |
Writes a single output bit value. |
typedef uint8_t BusData_t |
Bus data type.
Hardware bus is represented by 8 data lines; each line can be configured as input or output indipendently from the others. We need a data type to represent the full bus at once.
BusData_t IO_BitRead | ( | uint16_t | Bit | ) |
Reads a single input bit value.
Bit | Bit number. |
Bit
is configured as input; returns the last set bit value if Bit
is configured as output (i.e. the last value written with IO_BitWrite()).
void IO_BitWrite | ( | uint16_t | Bit, | |
BusData_t | Value | |||
) |
Writes a single output bit value.
Bit | Bit number (starting from 0). | |
Value | new bit value. |
int IO_Close | ( | void | ) |
Close and release the hardware interface.
BusData_t IO_DirMaskBitRead | ( | uint16_t | Bit | ) |
Reads back a single bit of direction register.
Bit | Bit number (starting from 0). |
int IO_DirMaskBitWrite | ( | uint16_t | Bit, | |
BusData_t | Dir | |||
) |
Writes a single bit of direction register.
Bit | Bit number (starting from 0). | |
Dir | New bit direction (0 or 1). |
BusData_t IO_DirMaskRead | ( | void | ) |
Reads back the full port direction register.
int IO_DirMaskWrite | ( | BusData_t | DirMask | ) |
Sets the full port direction register.
DirMask | new direction mask. |
BusData_t IO_InDataRead | ( | void | ) |
Reads the input data register.
int IO_Open | ( | int | Vendor, | |
int | Product, | |||
int | HardIfaces | |||
) |
Opens and initilizes the hardware interface.
Vendor | vendor ID. | |
Product | product ID. | |
HardIfaces | ignored. |
BusData_t IO_OutDataRead | ( | void | ) |
Reads back the output data register.
void IO_OutDataWrite | ( | BusData_t | Data | ) |
Writes a new value to the output data register.
Data | New register value. |
int IO_SetBaudRate | ( | int | Baud | ) |
Change the hardware baudrate.
Baud | the new baudrate. |