jlink.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:RTT-Console 作者: dudulung 项目源码 文件源码
def write(self, addr, data):
        """
        Writes data from the array into the device starting at the given address.
        @param int addr: Start address of the memory block to write.
        @param sequence data: Data to write. Any type that implements the sequence API (i.e. string, list, bytearray...) is valid as input.
        """
        if not self._is_u32(addr):
            raise ValueError('The addr parameter must be an unsigned 32-bit value.')

        if not self._is_valid_buf(data):
            raise ValueError('The data parameter must be a sequence type with at least one item.')

        addr = ctypes.c_uint32(addr)
        data_len = ctypes.c_uint32(len(data))
        data = (ctypes.c_uint8 * data_len.value)(*data)
        self.jlink.JLINKARM_WriteMem(addr, data_len, ctypes.byref(data))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号