mcuhwc.h File Reference

mcuHwc service. More...

Go to the source code of this file.

## Data Structures

struct | InfoLedPattern

## Enumerations

enum | powerLedState { LED_NORMAL = 1 , LED_SLEEP_MODE , LED_OFF , LED_RED , LED_BLUE , LED_BLINK_RED }

## Functions

Result | mcuHwcInit (void)
| Initializes mcuHwc.
void | mcuHwcExit (void)
| Exits mcuHwc.
Handle * | mcuHwcGetSessionHandle (void)
| Gets the current mcuHwc session handle. More...
Result | MCUHWC_ReadRegister (u8 reg, void *data, u32 size)
| Reads data from an i2c device3 register. More...
Result | MCUHWC_WriteRegister (u8 reg, const void *data, u32 size)
| Writes data to a i2c device3 register. More...
Result | MCUHWC_GetBatteryVoltage (u8 *voltage)
| Gets the battery voltage. More...
Result | MCUHWC_GetBatteryLevel (u8 *level)
| Gets the battery level. More...
Result | MCUHWC_GetSoundSliderLevel (u8 *level)
| Gets the sound slider level. More...
Result | MCUHWC_SetWifiLedState (bool state)
| Sets Wifi LED state. More...
Result | MCUHWC_SetInfoLedPattern (const InfoLedPattern *pattern)
| Sets the notification LED pattern. More...
Result | MCUHWC_SetPowerLedState (powerLedState state)
| Sets Power LED state. More...
Result | MCUHWC_Get3dSliderLevel (u8 *level)
| Gets 3d slider level. More...
Result | MCUHWC_GetFwVerHigh (u8 *out)
| Gets the major MCU firmware version. More...
Result | MCUHWC_GetFwVerLow (u8 *out)
| Gets the minor MCU firmware version. More...

## Detailed Description

mcuHwc service.

## Enumeration Type Documentation

## powerLedState

enum powerLedState

Enumerator
LED_NORMAL | The normal mode of the led.
LED_SLEEP_MODE | The led pulses slowly as it does in the sleep mode.
LED_OFF | Switch off power led.
LED_RED | Red state of the led.
LED_BLUE | Blue state of the led.
LED_BLINK_RED | Blinking red state of power led and notification led.

## Function Documentation

## MCUHWC_Get3dSliderLevel()

Result MCUHWC_Get3dSliderLevel | ( | u8 * | level | ) |

Gets 3d slider level.

Parameters

  level | Pointer to write 3D slider level to.

## MCUHWC_GetBatteryLevel()

Result MCUHWC_GetBatteryLevel | ( | u8 * | level | ) |

Gets the battery level.

Parameters

  level | Pointer to write the current battery level to.

## MCUHWC_GetBatteryVoltage()

Result MCUHWC_GetBatteryVoltage | ( | u8 * | voltage | ) |

Gets the battery voltage.

Parameters

  voltage | Pointer to write the battery voltage to.

## MCUHWC_GetFwVerHigh()

Result MCUHWC_GetFwVerHigh | ( | u8 * | out | ) |

Gets the major MCU firmware version.

Parameters

  out | Pointer to write the major firmware version to.

## MCUHWC_GetFwVerLow()

Result MCUHWC_GetFwVerLow | ( | u8 * | out | ) |

Gets the minor MCU firmware version.

Parameters

  out | Pointer to write the minor firmware version to.

## MCUHWC_GetSoundSliderLevel()

Result MCUHWC_GetSoundSliderLevel | ( | u8 * | level | ) |

Gets the sound slider level.

Parameters

  level | Pointer to write the slider level to.

## MCUHWC_ReadRegister()

Result MCUHWC_ReadRegister | ( | u8 | reg,
|  | void * | data,
|  | u32 | size
| ) |  |

Reads data from an i2c device3 register.

Parameters

  reg | Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info
  data | Pointer to write the data to.
  size | Size of data to be read

## MCUHWC_SetInfoLedPattern()

Result MCUHWC_SetInfoLedPattern | ( | const InfoLedPattern * | pattern | ) |

Sets the notification LED pattern.

Parameters

  pattern | Pattern for the notification LED.

## MCUHWC_SetPowerLedState()

Result MCUHWC_SetPowerLedState | ( | powerLedState | state | ) |

Sets Power LED state.

Parameters

  state | powerLedState State of power LED.

## MCUHWC_SetWifiLedState()

Result MCUHWC_SetWifiLedState | ( | bool | state | ) |

Sets Wifi LED state.

Parameters

  state | State of Wifi LED. (True/False)

## MCUHWC_WriteRegister()

Result MCUHWC_WriteRegister | ( | u8 | reg,
|  | const void * | data,
|  | u32 | size
| ) |  |

Writes data to a i2c device3 register.

Parameters

  reg | Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info
  data | Pointer to write the data to.
  size | Size of data to be written

## mcuHwcGetSessionHandle()

Handle* mcuHwcGetSessionHandle | ( | void |  | ) |

Gets the current mcuHwc session handle.

Returns
  A pointer to the current mcuHwc session handle.