1 # libgram, the C companion for gram
3 libgram is the C library for gram core initialization and calibration.
7 Build libgram with make. In your firmware:
14 struct gramProfile profile {
21 int err = gram_init(&ctx, &profile, 0x10000000, 0x00006000, 0x00005000);
27 Link it to this library and you should be good to go!
32 GRAM_ERR_NONE: No error happened (hardcoded to zero)
33 GRAM_ERR_UNDOCUMENTED: Undocumented error, shame on us lazy coders (take a look at the code)
34 GRAM_ERR_RDLY_MAX: Read delay calibration unsuccessful because its value exceeds DQSBUFM's max
37 ## Using libgram outside the SoC
39 Compile libgram with `CFLAGS="-DGRAM_RW_FUNC"` (run `make clean` beforehand) and define the following bus access functions:
42 uint32_t gram_read(struct gramCtx *ctx, void *addr);
43 int gram_write(struct gramCtx *ctx, void *addr, uint32_t value);
46 If you want to use the default compiler on your computer, use `CFLAGS="-DGRAM_RW_FUNC" make TRIPLE=""`.