h6. [[Hardware Abstraction Layer]] h6(. » [[HAL Device API]] h6((. » [[List of HAL devices]] h6(((. » Battery management unit h5. (HALDeviceSysPeri_BMU) h4. Device API Currently, only API version 0 is defined. API version 0 only allows for BMU variables to be read in a polling fashion; status interrupts, and BMU commands, are not supported. <pre> struct bmudevice { struct device dev; uint32_t flags; void (*readvariables)(struct bmudevice *bmu, uint32_t count, bmureadregs_t *list); uint32_t statusflagsmask; }; </pre> The _flags_ variable corresponds to the [[Battery Management Unit device flags]] that are returned by the [[Portable_EnumerateBMU]] SWI. The _readvariables_ function is used to read a list of variables from the BMU; the _bmureadregs_t_ struct corresponds to the [[BMU Variable Request List]] that is used with SWI [[Portable_ReadBMUVariables]]. The _statusflagsmask_ variable corresponds to the mask of valid [[Battery Management Unit status flags|status flags]] that is returned by SWI [[Portable_EnumerateBMU]]. h4. Support in RISC OS The PortableHAL version of the [[Portable]] module will search for HALDeviceSysPeri_BMU devices upon initialisation. For each device it finds which initialises successfully, it will add it to the list of devices available via [[Portable_EnumerateBMU]] and the other BMU related SWIs (currently, [[Portable_ReadBMUVariable]] and [[Portable_ReadBMUVariables]]). h4. Known implementations table(bordered). |_<. Device ID |_<. Description |_<. Implemented in | |HALDeviceID_BMU_TPS65950 |TPS65950 battery management unit |HAL.OMAP3.s.BMU | |HALDeviceID_BMU_BQ27200 |BQ27200 battery management unit |HAL.OMAP3.s.BMU | |HALDeviceID_BMU_BQ27500 |BQ27500 battery management unit |HAL.OMAP3.s.BMU | h6. Information sources: Kernel.Hdr.HALDevice, HWSupport.PortableHAL.Hdr.BMUDevice in CVS