Lines Matching refs:byte_ofs

73 int mec_hal_bbram_rd8(uint16_t byte_ofs, uint8_t *val)  in mec_hal_bbram_rd8()  argument
75 if (!val || (byte_ofs >= MEC_VBAT_MEM_SIZE)) { in mec_hal_bbram_rd8()
79 *val = MEC_VBATM->VBMEM[byte_ofs]; in mec_hal_bbram_rd8()
84 int mec_hal_bbram_wr8(uint16_t byte_ofs, uint8_t val) in mec_hal_bbram_wr8() argument
86 if (byte_ofs >= MEC_VBAT_MEM_SIZE) { in mec_hal_bbram_wr8()
90 MEC_VBATM->VBMEM[byte_ofs] = val; in mec_hal_bbram_wr8()
95 int mec_hal_bbram_rd32(uint16_t byte_ofs, uint32_t *val) in mec_hal_bbram_rd32() argument
99 if (!val || (byte_ofs >= MEC_VBAT_MEM_SIZE)) { in mec_hal_bbram_rd32()
103 if (!(byte_ofs & 0x3u)) { in mec_hal_bbram_rd32()
104 r = MEC_MMCR32(&MEC_VBATM->VBMEM[byte_ofs]); in mec_hal_bbram_rd32()
108 r |= MEC_VBATM->VBMEM[byte_ofs + 3 - i]; in mec_hal_bbram_rd32()
117 int mec_hal_bbram_wr32(uint16_t byte_ofs, uint32_t val) in mec_hal_bbram_wr32() argument
119 if (byte_ofs >= MEC_VBAT_MEM_SIZE) { in mec_hal_bbram_wr32()
123 if (!(byte_ofs & 0x3u)) { in mec_hal_bbram_wr32()
124 MEC_MMCR32(&MEC_VBATM->VBMEM[byte_ofs]) = val; in mec_hal_bbram_wr32()
127 MEC_VBATM->VBMEM[byte_ofs + i] = val & 0xffu; in mec_hal_bbram_wr32()
135 int mec_hal_bbram_rd(uint16_t byte_ofs, uint8_t *data, size_t datasz, size_t *nread) in mec_hal_bbram_rd() argument
137 if (!data || (byte_ofs >= MEC_VBAT_MEM_SIZE)) { in mec_hal_bbram_rd()
141 for (uint16_t idx = byte_ofs; idx < (uint16_t)MEC_VBAT_MEM_SIZE; idx++) { in mec_hal_bbram_rd()
155 int mec_hal_bbram_wr(uint16_t byte_ofs, uint8_t *data, size_t datasz, size_t *nwritten) in mec_hal_bbram_wr() argument
157 if (!data || (byte_ofs >= MEC_VBAT_MEM_SIZE)) { in mec_hal_bbram_wr()
161 for (uint16_t idx = byte_ofs; idx < (uint16_t)MEC_VBAT_MEM_SIZE; idx++) { in mec_hal_bbram_wr()