1 # libgram, the C companion for gram
3 libgram is the C library for gram core initialization and memory testing.
7 Build libgram with make. In your firmware:
14 int err = gram_init(&ctx, 0x10000000, 0x00006000, 0x00005000);
20 Link it to this library and you should be good to go!
25 GRAM_ERR_NONE: No error happened (hardcoded to zero)
26 GRAM_ERR_UNDOCUMENTED: Undocumented error, shame on us lazy coders (take a look at the code)
29 ## Using libgram outside the SoC
31 Compile libgram with `CFLAGS="-DGRAM_RW_FUNC"` (run `make clean` beforehand) and define the following bus access functions:
34 uint32_t gram_read(struct gramCtx *ctx, void *addr);
35 int gram_write(struct gramCtx *ctx, void *addr, uint32_t value);
38 If you want to use the default compiler on your computer, use `CFLAGS="-DGRAM_RW_FUNC" make TRIPLE=""`.