CMSIS-Driver Validation  
Driver Validation

Functions

void GPIO_Setup (void)
 Function: GPIO_Setup. More...
 
void GPIO_SetDirection (void)
 Function: GPIO_SetDirection. More...
 
void GPIO_SetOutputMode (void)
 Function: GPIO_SetOutputMode. More...
 
void GPIO_SetPullResistor (void)
 Function: GPIO_SetPullResistor. More...
 
void GPIO_SetEventTrigger (void)
 Function: GPIO_SetEventTrigger. More...
 
void GPIO_SetOutput (void)
 Function: GPIO_SetOutput. More...
 
void GPIO_GetInput (void)
 Function: GPIO_GetInput. More...
 

Description

Function Documentation

◆ GPIO_Setup()

void GPIO_Setup ( void  )

The function GPIO_Setup verifies the Setup function.

int32_t Setup (ARM_GPIO_Pin_t pin, ARM_GPIO_SignalEvent_t cb_event);

Testing sequence:

  • Call Setup function (without callback specified) and assert that it returned ARM_DRIVER_OK status
  • Call Setup function (with callback specified) and assert that it returned ARM_DRIVER_OK status

◆ GPIO_SetDirection()

void GPIO_SetDirection ( void  )

The function GPIO_SetDirection verifies the SetDirection function.

int32_t ARM_GPIO_SetDirection (ARM_GPIO_Pin_t pin, ARM_GPIO_DIRECTION direction);

Testing sequence:

  • Call SetDirection function (with Input direction) and assert that it returned ARM_DRIVER_OK status
  • Configure Auxiliary Pin as Output
  • Drive Auxiliary Pin low
  • Read Pin Under Test input level and assert that it returned 0
  • Drive Auxiliary Pin high
  • Read Pin Under Test input level and assert that it returned 1
  • Configure Auxiliary Pin as Input
  • Call SetDirection function (with Output direction) and assert that it returned ARM_DRIVER_OK status
  • Call SetOutput function and set output level low
  • Read Auxiliary Pin input level and assert that it returned 0
  • Call SetOutput function and set output level high
  • Read Auxiliary Pin input level and assert that it returned 1

◆ GPIO_SetOutputMode()

void GPIO_SetOutputMode ( void  )

The function GPIO_SetOutputMode verifies the SetOutputMode function.

int32_t ARM_GPIO_SetOutputMode (ARM_GPIO_Pin_t pin, ARM_GPIO_OUTPUT_MODE mode);

Testing sequence:

  • Call SetDirection function (with Output direction) and assert that it returned ARM_DRIVER_OK status
  • Call SetOutputMode function (with Push-pull mode) and assert that it returned ARM_DRIVER_OK status
  • Configure Auxiliary Pin as Input
  • Call SetOutput function and set output level low
  • Read Auxiliary Pin input level and assert that it returned 0
  • Call SetOutput function and set output level high
  • Read Auxiliary Pin input level and assert that it returned 1
  • Call SetOutputMode function (with Open-drain mode) and assert that it returned ARM_DRIVER_OK status
  • Call SetOutput function and set output level low
  • Read Auxiliary Pin input level and assert that it returned 0

◆ GPIO_SetPullResistor()

void GPIO_SetPullResistor ( void  )

The function GPIO_SetPullResistor verifies the SetPullResistor function.

int32_t ARM_GPIO_SetPullResistor (ARM_GPIO_Pin_t pin, ARM_GPIO_PULL_RESISTOR resistor);

Testing sequence:

  • Call SetDirection function (with Input direction) and assert that it returned ARM_DRIVER_OK status
  • Call SetPullResistor function (without resistor) and assert that it returned ARM_DRIVER_OK status
  • Configure Auxiliary Pin as Output
  • Drive Auxiliary Pin low
  • Read Pin Under Test input level and assert that it returned 0
  • Drive Auxiliary Pin high
  • Read Pin Under Test input level and assert that it returned 1
  • Configure Auxiliary Pin as Input
  • Call SetPullResistor function (with Pull-down resistor) and assert that it returned ARM_DRIVER_OK status
  • Read Pin Under Test input level and assert that it returned 0
  • Configure Auxiliary Pin as Output
  • Drive Auxiliary Pin high
  • Read Pin Under Test input level and assert that it returned 1
  • Configure Auxiliary Pin as Input
  • Call SetPullResistor function (with Pull-up resistor) and assert that it returned ARM_DRIVER_OK status
  • Read Pin Under Test input level and assert that it returned 1
  • Configure Auxiliary Pin as Output
  • Drive Auxiliary Pin low
  • Read Pin Under Test input level and assert that it returned 0

◆ GPIO_SetEventTrigger()

void GPIO_SetEventTrigger ( void  )

The function GPIO_SetEventTrigger verifies the SetEventTrigger function.

int32_t ARM_GPIO_SetEventTrigger (ARM_GPIO_Pin_t pin, ARM_GPIO_EVENT_TRIGGER trigger);

Testing sequence:

  • Call Setup function (with callback specified) and assert that it returned ARM_DRIVER_OK status
  • Configure Auxiliary Pin as Output
  • Drive Auxiliary Pin low
  • Call SetEventTrigger function (configure trigger on Rising-edge) and assert that it returned ARM_DRIVER_OK status
  • Drive Auxiliary Pin high thus generate Rising-edge
  • Assert that event ARM_GPIO_EVENT_RISING_EDGE was signaled
  • Assert that event was signaled on Pin Under Test pin
  • Assert that only 1 event was signaled
  • Drive Auxiliary Pin low thus generate Falling-edge
  • Assert that event was not signaled
  • Drive Auxiliary Pin high
  • Call SetEventTrigger function (configure trigger on Falling-edge) and assert that it returned ARM_DRIVER_OK status
  • Drive Auxiliary Pin low thus generate Falling-edge
  • Assert that event ARM_GPIO_EVENT_FALLING_EDGE was signaled
  • Assert that event was signaled on Pin Under Test pin
  • Assert that only 1 event was signaled
  • Drive Auxiliary Pin high thus generate Rising-edge
  • Assert that event was not signaled
  • Drive Auxiliary Pin low
  • Call SetEventTrigger function (configure trigger on Either-edge) and assert that it returned ARM_DRIVER_OK status
  • Drive Auxiliary Pin high thus generate Rising-edge
  • Assert that event ARM_GPIO_EVENT_RISING_EDGE or ARM_GPIO_EVENT_EITHER_EDGE was signaled
  • Assert that event was signaled on Pin Under Test pin
  • Assert that only 1 event was signaled
  • Drive Auxiliary Pin low thus generate Falling-edge
  • Assert that event ARM_GPIO_EVENT_FALLING_EDGE or ARM_GPIO_EVENT_EITHER_EDGE was signaled
  • Assert that event was signaled on Pin Under Test pin
  • Assert that only 1 event was signaled
  • Drive Auxiliary Pin low
  • Call SetEventTrigger function (disable trigger) and assert that it returned ARM_DRIVER_OK status
  • Drive Auxiliary Pin high thus generate Rising-edge
  • Drive Auxiliary Pin low thus generate Falling-edge
  • Assert that event was not signaled

◆ GPIO_SetOutput()

void GPIO_SetOutput ( void  )

The function GPIO_SetOutput verifies the SetOutput function.

Testing sequence:

  • Call SetDirection function (with Output direction) and assert that it returned ARM_DRIVER_OK status
  • Call SetOutputMode function (with Push-pull mode) and assert that it returned ARM_DRIVER_OK status
  • Configure Auxiliary Pin as Input
  • Call SetOutput function and set output level low
  • Read Auxiliary Pin input level and assert that it returned 0
  • Call SetOutput function and set output level high
  • Read Auxiliary Pin input level and assert that it returned 1

◆ GPIO_GetInput()

void GPIO_GetInput ( void  )

The function GPIO_GetInput verifies the GetInput function.

Testing sequence:

  • Call SetDirection function (with Input direction) and assert that it returned ARM_DRIVER_OK status
  • Configure Auxiliary Pin as Output
  • Drive Auxiliary Pin low
  • Read Pin Under Test input level and assert that it returned 0
  • Drive Auxiliary Pin high
  • Read Pin Under Test input level and assert that it returned 1