# BLM_CHEAPO

## Defines
#define | NUM_ROWS 8
## Functions
s32 | BLM_CHEAPO_Init (u32 mode)
s32 | BLM_CHEAPO_PrepareCol (void)
s32 | BLM_CHEAPO_GetRow (void)
s32 | BLM_CHEAPO_ButtonHandler (void *_notify_hook)
s32 | BLM_CHEAPO_DebounceSet (u8 delay)
s32 | BLM_CHEAPO_DebounceGet (void)
s32 | BLM_CHEAPO_DOUT_PinSet (u32 pin, u32 value)
s32 | BLM_CHEAPO_DOUT_PinGet (u32 pin)
s32 | BLM_CHEAPO_DOUT_SRSet (u32 row, u8 value)
u8 | BLM_CHEAPO_DOUT_SRGet (u32 row)

## Detailed Description

BLM_CHEAPO Driver

## Define Documentation

#define NUM_ROWS 8

## Function Documentation

s32 BLM_CHEAPO_ButtonHandler | ( | void * | _notify_hook | ) |

This function should be called from a task to check for button changes periodically. Events (change from 0->1 or from 1->0) will be notified via the given callback function <notify_hook> with following parameters: <notifcation-hook>(s32 pin, s32 value)

Returns:
  < 0 on errors

Here is the call graph for this function:

s32 BLM_CHEAPO_DebounceGet | ( | void |  | ) |

Returns the debounce delay

Returns:
  delay between 0..255 update cycles (usually mS)

s32 BLM_CHEAPO_DebounceSet | ( | u8 | delay | ) |

Sets the debounce delay

Parameters:

  `[in]` | delay | between 0..255 update cycles (usually mS)

Returns:
  < 0 on errors

s32 BLM_CHEAPO_DOUT_PinGet | ( | u32 | pin | ) |

Returns LED status

Parameters:

  `[in]` | pin | the pin number

Returns:
  < 0 if pin not available

s32 BLM_CHEAPO_DOUT_PinSet | ( | u32 | pin,
|  | u32 | value |
| ) |  |  |

Sets LED to 0 or Vss

Parameters:

  `[in]` | pin | the pin number
  `[in]` | value | the pin value

Returns:
  < 0 if pin not available

Here is the call graph for this function:

u8 BLM_CHEAPO_DOUT_SRGet | ( | u32 | row | ) |

Returns content of red or green "virtual" shift register

Parameters:

  `[in]` | colour | the colour selection (0/1/2)
  `[in]` | sr | the shift register number

Returns:
  < 0 if SR not available

s32 BLM_CHEAPO_DOUT_SRSet | ( | u32 | row,
|  | u8 | value |
| ) |  |  |

Sets 8 LEDs of a row at once

Parameters:

  `[in]` | sr | the row number
  `[in]` | value | state of 8 LEDs

Returns:
  < 0 if SR not available

s32 BLM_CHEAPO_GetRow | ( | void |  | ) |

This function gets the button values of the selected row. It should be called from the APP_SRIO_ServiceFinish() hook

Returns:
  < 0 on errors

Here is the call graph for this function:

s32 BLM_CHEAPO_Init | ( | u32 | mode | ) |

Initializes the BLM_CHEAPO driver Should be called from Init() during startup

Parameters:

  `[in]` | mode | currently only mode 0 supported

Returns:
  < 0 if initialisation failed

Here is the call graph for this function:

s32 BLM_CHEAPO_PrepareCol | ( | void |  | ) |

This function services the row selection lines at J15 and the LED output lines at J5A/B It should be called from the APP_SRIO_ServicePrepare()

Returns:
  < 0 on errors

Here is the call graph for this function: