software_APIs  1.0.0
Enumerations | Functions
gpios.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  gpio_mode
 

Functions

void GPIOs_configureAll (enum gpio_mode config)
 
void GPIOs_loadConfigs ()
 
void GPIOs_configure (int gpio_num, enum gpio_mode config)
 
void GPIOs_writeLow (unsigned int data)
 
void GPIOs_writeHigh (unsigned int data)
 
void GPIOs_writeLowHigh (long data)
 
unsigned int GPIOs_readHigh ()
 
unsigned int GPIOs_readLow ()
 
void GPIOs_waitLow (unsigned int data)
 
void GPIOs_waitHigh (unsigned int data)
 
void GPIOs_waitLowWithMask (unsigned int data, unsigned int mask)
 
void GPIOs_waitHighWithMask (unsigned int data, unsigned int mask)
 

Enumeration Type Documentation

◆ gpio_mode

enum gpio_mode

GPIOs possible modes

Enumerator gpio_mode
namedescription
GPIO_MODE_MGMT_STD_INPUT_NOPULLManagement input with no pull (floating is read as Z)
GPIO_MODE_MGMT_STD_INPUT_PULLDOWNManagement input pull-down (floating is read as 0)
GPIO_MODE_MGMT_STD_INPUT_PULLUPManagement input pull-up (floating is read as 1)
GPIO_MODE_MGMT_STD_OUTPUTManagement output
GPIO_MODE_MGMT_STD_BIDIRECTIONALManagement bi-direction
GPIO_MODE_MGMT_STD_ANALOGManagement Analog
GPIO_MODE_USER_STD_INPUT_NOPULLUser input with no pull (floating is read as Z)
GPIO_MODE_USER_STD_INPUT_PULLDOWNUser input pull-down (floating is read as 0)
GPIO_MODE_USER_STD_INPUT_PULLUPUser input pull-up (floating is read as 1)
GPIO_MODE_USER_STD_OUTPUTUser output
GPIO_MODE_USER_STD_BIDIRECTIONALUser bi-direction
GPIO_MODE_USER_STD_OUT_MONITOREDUser Monitor same as output
GPIO_MODE_USER_STD_ANALOGUser Analog

Function Documentation

◆ GPIOs_configure()

void GPIOs_configure ( int  gpio_num,
enum gpio_mode  config 
)

Configure one GPIO with the input config

Parameters
configis configuration of type gpio_mode
gpio_numis GPIO number it can have values from 0 to 37
Note
These configurations will not be change the GPIOs modes until calling GPIOs_loadConfigs()

◆ GPIOs_configureAll()

void GPIOs_configureAll ( enum gpio_mode  config)

Configure all GPIOs with the config

Parameters
configis configuration of type gpio_mode
Note
These configurations will not be change the GPIOs modes until calling GPIOs_loadConfigs()

◆ GPIOs_loadConfigs()

void GPIOs_loadConfigs ( )

Load the configurations changes to the GPIOs

◆ GPIOs_readHigh()

unsigned int GPIOs_readHigh ( )

Read the highest 6 GPIOs GPIOS[37:32]

Note
For Reading value from the GPIOs, the GPIO should be configured as management input. otherwise 0 would be read

◆ GPIOs_readLow()

unsigned int GPIOs_readLow ( )

Read low 32 GPIOs GPIOS[31:0]

Note
For Reading value from the GPIOs, the GPIO should be configured as management input. otherwise 0 would be read

◆ GPIOs_waitHigh()

void GPIOs_waitHigh ( unsigned int  data)

wait over the highest 6 GPIOs to equal the data passed

Note
For writing by this function to be seen at the GPIO the GPIO has to be configured as management output
Parameters
datais the data that should wait until sent to the GPIOs

Examples:

  • GPIOs_waitHigh(0x1); // function would return only when GPIO [32]==1 and rest of 5 GPIOs = 0
  • GPIOs_waitHigh(0x5); // function would return only when GPIO [32]==1 and GPIO [34]==1 and rest of 4 GPIOs = 0

◆ GPIOs_waitHighWithMask()

void GPIOs_waitHighWithMask ( unsigned int  data,
unsigned int  mask 
)

wait over the masked highest 6 GPIOs to equal the data passed

Note
For writing by this function to be seen at the GPIO the GPIO has to be configured as management output
Parameters
datais the data that should wait until sent to the GPIOs
maskmask over the each GPIO if the mask value is 0 the this GPIO value are ignored

Examples:

  • GPIOs_waitHighWithMask(0x1,0xF); // function would return only when GPIO [32]==1 and GPIO [35:33]==0 and don't care about the rest of GPIOs
  • GPIOs_waitHighWithMask(0x5,0x7); // function would return only when GPIO [32]==1 and GPIO [34]==1 and GPIO [33]==0 and don't care about the rest of GPIOs

◆ GPIOs_waitLow()

void GPIOs_waitLow ( unsigned int  data)

wait over the lowest 32 GPIOsto equal the data passed

Note
For writing by this function to be seen at the GPIO the GPIO has to be configured as management output
Parameters
datais the data that should wait until sent to the GPIOs

Examples:

  • GPIOs_waitLow(0x1); // function would return only when GPIO [0]==1 and rest of 31 GPIOs= 0
  • GPIOs_waitLow(0x5); // function would return only when GPIO [0]==1 and GPIO [3]==1 and rest of 30 GPIOs = 0

◆ GPIOs_waitLowWithMask()

void GPIOs_waitLowWithMask ( unsigned int  data,
unsigned int  mask 
)

wait over the masked lowest 32 GPIOs to equal the data passed

Note
For writing by this function to be seen at the GPIO the GPIO has to be configured as management output
Parameters
datais the data that should wait until sent to the GPIOs
maskmask over the each GPIO if the mask value is 0 the this GPIO value are ignored

Examples:

  • GPIOs_waitLowWithMask(0x1,0xF); // function would return only when GPIO [0]==1 and GPIO [3:1]==0 and don't care about the rest of GPIOs
  • GPIOs_waitLowWithMask(0x5,0x7); // function would return only when GPIO [0]==1 and GPIO [3]==1 and GPIO [2]==0 and don't care about the rest of GPIOs

◆ GPIOs_writeHigh()

void GPIOs_writeHigh ( unsigned int  data)

Write to the highest 6 GPIOs GPIOS[37:32]

Note
For writing by this function to be seen at the GPIO the GPIO has to be configured as management output
Parameters
datais the data sent to the GPIOs

Examples:

  • GPIOs_writeHigh(0x1); // write 1 to GPIO [32] and write 0 in the remaining 5 GPIOs
  • GPIOs_writeHigh(0x5); // write 1 to GPIO [32] and 34 and write 0 in the remaining 4 GPIOs

◆ GPIOs_writeLow()

void GPIOs_writeLow ( unsigned int  data)

Write to the low 32 GPIOs GPIOS[31:0]

Note
For writing by this function to be seen at the GPIO the GPIO has to be configured as management output
Parameters
datais the data sent to the GPIOs

Examples:

  • GPIOs_writeLow(0x1); // write 1 to GPIO [0] and write 0 in the remaining 31 GPIOs
  • GPIOs_writeLow(0x5); // write 1 to GPIO [0] and GPIO [3] and write 0 in the remaining 30 GPIOs

◆ GPIOs_writeLowHigh()

void GPIOs_writeLowHigh ( long  data)

Write to the 38 GPIOs GPIOS[37:0]

Note
For writing by this function to be seen at the GPIO the GPIO has to be configured as management output
Parameters
datais the data sent to the GPIOs

Examples:

  • GPIOs_writeLowHigh(0x1); // write 1 to GPIO [0] and write 0 in the remaining 37 GPIOs
  • GPIOs_writeLowHigh(0x5); // write 1 to GPIO [0] and GPIO [3] and write 0 in the remaining 36 GPIOs
  • GPIOs_writeLowHigh(0x100000000); // write 1 to GPIO [32] and write 0 in the remaining 36 GPIOs
Todo:
verify this function